From 7cb32d3eb9aeda2dfb118fb0054e7b5e4d18c209 Mon Sep 17 00:00:00 2001 From: woni <320753691@qq.com> Date: Wed, 28 Aug 2024 23:14:50 +0800 Subject: [PATCH] add configuration page --- GZStudio/App.xaml.cs | 2 + GZStudio/Services/PageService.cs | 1 + GZStudio/Strings/en-us/Resources.resw | 73 ++++++++++++++++++- GZStudio/Strings/zh-cn/Resources.resw | 3 + GZStudio/ViewModels/ConfigurationViewModel.cs | 10 +++ GZStudio/Views/ConfigurationPage.xaml | 29 ++++++++ GZStudio/Views/ConfigurationPage.xaml.cs | 19 +++++ GZStudio/Views/ShellPage.xaml | 5 ++ 8 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 GZStudio/ViewModels/ConfigurationViewModel.cs create mode 100644 GZStudio/Views/ConfigurationPage.xaml create mode 100644 GZStudio/Views/ConfigurationPage.xaml.cs diff --git a/GZStudio/App.xaml.cs b/GZStudio/App.xaml.cs index d96168b..7566d16 100644 --- a/GZStudio/App.xaml.cs +++ b/GZStudio/App.xaml.cs @@ -72,6 +72,8 @@ public partial class App : Application services.AddSingleton(); // Views and ViewModels + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/GZStudio/Services/PageService.cs b/GZStudio/Services/PageService.cs index 98a2b2f..24cbcd1 100644 --- a/GZStudio/Services/PageService.cs +++ b/GZStudio/Services/PageService.cs @@ -16,6 +16,7 @@ public class PageService : IPageService { Configure(); Configure(); + Configure(); } public Type GetPageType(string key) diff --git a/GZStudio/Strings/en-us/Resources.resw b/GZStudio/Strings/en-us/Resources.resw index 6fb4a99..fa4af90 100644 --- a/GZStudio/Strings/en-us/Resources.resw +++ b/GZStudio/Strings/en-us/Resources.resw @@ -1,5 +1,64 @@  + @@ -61,9 +120,9 @@ GZStudio - - GZStudio - + + GZStudio + AppList @@ -108,4 +167,10 @@ </actions> </toast> - + + Configuration + + + Import + + \ No newline at end of file diff --git a/GZStudio/Strings/zh-cn/Resources.resw b/GZStudio/Strings/zh-cn/Resources.resw index c905265..b6b695f 100644 --- a/GZStudio/Strings/zh-cn/Resources.resw +++ b/GZStudio/Strings/zh-cn/Resources.resw @@ -170,4 +170,7 @@ 导入 + + 配置 + \ No newline at end of file diff --git a/GZStudio/ViewModels/ConfigurationViewModel.cs b/GZStudio/ViewModels/ConfigurationViewModel.cs new file mode 100644 index 0000000..ac3dcd2 --- /dev/null +++ b/GZStudio/ViewModels/ConfigurationViewModel.cs @@ -0,0 +1,10 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +namespace GZStudio.ViewModels; + +public partial class ConfigurationViewModel : ObservableRecipient +{ + public ConfigurationViewModel() + { + } +} diff --git a/GZStudio/Views/ConfigurationPage.xaml b/GZStudio/Views/ConfigurationPage.xaml new file mode 100644 index 0000000..adcb0f6 --- /dev/null +++ b/GZStudio/Views/ConfigurationPage.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GZStudio/Views/ConfigurationPage.xaml.cs b/GZStudio/Views/ConfigurationPage.xaml.cs new file mode 100644 index 0000000..cd6c0b5 --- /dev/null +++ b/GZStudio/Views/ConfigurationPage.xaml.cs @@ -0,0 +1,19 @@ +using GZStudio.ViewModels; + +using Microsoft.UI.Xaml.Controls; + +namespace GZStudio.Views; + +public sealed partial class ConfigurationPage : Page +{ + public ConfigurationViewModel ViewModel + { + get; + } + + public ConfigurationPage() + { + ViewModel = App.GetService(); + InitializeComponent(); + } +} diff --git a/GZStudio/Views/ShellPage.xaml b/GZStudio/Views/ShellPage.xaml index 37bb220..aefa2f4 100644 --- a/GZStudio/Views/ShellPage.xaml +++ b/GZStudio/Views/ShellPage.xaml @@ -48,6 +48,11 @@ + + + + +