This commit is contained in:
Hakoyu 2023-10-31 23:58:37 +08:00
parent 18fbc60f87
commit a91d7e2835
5 changed files with 27 additions and 20 deletions

View File

@ -45,16 +45,18 @@ public class MovePageVM
private void Search_ValueChanged(string oldValue, string newValue)
{
//if (string.IsNullOrWhiteSpace(newValue))
//{
// ShowMoves.EnumValue = Moves;
//}
//else
//{
// ShowMoves.EnumValue = new(
// Moves.Where(m => m.Id.EnumValue.Contains(newValue, StringComparison.OrdinalIgnoreCase))
// );
//}
if (string.IsNullOrWhiteSpace(newValue))
{
ShowMoves.Value = Moves;
}
else
{
ShowMoves.Value = new(
Moves.Where(
m => m.Graph.Value.Contains(newValue, StringComparison.OrdinalIgnoreCase)
)
);
}
}
public void Close() { }

View File

@ -32,12 +32,12 @@
ItemsSource="{Binding ShowClickTexts.Value}"
MouseDoubleClick="DataGrid_MouseDoubleClick"
RowDetailsVisibilityMode="Visible"
RowHeight="50"
RowHeight="64"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling">
<DataGrid.RowStyle>
<Style BasedOn="{StaticResource {x:Type DataGridRow}}" TargetType="DataGridRow">
<Setter Property="Height" Value="50" />
<Setter Property="Height" Value="64" />
<Setter Property="Tag" Value="{Binding}" />
<Setter Property="ContextMenu" Value="{StaticResource ContextMenu_DataGridRow}" />
</Style>

View File

@ -151,9 +151,10 @@
IsReadOnly="True"
SortMemberPath="Price.Value" />
<DataGridTextColumn
MaxWidth="300"
Binding="{Binding CurrentI18nData.Value.Description.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
ElementStyle="{DynamicResource TextBlock_Wrap}"
Header="{ll:Str 描述}"
IsReadOnly="True"
SortMemberPath="CurrentI18nData.Value.Description.Value" />

View File

@ -23,9 +23,9 @@
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!--<TextBox pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}" Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}">
<TextBox pu:TextBoxHelper.Watermark="{ll:Str 搜索动画}" Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}">
<TextBox.Style>
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="TextBox">
<Style BasedOn="{StaticResource StandardTextBoxStyle}" TargetType="TextBox">
<Setter Property="IsEnabled" Value="True" />
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedItem, ElementName=ComboBox_Pet}" Value="{x:Null}">
@ -34,14 +34,15 @@
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>-->
</TextBox>
<ComboBox
x:Name="ComboBox_Pet"
Grid.Column="1"
pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}"
DisplayMemberPath="Id.Value"
ItemsSource="{Binding Pets}"
SelectedItem="{Binding CurrentPet.Value}">
SelectedItem="{Binding CurrentPet.Value}"
Style="{DynamicResource StandardComboBoxStyle}">
<ComboBox.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type ComboBoxItem}}" TargetType="ComboBoxItem">
<Setter Property="ToolTip" Value="{Binding CurrentI18nData.Value.Name.Value}" />
@ -69,12 +70,12 @@
ItemsSource="{Binding ShowMoves.Value}"
MouseDoubleClick="DataGrid_MouseDoubleClick"
RowDetailsVisibilityMode="Visible"
RowHeight="64"
RowHeight="50"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling">
<DataGrid.RowStyle>
<Style BasedOn="{StaticResource {x:Type DataGridRow}}" TargetType="DataGridRow">
<Setter Property="Height" Value="64" />
<Setter Property="Height" Value="50" />
<Setter Property="Tag" Value="{Binding}" />
<Setter Property="ContextMenu" Value="{StaticResource ContextMenu_DataGridRow}" />
</Style>

View File

@ -18,7 +18,10 @@
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}" Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" />
<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}"