VPet/VPet.Solution/Views/SettingEditor/ModSettingPage.xaml

234 lines
8.9 KiB
XML

<Page
x:Class="VPet.Solution.Views.SettingEditor.ModSettingPage"
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:h="clr-namespace:HKW.WPF.Helpers"
xmlns:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:local="clr-namespace:VPet.Solution.Views.SettingEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui"
xmlns:vm="clr-namespace:VPet.Solution.ViewModels.SettingEditor"
Title="ModSettingsPage"
d:DataContext="{d:DesignInstance Type=vm:ModSettingPageVM}"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="120" />
<ColumnDefinition Width="10" />
<ColumnDefinition MinWidth="200" />
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBox
pu:TextBoxHelper.Watermark="{ll:Str 搜索模组}"
Style="{DynamicResource StandardTextBoxStyle}"
Text="{Binding SearchMod, UpdateSourceTrigger=PropertyChanged}" />
<DataGrid
x:Name="DataGrid_Mods"
Grid.Row="1"
AutoGenerateColumns="False"
CanUserAddRows="False"
ItemsSource="{Binding ShowMods}"
SelectedItem="{Binding CurrentModMoel}">
<DataGrid.Columns>
<DataGridTextColumn
Binding="{Binding Name}"
ElementStyle="{DynamicResource TextBlock_BaseStyle}"
Header="{ll:Str 名称}"
IsReadOnly="True" />
<DataGridTextColumn
Binding="{Binding State}"
ElementStyle="{DynamicResource TextBlock_BaseStyle}"
Header="{ll:Str 状态}"
IsReadOnly="True" />
</DataGrid.Columns>
</DataGrid>
<Button
Grid.Row="2"
Margin="0"
HorizontalAlignment="Stretch"
Command="{Binding ClearFailModsCommand}"
Content="{ll:Str 清除失效模组}"
Style="{DynamicResource Button_BaseStyle}" />
<Button
Grid.Row="3"
Margin="0"
HorizontalAlignment="Stretch"
Command="{Binding ClearModsCommand}"
Content="{ll:Str 清除全部模组}"
Style="{DynamicResource Button_BaseStyle}" />
</Grid>
<Grid
Grid.Column="2"
d:DataContext="{Binding ModSetting.Mods[0]}"
DataContext="{Binding SelectedItem, ElementName=DataGrid_Mods}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image
Width="150"
Height="150"
Source="{Binding Image}"
Stretch="Fill" />
<ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Auto">
<StackPanel>
<StackPanel Orientation="Horizontal">
<Label
Margin="10,0,10,0"
h:ElementHelper.UniformMinWidthGroup="A"
Content="{ll:Str '模组名称:'}"
Style="{DynamicResource Label_BaseStyle}" />
<TextBlock Style="{DynamicResource TextBlock_LeftCenter}" Text="{Binding Name}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label
Margin="10,0,10,0"
h:ElementHelper.UniformMinWidthGroup="A"
Content="{ll:Str '作者:'}"
Style="{DynamicResource Label_BaseStyle}" />
<TextBlock Style="{DynamicResource TextBlock_LeftCenter}" Text="{Binding Author}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label
Margin="10,0,10,0"
h:ElementHelper.UniformMinWidthGroup="A"
Content="{ll:Str '模组版本:'}"
Style="{DynamicResource Label_BaseStyle}" />
<TextBlock Style="{DynamicResource TextBlock_LeftCenter}" Text="{Binding ModVersion}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label
Margin="10,0,10,0"
h:ElementHelper.UniformMinWidthGroup="A"
Content="{ll:Str '游戏版本:'}"
Style="{DynamicResource Label_BaseStyle}" />
<TextBlock Style="{DynamicResource TextBlock_LeftCenter}" Text="{Binding GameVersion}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label
Margin="10,0,10,0"
h:ElementHelper.UniformMinWidthGroup="A"
Content="{ll:Str '模组路径:'}"
Style="{DynamicResource Label_BaseStyle}" />
<TextBlock Style="{DynamicResource TextBlock_LeftCenter}" Text="{Binding ModPath}" />
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Label
HorizontalAlignment="Left"
Content="{ll:Str MOD介绍}"
FontSize="18"
FontWeight="Bold"
Style="{DynamicResource Label_BaseStyle}" />
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<TextBlock
x:Name="GameInfo"
FontSize="14"
Style="{DynamicResource TextBlock_Wrap}"
Text="{Binding Description}" />
</ScrollViewer>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Label
HorizontalAlignment="Left"
Content="{ll:Str 内容}"
FontSize="18"
FontWeight="Bold"
Style="{DynamicResource Label_BaseStyle}" />
<ItemsControl Grid.Row="1" ItemsSource="{Binding Tags}" />
</Grid>
<Grid
Grid.Column="1"
h:ElementHelper.IsEnabled="{Binding IsEnabled, Converter={StaticResource NullToFalse}}"
IsEnabled="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Label
HorizontalAlignment="Left"
Content="{ll:Str 操作}"
FontSize="18"
FontWeight="Bold"
Style="{DynamicResource Label_BaseStyle}" />
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel>
<pu:Switch
Content="{ll:Str 启用模组}"
IsChecked="{Binding IsEnabled}"
Style="{DynamicResource Switch_BaseStyle}" />
<pu:Switch
Content="{ll:Str 启用模组代码}"
IsChecked="{Binding IsPass}"
IsEnabled="{Binding IsMsg}"
Style="{DynamicResource Switch_BaseStyle}" />
</StackPanel>
<StackPanel Grid.Column="1">
<Button
HorizontalAlignment="Left"
Command="{Binding DataContext.OpenModPathCommand, RelativeSource={RelativeSource AncestorType=Page}}"
CommandParameter="{Binding}"
Content="{ll:Str '打开所在文件夹'}"
Style="{DynamicResource Button_BaseStyle}" />
<!--<TextBlock
x:Name="ButtonPublish"
Margin="0,2,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
d:MouseDown="ButtonPublish_MouseDown"
Cursor="Hand"
FontSize="14"
Foreground="DimGray"
Text="{ll:Str 更新至Steam}"
TextDecorations="Underline"
TextWrapping="Wrap" />-->
<Button
x:Name="ButtonSteam"
HorizontalAlignment="Left"
Command="{Binding DataContext.OpenSteamCommunityCommand, RelativeSource={RelativeSource AncestorType=Page}}"
CommandParameter="{Binding}"
Content="{ll:Str 打开创意工坊页面}"
Style="{DynamicResource Button_BaseStyle}" />
</StackPanel>
</Grid>
</Grid>
</Grid>
</Grid>
</Grid>
</Page>