From 442dadc1b4a44607b1c026d45a3e5bc068bcd182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=BD=AA?= <1315508912@qq.com> Date: Sun, 14 Jan 2024 01:01:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dwindows=E4=B8=8A?= =?UTF-8?q?=E9=83=A8=E5=88=86=E8=BE=93=E5=85=A5=E6=A1=86=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DownKyi/App.axaml.cs | 16 +++++----------- DownKyi/ViewModels/MainWindowViewModel.cs | 5 +---- DownKyi/Views/Dialogs/ViewDownloadSetter.axaml | 1 - DownKyi/Views/MainWindow.axaml | 3 +++ DownKyi/Views/Settings/ViewDanmaku.axaml | 4 ---- DownKyi/Views/Settings/ViewNetwork.axaml | 1 - DownKyi/Views/Toolbox/ViewBiliHelper.axaml | 3 --- DownKyi/Views/Toolbox/ViewDelogo.axaml | 11 +---------- DownKyi/Views/ViewVideoDetail.axaml | 1 - 9 files changed, 10 insertions(+), 35 deletions(-) diff --git a/DownKyi/App.axaml.cs b/DownKyi/App.axaml.cs index d6482ca..f5b692c 100644 --- a/DownKyi/App.axaml.cs +++ b/DownKyi/App.axaml.cs @@ -38,25 +38,20 @@ public partial class App : PrismApplication public static ObservableCollection? DownloadedList { get; set; } public new static App Current => (App)Application.Current!; public new MainWindow MainWindow => Container.Resolve(); - private IClassicDesktopStyleApplicationLifetime _appLife; + public IClassicDesktopStyleApplicationLifetime? AppLife; // 下载服务 private IDownloadService? _downloadService; - public static AppBuilder BuildAvaloniaApp() => - AppBuilder - .Configure() - .UsePlatformDetect(); - public override void Initialize() { AvaloniaXamlLoader.Load(this); if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { desktop.Exit += OnExit!; - _appLife = desktop; + AppLife = desktop; } - + base.Initialize(); } @@ -209,7 +204,7 @@ public partial class App : PrismApplication _downloadService = new AriaDownloadService(DownloadingList, DownloadedList, (IDialogService)Container.GetContainer().GetService(typeof(IDialogService))); break; case Downloader.CUSTOM_ARIA: - // downloadService = new CustomAriaDownloadService(DownloadingList, DownloadedList, (IDialogService)Container.GetContainer().GetService(typeof(IDialogService))); + _downloadService = new CustomAriaDownloadService(DownloadingList, DownloadedList, (IDialogService)Container.GetContainer().GetService(typeof(IDialogService))); break; } @@ -219,7 +214,6 @@ public partial class App : PrismApplication _downloadService?.Start(); } - return Container.Resolve(); } @@ -278,6 +272,6 @@ public partial class App : PrismApplication private void NativeMenuItem_OnClick(object? sender, EventArgs e) { - _appLife.Shutdown(); + AppLife?.Shutdown(); } } \ No newline at end of file diff --git a/DownKyi/ViewModels/MainWindowViewModel.cs b/DownKyi/ViewModels/MainWindowViewModel.cs index 7fa75cd..7944324 100644 --- a/DownKyi/ViewModels/MainWindowViewModel.cs +++ b/DownKyi/ViewModels/MainWindowViewModel.cs @@ -45,7 +45,7 @@ public class MainWindowViewModel : BindableBase set => SetProperty(ref _message, value); } - private DelegateCommand? LoadedCommand { get; } + public DelegateCommand? LoadedCommand { get; } public DelegateCommand DragMoveCommand { get; private set; } private DelegateCommand? _closingCommand; @@ -144,9 +144,6 @@ public class MainWindowViewModel : BindableBase // ignored } }); - - - Dispatcher.UIThread.InvokeAsync(() => { LoadedCommand.Execute(); }); } #region 剪贴板 diff --git a/DownKyi/Views/Dialogs/ViewDownloadSetter.axaml b/DownKyi/Views/Dialogs/ViewDownloadSetter.axaml index 6c6f280..d4e15e3 100644 --- a/DownKyi/Views/Dialogs/ViewDownloadSetter.axaml +++ b/DownKyi/Views/Dialogs/ViewDownloadSetter.axaml @@ -90,7 +90,6 @@ + + + diff --git a/DownKyi/Views/Settings/ViewDanmaku.axaml b/DownKyi/Views/Settings/ViewDanmaku.axaml index 09a6977..a79f325 100644 --- a/DownKyi/Views/Settings/ViewDanmaku.axaml +++ b/DownKyi/Views/Settings/ViewDanmaku.axaml @@ -62,7 +62,6 @@ @@ -82,7 +81,6 @@ @@ -127,7 +125,6 @@ @@ -150,7 +147,6 @@ diff --git a/DownKyi/Views/Settings/ViewNetwork.axaml b/DownKyi/Views/Settings/ViewNetwork.axaml index fd40baf..ff08977 100644 --- a/DownKyi/Views/Settings/ViewNetwork.axaml +++ b/DownKyi/Views/Settings/ViewNetwork.axaml @@ -35,7 +35,6 @@ diff --git a/DownKyi/Views/Toolbox/ViewBiliHelper.axaml b/DownKyi/Views/Toolbox/ViewBiliHelper.axaml index 8c2daf9..d4f20ab 100644 --- a/DownKyi/Views/Toolbox/ViewBiliHelper.axaml +++ b/DownKyi/Views/Toolbox/ViewBiliHelper.axaml @@ -30,7 +30,6 @@ @@ -52,7 +51,6 @@ @@ -95,7 +93,6 @@ diff --git a/DownKyi/Views/Toolbox/ViewDelogo.axaml b/DownKyi/Views/Toolbox/ViewDelogo.axaml index 6f663c9..d32fbcd 100644 --- a/DownKyi/Views/Toolbox/ViewDelogo.axaml +++ b/DownKyi/Views/Toolbox/ViewDelogo.axaml @@ -24,7 +24,6 @@ @@ -65,14 +62,12 @@ @@ -94,11 +89,7 @@ Grid.Row="1" Margin="0,20" HorizontalAlignment="Stretch" - VerticalAlignment="Stretch"> - - - - + VerticalAlignment="Stretch" RowDefinitions="20,*">