From 8922ab421b58d8aa17871bab74ab2beee6a4401c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A7=9A=E5=BD=AA?= <1315508912@qq.com>
Date: Mon, 8 Apr 2024 21:49:18 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=9A=97=E9=BB=91?=
=?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=A1=A8=E7=8E=B0=E5=B9=B6=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?dialog=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F=E5=BC=82=E5=B8=B8?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../PrismExtension/Dialog/DialogWindow.axaml | 19 +++++---
DownKyi/Themes/Colors/ColorDark.axaml | 4 +-
.../ViewDownloadManagerViewModel.cs | 27 +++---------
DownKyi/ViewModels/ViewLoginViewModel.cs | 20 ++-------
DownKyi/ViewModels/ViewToolboxViewModel.cs | 44 ++++++-------------
DownKyi/Views/Dialogs/ViewAlertDialog.axaml | 16 +++----
.../Dialogs/ViewAlreadyDownloadedDialog.axaml | 16 +++----
.../Views/Dialogs/ViewDownloadSetter.axaml | 37 +++++++---------
.../Views/Dialogs/ViewParsingSelector.axaml | 19 ++++----
.../ViewDownloadFinished.axaml | 2 +-
.../DownloadManager/ViewDownloading.axaml | 6 +--
DownKyi/Views/Settings/ViewAbout.axaml | 6 ++-
DownKyi/Views/Toolbox/ViewBiliHelper.axaml | 4 +-
DownKyi/Views/Toolbox/ViewDelogo.axaml | 4 +-
DownKyi/Views/Toolbox/ViewExtractMedia.axaml | 6 +--
DownKyi/Views/ViewDownloadManager.axaml | 9 ++--
DownKyi/Views/ViewLogin.axaml | 9 ++--
DownKyi/Views/ViewMySpace.axaml | 9 ++--
DownKyi/Views/ViewToolbox.axaml | 9 ++--
19 files changed, 109 insertions(+), 157 deletions(-)
diff --git a/DownKyi/PrismExtension/Dialog/DialogWindow.axaml b/DownKyi/PrismExtension/Dialog/DialogWindow.axaml
index e7e798d..7884021 100644
--- a/DownKyi/PrismExtension/Dialog/DialogWindow.axaml
+++ b/DownKyi/PrismExtension/Dialog/DialogWindow.axaml
@@ -5,18 +5,23 @@
Title="{Binding Title}"
WindowStartupLocation="CenterOwner">
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DownKyi/Themes/Colors/ColorDark.axaml b/DownKyi/Themes/Colors/ColorDark.axaml
index fdc67a1..dbfee3b 100644
--- a/DownKyi/Themes/Colors/ColorDark.axaml
+++ b/DownKyi/Themes/Colors/ColorDark.axaml
@@ -1,7 +1,7 @@
Black
- Black
+ white
#7FD0D0D0
white
black
@@ -16,7 +16,7 @@
#FF00A1D6
#7FD0D0D0
#7FD0D0D0
- white
+ Black
white
#FF141414
diff --git a/DownKyi/ViewModels/ViewDownloadManagerViewModel.cs b/DownKyi/ViewModels/ViewDownloadManagerViewModel.cs
index 17ae3d3..d0ca4aa 100644
--- a/DownKyi/ViewModels/ViewDownloadManagerViewModel.cs
+++ b/DownKyi/ViewModels/ViewDownloadManagerViewModel.cs
@@ -18,28 +18,20 @@ public class ViewDownloadManagerViewModel : ViewModelBase
#region 页面属性申明
- private VectorImage arrowBack;
-
- public VectorImage ArrowBack
- {
- get => arrowBack;
- set => SetProperty(ref arrowBack, value);
- }
-
- private List tabHeaders;
+ private List _tabHeaders;
public List TabHeaders
{
- get => tabHeaders;
- set => SetProperty(ref tabHeaders, value);
+ get => _tabHeaders;
+ set => SetProperty(ref _tabHeaders, value);
}
- private int selectTabId;
+ private int _selectTabId;
public int SelectTabId
{
- get => selectTabId;
- set => SetProperty(ref selectTabId, value);
+ get => _selectTabId;
+ set => SetProperty(ref _selectTabId, value);
}
#endregion
@@ -51,9 +43,6 @@ public class ViewDownloadManagerViewModel : ViewModelBase
#region 属性初始化
- ArrowBack = NavigationIcon.Instance().ArrowBack;
- ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
-
TabHeaders = new List
{
new()
@@ -107,7 +96,7 @@ public class ViewDownloadManagerViewModel : ViewModelBase
return;
}
- NavigationParameters param = new NavigationParameters();
+ var param = new NavigationParameters();
switch (tabHeader.Id)
{
@@ -136,7 +125,5 @@ public class ViewDownloadManagerViewModel : ViewModelBase
SelectTabId = 0;
PropertyChangeAsync(() => { regionManager.RequestNavigate("DownloadManagerContentRegion", ViewDownloadingViewModel.Tag, new NavigationParameters()); });
-
- ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
}
}
\ No newline at end of file
diff --git a/DownKyi/ViewModels/ViewLoginViewModel.cs b/DownKyi/ViewModels/ViewLoginViewModel.cs
index b5ac52c..7eb2821 100644
--- a/DownKyi/ViewModels/ViewLoginViewModel.cs
+++ b/DownKyi/ViewModels/ViewLoginViewModel.cs
@@ -5,7 +5,6 @@ using Avalonia.Media.Imaging;
using DownKyi.Core.BiliApi.Login;
using DownKyi.Core.Logging;
using DownKyi.Events;
-using DownKyi.Images;
using DownKyi.Utils;
using Prism.Commands;
using Prism.Events;
@@ -22,14 +21,6 @@ public class ViewLoginViewModel : ViewModelBase
#region 页面属性申明
- private VectorImage _arrowBack;
-
- public VectorImage ArrowBack
- {
- get => _arrowBack;
- set => SetProperty(ref _arrowBack, value);
- }
-
private Bitmap? _loginQrCode;
public Bitmap? LoginQrCode
@@ -60,9 +51,6 @@ public class ViewLoginViewModel : ViewModelBase
{
#region 属性初始化
- ArrowBack = NavigationIcon.Instance().ArrowBack;
- ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
-
#endregion
}
@@ -78,7 +66,7 @@ public class ViewLoginViewModel : ViewModelBase
// 结束任务
_tokenSource.Cancel();
- NavigationParam parameter = new NavigationParam
+ var parameter = new NavigationParam
{
ViewName = ParentView,
ParentViewName = null,
@@ -131,7 +119,7 @@ public class ViewLoginViewModel : ViewModelBase
///
private void GetLoginStatus(string oauthKey)
{
- CancellationToken cancellationToken = _tokenSource.Token;
+ var cancellationToken = _tokenSource.Token;
while (true)
{
Thread.Sleep(1000);
@@ -196,7 +184,7 @@ public class ViewLoginViewModel : ViewModelBase
// 保存登录信息
try
{
- bool isSucceed = LoginHelper.SaveLoginInfoCookies(loginStatus.Data.Url);
+ var isSucceed = LoginHelper.SaveLoginInfoCookies(loginStatus.Data.Url);
if (!isSucceed)
{
EventAggregator.GetEvent()
@@ -236,8 +224,6 @@ public class ViewLoginViewModel : ViewModelBase
///
private void InitStatus()
{
- ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
-
LoginQrCode = null;
LoginQrCodeOpacity = 1;
LoginQrCodeStatus = false;
diff --git a/DownKyi/ViewModels/ViewToolboxViewModel.cs b/DownKyi/ViewModels/ViewToolboxViewModel.cs
index e7fbb53..9e3fd92 100644
--- a/DownKyi/ViewModels/ViewToolboxViewModel.cs
+++ b/DownKyi/ViewModels/ViewToolboxViewModel.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using DownKyi.Events;
-using DownKyi.Images;
using DownKyi.Utils;
using DownKyi.ViewModels.PageViewModels;
using DownKyi.ViewModels.Toolbox;
@@ -18,28 +17,20 @@ namespace DownKyi.ViewModels
#region 页面属性申明
- private VectorImage arrowBack;
-
- public VectorImage ArrowBack
- {
- get => arrowBack;
- set => SetProperty(ref arrowBack, value);
- }
-
- private List tabHeaders;
+ private List _tabHeaders;
public List TabHeaders
{
- get => tabHeaders;
- set => SetProperty(ref tabHeaders, value);
+ get => _tabHeaders;
+ set => SetProperty(ref _tabHeaders, value);
}
- private int selectTabId;
+ private int _selectTabId;
public int SelectTabId
{
- get => selectTabId;
- set => SetProperty(ref selectTabId, value);
+ get => _selectTabId;
+ set => SetProperty(ref _selectTabId, value);
}
#endregion
@@ -51,9 +42,6 @@ namespace DownKyi.ViewModels
#region 属性初始化
- ArrowBack = NavigationIcon.Instance().ArrowBack;
- ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
-
TabHeaders = new List
{
new() { Id = 0, Title = DictionaryResource.GetString("BiliHelper") },
@@ -67,17 +55,16 @@ namespace DownKyi.ViewModels
#region 命令申明
// 返回事件
- private DelegateCommand backSpaceCommand;
+ private DelegateCommand? _backSpaceCommand;
- public DelegateCommand BackSpaceCommand =>
- backSpaceCommand ?? (backSpaceCommand = new DelegateCommand(ExecuteBackSpace));
+ public DelegateCommand BackSpaceCommand => _backSpaceCommand ??= new DelegateCommand(ExecuteBackSpace);
///
/// 返回事件
///
private void ExecuteBackSpace()
{
- NavigationParam parameter = new NavigationParam
+ var parameter = new NavigationParam
{
ViewName = ParentView,
ParentViewName = null,
@@ -87,12 +74,9 @@ namespace DownKyi.ViewModels
}
// 左侧tab点击事件
- private DelegateCommand