VPet.ModMaker/VPet.Plugin.ModMaker/Views/ModEdit/LowTextEdit/LowTextPage.xaml
2023-08-21 23:30:55 +08:00

116 lines
4.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<Page
x:Class="VPet.Plugin.ModMaker.Views.ModEdit.LowTextEdit.LowTextPage"
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:local="clr-namespace:VPet.Plugin.ModMaker.Views.ModEdit.LowTextEdit"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui"
xmlns:vm="clr-namespace:VPet.Plugin.ModMaker.ViewModels.ModEdit.LowTextEdit"
Title="Page_LowText"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<d:Page.DataContext>
<vm:LowTextPageVM />
</d:Page.DataContext>
<Page.Resources>
<ResourceDictionary>
<ContextMenu x:Key="ContextMenu_DataGridRow" x:Shared="false">
<MenuItem
Command="{Binding DataContext.EditLowTextCommand, RelativeSource={RelativeSource AncestorType=Page, Mode=FindAncestor}}"
CommandParameter="{Binding DataContext, RelativeSource={RelativeSource AncestorType=DataGridRow, Mode=FindAncestor}}"
Header="修改低状态文本" />
<MenuItem
Command="{Binding DataContext.RemoveLowTextCommand, RelativeSource={RelativeSource AncestorType=Page, Mode=FindAncestor}}"
CommandParameter="{Binding DataContext, RelativeSource={RelativeSource AncestorType=DataGridRow, Mode=FindAncestor}}"
Header="删除低状态文本" />
</ContextMenu>
</ResourceDictionary>
</Page.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox pu:TextBoxHelper.Watermark="搜索文本" Text="{Binding FilterLowText.Value, UpdateSourceTrigger=PropertyChanged}" />
<DataGrid
x:Name="DataGrid_LowText"
Grid.Row="1"
d:ItemsSource="{d:SampleData ItemCount=5}"
pu:DataGridHelper.ColumnHeaderHorizontalContentAlignment="Center"
AutoGenerateColumns="False"
CanUserAddRows="False"
GridLinesVisibility="Horizontal"
ItemsSource="{Binding ShowLowTexts.Value}"
MouseDoubleClick="DataGrid_LowText_MouseDoubleClick"
RowDetailsVisibilityMode="Visible"
RowHeight="64"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling">
<DataGrid.RowStyle>
<Style BasedOn="{StaticResource {x:Type DataGridRow}}" TargetType="DataGridRow">
<Setter Property="Height" Value="64" />
<Setter Property="Tag" Value="{Binding}" />
<Setter Property="ContextMenu" Value="{StaticResource ContextMenu_DataGridRow}" />
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn
Binding="{Binding Id.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Id">
<DataGridTextColumn.Header>
<Label Content="Id" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding CurrentI18nData.Value.Text.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Name">
<DataGridTextColumn.Header>
<Label Content="文本" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Mode.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Mode">
<DataGridTextColumn.Header>
<Label Content="状态" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Strength.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="StrengthFood">
<DataGridTextColumn.Header>
<Label Content="口渴/饥饿需求" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Like.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Like">
<DataGridTextColumn.Header>
<Label Content="好感需求" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<Button
x:Name="Button_AddLowText"
Grid.Row="1"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Command="{Binding AddLowTextCommand}"
Content=""
Style="{StaticResource AddButton}" />
</Grid>
</Page>