2025-06-23 13:42:02 +08:00
|
|
|
<UserControl x:Class="PMSWPF.Views.SettingView"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
2025-07-06 11:09:57 +08:00
|
|
|
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
|
|
|
|
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
2025-06-23 13:42:02 +08:00
|
|
|
mc:Ignorable="d"
|
2025-07-06 11:09:57 +08:00
|
|
|
d:DesignHeight="450"
|
|
|
|
|
d:DesignWidth="800">
|
|
|
|
|
<StackPanel>
|
2025-07-09 20:48:14 +08:00
|
|
|
<ui:SettingsExpander Header="通用设置"
|
|
|
|
|
Description="通用程序行为设置">
|
|
|
|
|
<ui:SettingsExpander.HeaderIcon>
|
|
|
|
|
<ui:FontIcon Glyph="" />
|
|
|
|
|
</ui:SettingsExpander.HeaderIcon>
|
|
|
|
|
<ui:SettingsExpander.Items>
|
2025-07-12 12:55:46 +08:00
|
|
|
<ui:SettingsCard Header="主题切换"
|
|
|
|
|
Description="切换应用程序的主题">
|
|
|
|
|
<ComboBox Width="120"
|
|
|
|
|
ItemsSource="{Binding Themes}"
|
|
|
|
|
SelectedItem="{Binding SelectedTheme, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
</ui:SettingsCard>
|
2025-07-09 20:48:14 +08:00
|
|
|
<ui:SettingsCard Header="点击关闭按钮时最小化到通知栏"
|
|
|
|
|
Description="开启后,点击主窗口的关闭按钮会将程序最小化到系统通知栏,而不是直接退出。"
|
|
|
|
|
IsClickEnabled="True">
|
|
|
|
|
<ui:ToggleSwitch IsOn="{Binding MinimizeToTrayOnClose, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
</ui:SettingsExpander.Items>
|
|
|
|
|
</ui:SettingsExpander>
|
2025-07-06 11:09:57 +08:00
|
|
|
|
|
|
|
|
<ui:SettingsExpander x:Name="dbSettingCard"
|
|
|
|
|
Header="设置数据库"
|
|
|
|
|
Description="设置要连接的数据库,数据全部在数据库中存放">
|
|
|
|
|
<ui:SettingsExpander.HeaderIcon>
|
|
|
|
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.DataSense}"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Margin="0,0,8,0"
|
|
|
|
|
FontSize="14" />
|
|
|
|
|
</ui:SettingsExpander.HeaderIcon>
|
|
|
|
|
|
|
|
|
|
<Button Content="测试连接"
|
|
|
|
|
Command="{Binding TestConnectionCommand}"
|
|
|
|
|
Style="{StaticResource AccentButtonStyle}"
|
|
|
|
|
Margin="0,10,0,0"
|
|
|
|
|
HorizontalAlignment="Left" />
|
|
|
|
|
|
|
|
|
|
<ui:SettingsExpander.Items>
|
|
|
|
|
<ui:SettingsCard HorizontalAlignment="Left"
|
|
|
|
|
Width="{Binding ElementName=dbSettingCard ,Path=Width}">
|
|
|
|
|
<ikw:SimpleStackPanel Orientation="Horizontal"
|
|
|
|
|
Spacing="10">
|
|
|
|
|
<TextBlock Text="数据库类型:"
|
|
|
|
|
FontSize="14"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Margin="30,0,10,0" />
|
|
|
|
|
<ComboBox Grid.Column="1"
|
|
|
|
|
MinWidth="200"
|
|
|
|
|
ItemsSource="{Binding AvailableDbTypes}"
|
|
|
|
|
SelectedItem="{Binding SelectedDbType}" />
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ui:SettingsCard HorizontalAlignment="Left"
|
|
|
|
|
Width="{Binding ElementName=dbSettingCard ,Path=Width}">
|
|
|
|
|
<ikw:SimpleStackPanel Orientation="Horizontal"
|
|
|
|
|
Spacing="10">
|
|
|
|
|
<TextBlock Text="服务器地址:"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Margin="0,0,10,0" />
|
|
|
|
|
<TextBox Grid.Column="1"
|
|
|
|
|
Text="{Binding Server, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
<ui:SettingsCard HorizontalAlignment="Left"
|
|
|
|
|
Width="{Binding ElementName=dbSettingCard ,Path=Width}">
|
|
|
|
|
<ikw:SimpleStackPanel Orientation="Horizontal"
|
|
|
|
|
Spacing="10">
|
|
|
|
|
<TextBlock Text="服务器端口:"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Margin="0,0,10,0" />
|
|
|
|
|
<TextBox Grid.Column="1"
|
|
|
|
|
Text="{Binding Port, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ui:SettingsCard HorizontalAlignment="Left"
|
|
|
|
|
Width="{Binding ElementName=dbSettingCard ,Path=Width}">
|
|
|
|
|
<ikw:SimpleStackPanel Orientation="Horizontal"
|
|
|
|
|
Spacing="10">
|
|
|
|
|
<TextBlock Text="用户名:"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Margin="0,0,10,0" />
|
|
|
|
|
<TextBox Grid.Column="1"
|
|
|
|
|
Text="{Binding UserId, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
|
|
|
|
|
<ui:SettingsCard HorizontalAlignment="Left"
|
|
|
|
|
Width="{Binding ElementName=dbSettingCard ,Path=Width}">
|
|
|
|
|
<ikw:SimpleStackPanel Orientation="Horizontal"
|
|
|
|
|
Spacing="10">
|
|
|
|
|
<TextBlock Text="密码:"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Margin="0,0,10,0" />
|
|
|
|
|
<TextBox Grid.Column="1"
|
|
|
|
|
Text="{Binding Password, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
|
|
|
|
|
<ui:SettingsCard HorizontalAlignment="Left"
|
|
|
|
|
Width="{Binding ElementName=dbSettingCard ,Path=Width}">
|
|
|
|
|
<ikw:SimpleStackPanel Orientation="Horizontal"
|
|
|
|
|
Spacing="10">
|
|
|
|
|
<TextBlock Text="数据库名称:"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Margin="0,0,10,0" />
|
|
|
|
|
<TextBox Grid.Column="1"
|
|
|
|
|
Text="{Binding Database, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ui:SettingsExpander.Items>
|
|
|
|
|
|
|
|
|
|
</ui:SettingsExpander>
|
|
|
|
|
|
2025-07-09 20:48:14 +08:00
|
|
|
|
|
|
|
|
|
2025-07-06 11:09:57 +08:00
|
|
|
<ui:SettingsExpander Header="SettingsExpander"
|
|
|
|
|
Description="The SettingsExpander has the same properties as a SettingsCard">
|
|
|
|
|
<ui:SettingsExpander.HeaderIcon>
|
|
|
|
|
<ui:FontIcon Glyph="" />
|
|
|
|
|
</ui:SettingsExpander.HeaderIcon>
|
|
|
|
|
|
|
|
|
|
<Button Content="Content"
|
|
|
|
|
Style="{StaticResource AccentButtonStyle}" />
|
|
|
|
|
|
|
|
|
|
<ui:SettingsExpander.Items>
|
|
|
|
|
<ui:SettingsCard Header="A basic SettingsCard within an SettingsExpander">
|
|
|
|
|
<Button Content="Button" />
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
<ui:SettingsCard Description="SettingsCard within an Expander can be made clickable too!"
|
|
|
|
|
Header="This item can be clicked"
|
|
|
|
|
IsClickEnabled="True" />
|
|
|
|
|
<ui:SettingsCard ContentAlignment="Left">
|
|
|
|
|
<CheckBox
|
|
|
|
|
Content="Here the ContentAlignment is set to Left. This is great for e.g. CheckBoxes or RadioButtons" />
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
</ui:SettingsExpander.Items>
|
|
|
|
|
</ui:SettingsExpander>
|
|
|
|
|
|
|
|
|
|
</StackPanel>
|
2025-06-23 17:01:06 +08:00
|
|
|
</UserControl>
|