From 7d6ddfb451526214e05b9505541d2e3146dfe1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=9D=E5=8D=81?= <392706283@qq.com> Date: Wed, 5 Apr 2023 22:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BE=93=E5=85=A5=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加搜索框输入事件 --- .../ViewModels/ViewVideoDetailViewModel.cs | 19 +++++++++++++++++++ src/DownKyi/Views/ViewVideoDetail.xaml | 7 ++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/DownKyi/ViewModels/ViewVideoDetailViewModel.cs b/src/DownKyi/ViewModels/ViewVideoDetailViewModel.cs index 5d7551b..f8c3367 100644 --- a/src/DownKyi/ViewModels/ViewVideoDetailViewModel.cs +++ b/src/DownKyi/ViewModels/ViewVideoDetailViewModel.cs @@ -46,7 +46,13 @@ namespace DownKyi.ViewModels get => inputText; set => SetProperty(ref inputText, value); } + private string inputSearchText; + public string InputSearchText + { + get => inputSearchText; + set => SetProperty(ref inputSearchText, value); + } private GifImage loading; public GifImage Loading { @@ -172,6 +178,19 @@ namespace DownKyi.ViewModels private DelegateCommand inputCommand; public DelegateCommand InputCommand => inputCommand ?? (inputCommand = new DelegateCommand(ExecuteInputCommand, CanExecuteInputCommand)); + + private DelegateCommand inputSearchCommand; + + public DelegateCommand InputSearchCommand => inputSearchCommand ?? (inputSearchCommand = new DelegateCommand(ExcuteInputSearchCommand)); + /// + /// 搜索视频输入时间 + /// + private async void ExcuteInputSearchCommand() { + await Task.Run(() => + { + if (InputSearchText == null || InputSearchText == string.Empty) { return; } + }); + } /// /// 处理输入事件 /// diff --git a/src/DownKyi/Views/ViewVideoDetail.xaml b/src/DownKyi/Views/ViewVideoDetail.xaml index aa73d6b..422fa33 100644 --- a/src/DownKyi/Views/ViewVideoDetail.xaml +++ b/src/DownKyi/Views/ViewVideoDetail.xaml @@ -694,9 +694,10 @@ - + - + - +