diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ae1001f..587edcb0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: Serein.Pro_win-x64 - path: ./src/Serein.Pro/bin/Debug/net8.0-windows10.0.19041.0/win-x64 + path: ./src/Serein.Pro/bin/Debug/net8.0-windows10.0.19041/win-x64 # Serein.Cli - name: Upload binary files(Serein.Cli_win-x64) diff --git a/src/Serein.Pro/App.xaml.cs b/src/Serein.Pro/App.xaml.cs index 0025ff92..db99d0e1 100644 --- a/src/Serein.Pro/App.xaml.cs +++ b/src/Serein.Pro/App.xaml.cs @@ -44,6 +44,7 @@ private static SereinApp Build() builder.Services.AddTransient(); builder.Services.AddTransient(); + builder.Services.AddTransient(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); diff --git a/src/Serein.Pro/MainWindow.xaml b/src/Serein.Pro/MainWindow.xaml index facbc66b..8bde361d 100644 --- a/src/Serein.Pro/MainWindow.xaml +++ b/src/Serein.Pro/MainWindow.xaml @@ -17,24 +17,35 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/Serein.Pro/MainWindow.xaml.cs b/src/Serein.Pro/MainWindow.xaml.cs index 3cce46b3..6d3cc57b 100644 --- a/src/Serein.Pro/MainWindow.xaml.cs +++ b/src/Serein.Pro/MainWindow.xaml.cs @@ -3,12 +3,17 @@ using System.Threading; using System.Threading.Tasks; +using Microsoft.UI; using Microsoft.UI.Dispatching; +using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Media; using Serein.Pro.Models; using Serein.Pro.Views; +using Windows.ApplicationModel.DataTransfer; + using WinUIEx; namespace Serein.Pro; @@ -16,7 +21,7 @@ namespace Serein.Pro; public sealed partial class MainWindow : WindowEx { private readonly DispatcherQueue _dispatcherQueue; - private CancellationTokenSource ?_cancellationTokenSource; + private CancellationTokenSource? _cancellationTokenSource; public MainWindow(ShellPage shellPage) { @@ -39,7 +44,7 @@ public void ShowInfoBar(InfoBarTask infoBarTask) GlobalInfoBar.IsOpen = true; _cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(infoBarTask.CancellationToken); - + GlobalInfoBarPopIn.Completed += Wait; GlobalInfoBarPopIn.Begin(); @@ -74,4 +79,23 @@ private void GlobalInfoBar_CloseButtonClick(InfoBar sender, object args) if (_cancellationTokenSource?.IsCancellationRequested is false) _cancellationTokenSource.Cancel(); } + + private void DragBorder_DragOver(object sender, DragEventArgs e) + { + if (e.DataView.Contains(StandardDataFormats.StorageItems)) + { + e.AcceptedOperation = DataPackageOperation.Copy; + DragBorder.BorderBrush = new SolidColorBrush(Colors.Goldenrod); + } + } + + private void DragBorder_DragLeave(object sender, DragEventArgs e) + { + DragBorder.BorderBrush = new SolidColorBrush(Colors.Transparent); + } + + private void DragBorder_DragEnter(object sender, DragEventArgs e) + { + + } } diff --git a/src/Serein.Pro/Serein.Pro.csproj b/src/Serein.Pro/Serein.Pro.csproj index 0d4bf0d8..319348f1 100644 --- a/src/Serein.Pro/Serein.Pro.csproj +++ b/src/Serein.Pro/Serein.Pro.csproj @@ -17,6 +17,7 @@ + @@ -33,6 +34,12 @@ + + + MSBuild:Compile + + + MSBuild:Compile diff --git a/src/Serein.Pro/ViewModels/AboutViewModel.cs b/src/Serein.Pro/ViewModels/AboutViewModel.cs new file mode 100644 index 00000000..44572582 --- /dev/null +++ b/src/Serein.Pro/ViewModels/AboutViewModel.cs @@ -0,0 +1,13 @@ +using Serein.Core; + +namespace Serein.Pro.ViewModels; +public class AboutViewModel +{ + public string Version { get; } = SereinApp.Version; + + public string DetailedVersion { get; } = SereinApp.FullVersion ?? "未知"; + + public string AssemblyName { get; } = typeof(AboutViewModel).Assembly.ToString(); + + public string AssemblyPath { get; } = typeof(AboutViewModel).Assembly.Location; +} diff --git a/src/Serein.Pro/ViewModels/SettingViewModel.cs b/src/Serein.Pro/ViewModels/SettingViewModel.cs index fc14acbc..d7b6cebd 100644 --- a/src/Serein.Pro/ViewModels/SettingViewModel.cs +++ b/src/Serein.Pro/ViewModels/SettingViewModel.cs @@ -7,4 +7,6 @@ namespace Serein.Pro.ViewModels; public class SettingViewModel { public Type Connection { get; } = typeof(ConnectionSettingPage); + + public Type About { get; } = typeof(AboutPage); } diff --git a/src/Serein.Pro/Views/BugSolvingPage.xaml b/src/Serein.Pro/Views/BugSolvingPage.xaml index 004eb59d..ccb65984 100644 --- a/src/Serein.Pro/Views/BugSolvingPage.xaml +++ b/src/Serein.Pro/Views/BugSolvingPage.xaml @@ -10,7 +10,7 @@ diff --git a/src/Serein.Pro/Views/HomePage.xaml b/src/Serein.Pro/Views/HomePage.xaml index 7889fcbc..6d31b32f 100644 --- a/src/Serein.Pro/Views/HomePage.xaml +++ b/src/Serein.Pro/Views/HomePage.xaml @@ -6,7 +6,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="using:Serein.Pro.Views" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" mc:Ignorable="d"> diff --git a/src/Serein.Pro/Views/MatchPage.xaml b/src/Serein.Pro/Views/MatchPage.xaml index bd1e59cc..48106f93 100644 --- a/src/Serein.Pro/Views/MatchPage.xaml +++ b/src/Serein.Pro/Views/MatchPage.xaml @@ -11,7 +11,42 @@ mc:Ignorable="d"> - + + + + + + + + + + + @@ -43,5 +78,12 @@ + +