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,*">