<Page
  x:Class="VPet.ModMaker.Views.ModEdit.ClickTextEdit.ClickTextPage"
  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.ModMaker.Views.ModEdit.ClickTextEdit"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:pu="https://opensource.panuon.com/wpf-ui"
  xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.ClickTextEdit"
  Title="ClickTextPage"
  d:DataContext="{d:DesignInstance Type=vm:ClickTextPageVM}"
  d:DesignHeight="450"
  d:DesignWidth="800"
  mc:Ignorable="d">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition />
    </Grid.RowDefinitions>
    <TextBox
      pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}"
      Style="{DynamicResource StandardTextBoxStyle}"
      Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" />
    <DataGrid
      Grid.Row="1"
      d:ItemsSource="{d:SampleData ItemCount=5}"
      pu:DataGridHelper.ColumnHeaderHorizontalContentAlignment="Center"
      AutoGenerateColumns="False"
      CanUserAddRows="False"
      GridLinesVisibility="Horizontal"
      ItemsSource="{Binding ShowClickTexts.Value}"
      MouseDoubleClick="DataGrid_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
          MaxWidth="200"
          Binding="{Binding Id.Value}"
          CanUserSort="True"
          ElementStyle="{StaticResource TextBlock_Wrap}"
          Header="Id"
          IsReadOnly="True"
          SortMemberPath="Id.Value" />
        <DataGridTextColumn
          MaxWidth="300"
          Binding="{Binding CurrentI18nData.Value.Text.Value}"
          CanUserSort="True"
          ElementStyle="{StaticResource TextBlock_Wrap}"
          Header="{ll:Str 文本}"
          IsReadOnly="True"
          SortMemberPath="CurrentI18nData.Value.Text.Value" />
        <DataGridTextColumn
          Binding="{Binding Mode.EnumValue.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 状态}"
          IsReadOnly="True"
          SortMemberPath="Mode.EnumValue.Value" />
        <DataGridTextColumn
          Binding="{Binding Working.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 指定工作}"
          IsReadOnly="True"
          SortMemberPath="Working.Value" />
        <DataGridTextColumn
          Binding="{Binding WorkingState.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 工作状态}"
          IsReadOnly="True"
          SortMemberPath="WorkingState.Value" />
        <DataGridTextColumn
          Binding="{Binding DayTime.EnumValue.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 时间}"
          IsReadOnly="True"
          SortMemberPath="DayTime.EnumValue.Value" />
        <DataGridTextColumn
          Binding="{Binding Like.Info.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 好感度范围}"
          IsReadOnly="True"
          SortMemberPath="Like.Info.Value" />
        <DataGridTextColumn
          Binding="{Binding Health.Info.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 健康度范围}"
          IsReadOnly="True"
          SortMemberPath="Health.Info.Value" />
        <DataGridTextColumn
          Binding="{Binding Level.Info.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 等级范围}"
          IsReadOnly="True"
          SortMemberPath="Level.Info.Value" />
        <DataGridTextColumn
          Binding="{Binding Money.Info.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 金钱范围}"
          IsReadOnly="True"
          SortMemberPath="Money.Info.Value" />
        <DataGridTextColumn
          Binding="{Binding Food.Info.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 食物范围}"
          IsReadOnly="True"
          SortMemberPath="Food.Info.Value" />
        <DataGridTextColumn
          Binding="{Binding Drink.Info.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 口渴范围}"
          IsReadOnly="True"
          SortMemberPath="Drink.Info.Value" />
        <DataGridTextColumn
          Binding="{Binding Feel.Info.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 心情范围}"
          IsReadOnly="True"
          SortMemberPath="Feel.Info.Value" />
        <DataGridTextColumn
          Binding="{Binding Strength.Info.Value}"
          CanUserSort="True"
          ElementStyle="{DynamicResource TextBlock_LeftCenter}"
          Header="{ll:Str 体力范围}"
          IsReadOnly="True"
          SortMemberPath="Strength.Info.Value" />
      </DataGrid.Columns>
    </DataGrid>
    <Button
      Grid.Row="1"
      HorizontalAlignment="Right"
      VerticalAlignment="Bottom"
      Command="{Binding AddCommand}"
      Content="➕"
      Style="{StaticResource AddButton}" />
  </Grid>
</Page>
