添加项目文件。
This commit is contained in:
269
Sai.RvKits/RvFamily/RenameFamilyView.xaml
Normal file
269
Sai.RvKits/RvFamily/RenameFamilyView.xaml
Normal file
@@ -0,0 +1,269 @@
|
||||
<ex:FluentWindowEx
|
||||
x:Class="Sai.RvKits.RvFamily.RenameFamilyView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:ex="https://github.com/sherlockforrest/Wpf.Ui.Extend"
|
||||
xmlns:local="clr-namespace:Sai.RvKits.RvFamily"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:props="clr-namespace:Sai.Toolkit.Mvvm.AttachedProps"
|
||||
xmlns:rules="clr-namespace:Sai.Toolkit.Mvvm.ValidationRules"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
Title="重命名族"
|
||||
Width="900"
|
||||
Height="600"
|
||||
d:DataContext="{d:DesignInstance local:RenameFamilyViewModel}"
|
||||
mc:Ignorable="d">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary Source="pack://application:,,,/Sai.RvKits;component/WPFUI.xaml" />
|
||||
</Window.Resources>
|
||||
<ex:AutoGrid
|
||||
ChildMargin="5"
|
||||
Columns="250,*,*,*"
|
||||
Rows="*,Auto">
|
||||
<ex:AutoGrid
|
||||
Grid.RowSpan="2"
|
||||
Columns="*"
|
||||
Rows="*,Auto,Auto">
|
||||
<GroupBox Header="族类别">
|
||||
<ListBox
|
||||
x:Name="LbCategories"
|
||||
Height="400"
|
||||
d:ItemsSource="{d:SampleData ItemCount=5}"
|
||||
DisplayMemberPath="Key"
|
||||
ItemsSource="{Binding Collection, Mode=OneWay}"
|
||||
SelectionMode="Multiple">
|
||||
<!--<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>-->
|
||||
<!--<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>-->
|
||||
<!--<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border CornerRadius="5" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>-->
|
||||
<!--<ListBox.ItemContainerStyle>
|
||||
<Style />
|
||||
</ListBox.ItemContainerStyle>-->
|
||||
<b:Interaction.Triggers>
|
||||
<b:EventTrigger EventName="SelectionChanged">
|
||||
<b:InvokeCommandAction Command="{Binding GetRenameItemsCommand}" CommandParameter="{Binding SelectedItems, RelativeSource={RelativeSource AncestorType={x:Type ListBox}, Mode=FindAncestor}}" />
|
||||
</b:EventTrigger>
|
||||
</b:Interaction.Triggers>
|
||||
<!--<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding Value}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>-->
|
||||
</ListBox>
|
||||
</GroupBox>
|
||||
<DockPanel>
|
||||
<CheckBox Content="全选">
|
||||
<b:Interaction.Triggers>
|
||||
<b:EventTrigger EventName="Checked">
|
||||
<b:CallMethodAction MethodName="SelectAll" TargetObject="{Binding ElementName=LbCategories}" />
|
||||
</b:EventTrigger>
|
||||
<b:EventTrigger EventName="Unchecked">
|
||||
<b:CallMethodAction MethodName="UnselectAll" TargetObject="{Binding ElementName=LbCategories}" />
|
||||
</b:EventTrigger>
|
||||
</b:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding CategoryCount, StringFormat=类别数:{}{0:D}}" />
|
||||
</DockPanel>
|
||||
<ex:TextBoxEx PlaceholderText="过滤族类别" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</ex:AutoGrid>
|
||||
<DataGrid
|
||||
x:Name="DgRename"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="3"
|
||||
props:TextSearch.SearchValue="{Binding Text, ElementName=TbFound, UpdateSourceTrigger=PropertyChanged}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
HeadersVisibility="Column"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
ItemsSource="{Binding RenameItems}"
|
||||
SelectionUnit="Cell">
|
||||
<DataGrid.Resources>
|
||||
<Style BasedOn="{StaticResource DefaultDataGridCellStyle}" TargetType="{x:Type DataGridCell}">
|
||||
<!--<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />-->
|
||||
<Setter Property="props:TextSearch.IsTextMatch">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource SearchFamilyValueConverter}">
|
||||
<Binding Path="Content.Text" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="(props:TextSearch.SearchValue)" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding RelativeSource="{RelativeSource Mode=Self}" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="props:TextSearch.IsTextMatch" Value="True">
|
||||
<Setter Property="Foreground" Value="SkyBlue" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style BasedOn="{StaticResource DefaultDataGridColumnHeaderStyle}" TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn
|
||||
MinWidth="80"
|
||||
Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditingElementStyle="{StaticResource DataGridCheckBoxEditingElementDefaultStyle}"
|
||||
ElementStyle="{StaticResource DataGridCheckBoxElementDefaultStyle}">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<Border Background="Transparent">
|
||||
<CheckBox
|
||||
HorizontalAlignment="Center"
|
||||
Content="全选"
|
||||
IsChecked="{Binding DataContext.IsAllItemsSelected, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" />
|
||||
</Border>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
<!--<DataGridCheckBoxColumn.HeaderStyle>
|
||||
<Style BasedOn="{StaticResource DefaultDataGridColumnHeaderStyle}" TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
</DataGridCheckBoxColumn.HeaderStyle>-->
|
||||
</DataGridCheckBoxColumn>
|
||||
<DataGridTextColumn
|
||||
MinWidth="80"
|
||||
Binding="{Binding CategoryName}"
|
||||
Header="族类别"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
MinWidth="80"
|
||||
Binding="{Binding OldFamilyName}"
|
||||
Header="族名称"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
MinWidth="80"
|
||||
Binding="{Binding NewFamilyName, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditingElementStyle="{StaticResource DefaultTextBoxStyle}"
|
||||
Header="新族名称">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<GroupBox Header="前/后缀">
|
||||
<UniformGrid Columns="1">
|
||||
<ui:TextBox
|
||||
x:Name="CbPrefix"
|
||||
Margin="5"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
PlaceholderText="前缀">
|
||||
<Binding Path="PrefixText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<rules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</ui:TextBox>
|
||||
<!--<TextBox
|
||||
x:Name="TbPrefix"
|
||||
materialDesign:HintAssist.Hint="前缀"
|
||||
IsEnabled="{Binding CanInput}">
|
||||
<TextBox.Text>
|
||||
<Binding Path="PrefixText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validationRules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>-->
|
||||
<ui:TextBox
|
||||
x:Name="TbSuffix"
|
||||
Margin="5"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
PlaceholderText="后缀">
|
||||
<Binding Path="SuffixText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<rules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</ui:TextBox>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="查找/替换">
|
||||
<StackPanel>
|
||||
<ui:TextBox
|
||||
x:Name="TbFound"
|
||||
Margin="5"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
PlaceholderText="查找">
|
||||
<Binding Path="FoundText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<rules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</ui:TextBox>
|
||||
<ui:TextBox
|
||||
x:Name="TbReplace"
|
||||
Margin="5"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
PlaceholderText="替换">
|
||||
<Binding Path="ReplaceText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<rules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</ui:TextBox>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Grid.Row="0" Header="连接符">
|
||||
<TextBox x:Name="TbSeparator" IsEnabled="{Binding CanInput}">
|
||||
<Binding Path="Separator" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<rules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox>
|
||||
</GroupBox>
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding ModifyNameCommand}"
|
||||
Content="修改名称"
|
||||
ToolTip="勾选要修改的项进行修改" />
|
||||
</Grid>
|
||||
</ex:AutoGrid>
|
||||
</ex:FluentWindowEx>
|
||||
Reference in New Issue
Block a user