add configuration page
This commit is contained in:
1 parent
ad1adbff15
commit
7cb32d3eb9
8 files changed
+134
No files matched your search
@@ -72,6 +72,8 @@ public partial class App : Application
|
|||||||
services.AddSingleton<IFileService, FileService>();
|
services.AddSingleton<IFileService, FileService>();
|
||||||
|
|
||||||
// Views and ViewModels
|
// Views and ViewModels
|
||||||
|
services.AddTransient<ConfigurationViewModel>();
|
||||||
|
services.AddTransient<ConfigurationPage>();
|
||||||
services.AddTransient<SettingsViewModel>();
|
services.AddTransient<SettingsViewModel>();
|
||||||
services.AddTransient<SettingsPage>();
|
services.AddTransient<SettingsPage>();
|
||||||
services.AddTransient<AppListViewModel>();
|
services.AddTransient<AppListViewModel>();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public class PageService : IPageService
|
|||||||
{
|
{
|
||||||
Configure<AppListViewModel, AppListPage>();
|
Configure<AppListViewModel, AppListPage>();
|
||||||
Configure<SettingsViewModel, SettingsPage>();
|
Configure<SettingsViewModel, SettingsPage>();
|
||||||
|
Configure<ConfigurationViewModel, ConfigurationPage>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type GetPageType(string key)
|
public Type GetPageType(string key)
|
||||||
|
|||||||
@@ -1,5 +1,64 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
@@ -108,4 +167,10 @@
|
|||||||
</actions>
|
</actions>
|
||||||
</toast></value>
|
</toast></value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Shell_Configuration.Content" xml:space="preserve">
|
||||||
|
<value>Configuration</value>
|
||||||
|
</data>
|
||||||
|
<data name="AppList_Import.Content" xml:space="preserve">
|
||||||
|
<value>Import</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -170,4 +170,7 @@
|
|||||||
<data name="AppList_Import.Content" xml:space="preserve">
|
<data name="AppList_Import.Content" xml:space="preserve">
|
||||||
<value>导入</value>
|
<value>导入</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Shell_Configuration.Content" xml:space="preserve">
|
||||||
|
<value>配置</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace GZStudio.ViewModels;
|
||||||
|
|
||||||
|
public partial class ConfigurationViewModel : ObservableRecipient
|
||||||
|
{
|
||||||
|
public ConfigurationViewModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<Page
|
||||||
|
x:Class="GZStudio.Views.ConfigurationPage"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid x:Name="ContentArea">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<!-- Row for the Button -->
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<!-- Row for the ListView -->
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Text="Python 配置" Grid.Row="0" Margin="0,0,0,8"/>
|
||||||
|
<ComboBox IsEditable="True" Width="200" Grid.Row="1" Margin="0,0,0,8"/>
|
||||||
|
|
||||||
|
<TextBlock Text="计算机配置" Grid.Row="2" Margin="0,0,0,4"/>
|
||||||
|
|
||||||
|
<ComboBox IsEditable="True" Width="200" Grid.Row="3" Margin="0,0,0,8"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Page>
|
||||||
@@ -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<ConfigurationViewModel>();
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -48,6 +48,11 @@
|
|||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
</NavigationViewItem.Icon>
|
</NavigationViewItem.Icon>
|
||||||
</NavigationViewItem>
|
</NavigationViewItem>
|
||||||
|
<NavigationViewItem x:Uid="Shell_Configuration" helpers:NavigationHelper.NavigateTo="GZStudio.ViewModels.ConfigurationViewModel">
|
||||||
|
<NavigationViewItem.Icon>
|
||||||
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
|
</NavigationViewItem.Icon>
|
||||||
|
</NavigationViewItem>
|
||||||
</NavigationView.MenuItems>
|
</NavigationView.MenuItems>
|
||||||
<NavigationView.HeaderTemplate>
|
<NavigationView.HeaderTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
|
|||||||
Reference in new issue
Block a user