mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
72197f0195
## 新增 - 设置编辑页面的保存按钮高亮提示 ## 修复 - 设置编辑的模组信息载入问题
222 lines
9.4 KiB
XML
222 lines
9.4 KiB
XML
<pu:WindowX
|
|
x:Class="VPet.Solution.Views.SettingEditor.SettingWindow"
|
|
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:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
|
|
xmlns:local="clr-namespace:VPet.Solution"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:vm="clr-namespace:VPet.Solution.ViewModels.SettingEditor"
|
|
Title="{ll:Str 'VPET 设置编辑器'}"
|
|
Width="800"
|
|
Height="450"
|
|
MinWidth="400"
|
|
MinHeight="200"
|
|
d:DataContext="{d:DesignInstance Type=vm:SettingWindowVM}"
|
|
Closing="SettingWindow_Closing"
|
|
WindowStartupLocation="CenterScreen"
|
|
mc:Ignorable="d">
|
|
<Window.Resources>
|
|
<Style
|
|
x:Key="RemindStyle"
|
|
BasedOn="{StaticResource Button_BaseStyle}"
|
|
TargetType="Button">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Mode=Self}}" Value="True">
|
|
<DataTrigger.EnterActions>
|
|
<BeginStoryboard x:Name="RemindSaveStoryboard">
|
|
<Storyboard RepeatBehavior="Forever">
|
|
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="Background.Color">
|
|
<DiscreteColorKeyFrame KeyTime="0:0:1" Value="Aqua" />
|
|
<DiscreteColorKeyFrame KeyTime="0:0:1.5" Value="#00FFFFFF" />
|
|
</ColorAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</DataTrigger.EnterActions>
|
|
<DataTrigger.ExitActions>
|
|
<RemoveStoryboard BeginStoryboardName="RemindSaveStoryboard" />
|
|
</DataTrigger.ExitActions>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Window.Resources>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" MinWidth="100" />
|
|
<ColumnDefinition MinWidth="300" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<TextBox
|
|
pu:TextBoxHelper.Watermark="{ll:Str 搜索设置}"
|
|
Style="{DynamicResource StandardTextBoxStyle}"
|
|
Text="{Binding SearchSetting, UpdateSourceTrigger=PropertyChanged}" />
|
|
<ListBox
|
|
x:Name="ListBox_Saves"
|
|
Grid.Row="1"
|
|
d:ItemsSource="{d:SampleData ItemCount=5}"
|
|
ItemsSource="{Binding ShowSettings}"
|
|
SelectedItem="{Binding CurrentSetting}"
|
|
Style="{DynamicResource SideMenuListBoxStyle}">
|
|
<ListBox.ItemContainerStyle>
|
|
<Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="ListBoxItem">
|
|
<Setter Property="Tag" Value="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window}}" />
|
|
<Setter Property="Content" Value="{Binding Name}" />
|
|
<Setter Property="ToolTip" Value="{Binding FilePath}" />
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
</ListBox>
|
|
<StackPanel Grid.Row="2">
|
|
<Button
|
|
Margin="0"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding ResetAllSettingCommand}"
|
|
Content="{ll:Str 全部重置}"
|
|
Style="{DynamicResource Button_BaseStyle}" />
|
|
<Button
|
|
Margin="0"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding SaveAllSettingCommand}"
|
|
Content="{ll:Str 全部保存}"
|
|
Style="{DynamicResource Button_BaseStyle}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
<Grid Grid.Column="1" IsEnabled="{Binding SelectedItem, ElementName=ListBox_Saves, Converter={StaticResource NullToFalse}}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<ListBox x:Name="ListBox_Pages" Style="{DynamicResource SideMenuListBoxStyle}">
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
<ListBoxItem x:Name="ListBoxItem_GraphicsSettings" Content="{ll:Str 图形}" />
|
|
<ListBoxItem x:Name="ListBoxItem_SystemSettings" Content="{ll:Str 系统}" />
|
|
<ListBoxItem x:Name="ListBoxItem_InteractiveSettings" Content="{ll:Str 互动}" />
|
|
<ListBoxItem x:Name="ListBoxItem_CustomizedSettings" Content="{ll:Str 自定}" />
|
|
<ListBoxItem x:Name="ListBoxItem_DiagnosticSettings" Content="{ll:Str 诊断}" />
|
|
<ListBoxItem x:Name="ListBoxItem_ModSettings" Content="{ll:Str Mod管理}" />
|
|
</ListBox>
|
|
<Frame
|
|
x:Name="Frame_Main"
|
|
Grid.Row="1"
|
|
Content="{Binding SelectedItem.Tag, ElementName=ListBox_Pages}"
|
|
ContentRendered="Frame_Main_ContentRendered"
|
|
NavigationUIVisibility="Hidden" />
|
|
</Grid>
|
|
<StackPanel Grid.Column="1" MinWidth="100">
|
|
<Button
|
|
Margin="0"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding OpenFileCommand}"
|
|
CommandParameter="{Binding SelectedItem, ElementName=ListBox_Saves}"
|
|
Content="{ll:Str 打开文件}"
|
|
Style="{StaticResource Button_BaseStyle}" />
|
|
<Button
|
|
Grid.Column="1"
|
|
Margin="0"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding OpenFileInExplorerCommand}"
|
|
CommandParameter="{Binding SelectedItem, ElementName=ListBox_Saves}"
|
|
Content="{ll:Str 从资源管理器打开文件}"
|
|
Style="{StaticResource Button_BaseStyle}" />
|
|
<Button
|
|
Grid.Column="2"
|
|
Margin="0"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding SaveSettingCommand}"
|
|
CommandParameter="{Binding SelectedItem, ElementName=ListBox_Saves}"
|
|
Content="{ll:Str 保存}"
|
|
Style="{StaticResource RemindStyle}"
|
|
Tag="{Binding CurrentSetting.IsChanged}" />
|
|
<Button
|
|
Grid.Column="3"
|
|
Margin="0"
|
|
HorizontalAlignment="Stretch"
|
|
Command="{Binding ResetSettingCommand}"
|
|
CommandParameter="{Binding SelectedItem, ElementName=ListBox_Saves}"
|
|
Content="{ll:Str 重置}"
|
|
Style="{StaticResource Button_BaseStyle}" />
|
|
</StackPanel>
|
|
<!--<TabControl
|
|
x:Name="MainTab"
|
|
Grid.Column="1"
|
|
Margin="5"
|
|
d:SelectionChanged="MainTab_SelectionChanged"
|
|
pu:TabControlHelper.CanHeaderPanelScroll="True"
|
|
pu:TabControlHelper.ItemsCornerRadius="4"
|
|
pu:TabControlHelper.ItemsHeight="NaN"
|
|
pu:TabControlHelper.ItemsHoverBackground="{DynamicResource PrimaryLight}"
|
|
pu:TabControlHelper.ItemsPadding="10,7"
|
|
pu:TabControlHelper.ItemsSelectedBackground="{DynamicResource PrimaryDark}"
|
|
pu:TabControlHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
Foreground="{DynamicResource PrimaryText}">
|
|
<TabControl.ContentTemplate>
|
|
<DataTemplate>
|
|
<Border
|
|
Margin="0,5,0,10"
|
|
Background="{DynamicResource DARKPrimaryText}"
|
|
CornerRadius="15">
|
|
<ContentControl Margin="10,5" Content="{Binding}" />
|
|
</Border>
|
|
</DataTemplate>
|
|
</TabControl.ContentTemplate>
|
|
<TabItem
|
|
BorderBrush="{DynamicResource PrimaryDarker}"
|
|
Foreground="{DynamicResource PrimaryText}"
|
|
Header="" />
|
|
<TabItem BorderBrush="{DynamicResource PrimaryDarker}" Header="{ll:Str 系统}" />
|
|
<TabItem BorderBrush="{DynamicResource PrimaryDarker}" Header="{ll:Str 互动}" />
|
|
<TabItem BorderBrush="{DynamicResource PrimaryDarker}" Header="{ll:Str 自定}" />
|
|
<TabItem BorderBrush="{DynamicResource PrimaryDarker}" Header="{ll:Str 诊断}" />
|
|
<TabItem BorderBrush="{DynamicResource PrimaryDarker}" Header="{ll:Str MOD管理}" />
|
|
</TabControl>
|
|
<Label
|
|
x:Name="GameVerison"
|
|
Grid.ColumnSpan="2"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Bottom"
|
|
Background="{x:Null}"
|
|
Content="版本v1.0 (655366666)"
|
|
FontSize="10"
|
|
Foreground="Green" />-->
|
|
</Grid>
|
|
<!--<Grid Grid.Column="1">
|
|
<TextBox
|
|
x:Name="tb_seach_menu"
|
|
Margin="3,6,6,0"
|
|
VerticalAlignment="Top"
|
|
d:TextChanged="tb_seach_menu_textchange"
|
|
pu:TextBoxHelper.Watermark="{ll:Str 搜索设置}"
|
|
FontSize="16"
|
|
Style="{DynamicResource StandardTextBoxStyle}" />
|
|
<ListBox
|
|
x:Name="ListMenu"
|
|
Margin="3,40,6,3"
|
|
pu:ListBoxHelper.CornerRadius="5"
|
|
pu:ListBoxHelper.ItemsHoverBackground="{DynamicResource Primary}"
|
|
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource SecondaryLight}"
|
|
Background="{DynamicResource SecondaryLighter}"
|
|
BorderBrush="{DynamicResource Primary}"
|
|
BorderThickness="2"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
|
</Grid>-->
|
|
</Grid>
|
|
</pu:WindowX>
|