diff --git a/src/DownKyi/AppConstant.cs b/src/DownKyi/AppConstant.cs new file mode 100644 index 0000000..cad527c --- /dev/null +++ b/src/DownKyi/AppConstant.cs @@ -0,0 +1,7 @@ +namespace DownKyi +{ + public class AppConstant + { + public const string ClipboardId = "32ff00b1-1a09-4b25-9ca7-dcb6914b141c"; + } +} diff --git a/src/DownKyi/DownKyi.csproj b/src/DownKyi/DownKyi.csproj index 21760fc..1f6c474 100644 --- a/src/DownKyi/DownKyi.csproj +++ b/src/DownKyi/DownKyi.csproj @@ -95,6 +95,7 @@ MSBuild:Compile Designer + CustomPager.xaml @@ -498,7 +499,6 @@ ResXFileCodeGenerator Resources.Designer.cs - @@ -580,12 +580,6 @@ - - PreserveNewest - - - PreserveNewest - PreserveNewest diff --git a/src/DownKyi/ViewModels/MainWindowViewModel.cs b/src/DownKyi/ViewModels/MainWindowViewModel.cs index c806981..47714da 100644 --- a/src/DownKyi/ViewModels/MainWindowViewModel.cs +++ b/src/DownKyi/ViewModels/MainWindowViewModel.cs @@ -354,7 +354,7 @@ namespace DownKyi.ViewModels } SearchService searchService = new SearchService(); - searchService.BiliInput(input, ViewIndexViewModel.Tag, eventAggregator); + searchService.BiliInput(input + AppConstant.ClipboardId, ViewIndexViewModel.Tag, eventAggregator); } #endregion diff --git a/src/DownKyi/ViewModels/ViewVideoDetailViewModel.cs b/src/DownKyi/ViewModels/ViewVideoDetailViewModel.cs index dcc1e02..edb6cf2 100644 --- a/src/DownKyi/ViewModels/ViewVideoDetailViewModel.cs +++ b/src/DownKyi/ViewModels/ViewVideoDetailViewModel.cs @@ -30,7 +30,7 @@ namespace DownKyi.ViewModels private readonly IDialogService dialogService; // 保存输入字符串,避免被用户修改 - private string input; + private string input = null; #region 页面属性申明 @@ -745,8 +745,6 @@ namespace DownKyi.ViewModels /// public override void OnNavigatedTo(NavigationContext navigationContext) { - base.OnNavigatedTo(navigationContext); - ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark"); DownloadManage = ButtonIcon.Instance().DownloadManage; @@ -757,13 +755,25 @@ namespace DownKyi.ViewModels // Parent参数为null时,表示是从下一个页面返回到本页面,不需要执行任务 if (navigationContext.Parameters.GetValue("Parent") != null) { + string param = navigationContext.Parameters.GetValue("Parameter"); + // 移除剪贴板id + string intput = param.Replace(AppConstant.ClipboardId, ""); + + // 检测是否从剪贴板传入 + if (InputText == intput && param.EndsWith(AppConstant.ClipboardId)) + { + return; + } + // 正在执行任务时不开启新任务 if (LoadingVisibility != Visibility.Visible) { - InputText = navigationContext.Parameters.GetValue("Parameter"); + InputText = intput; PropertyChangeAsync(ExecuteInputCommand); } } + + base.OnNavigatedTo(navigationContext); } }