Files
ShrlAlgoToolkit/Sai.RvKits/RvFamily/FamilyProcessorView.xaml
2024-09-22 11:05:41 +08:00

172 lines
8.6 KiB
XML

<ex:FluentWindowEx
x:Class="Sai.RvKits.RvFamily.FamilyProcessorView"
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:ex="https://github.com/sherlockforrest/Wpf.Ui.Extend"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:Sai.RvKits.RvFamily"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="族复用"
Width="380"
Height="600"
MinWidth="380"
MinHeight="400"
d:DataContext="{d:DesignInstance Type=local:FamilyProcessorViewModel}"
mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary Source="pack://application:,,,/Sai.RvKits;component/WPFUI.xaml" />
</Window.Resources>
<TabControl Margin="5,5,5,5">
<TabItem Header="保存族">
<ex:AutoGrid
ChildMargin="5"
Columns="*,*"
Rows="*,Auto,Auto,Auto">
<DataGrid
x:Name="FamilySaveDg"
Grid.ColumnSpan="2"
d:ItemsSource="{d:SampleData}"
AutoGenerateColumns="False"
CanUserAddRows="False"
IsReadOnly="True"
ItemsSource="{Binding FamilyCollection}"
SelectionMode="Extended">
<!--<ui:DataGrid.RowHeaderTemplate>
<DataTemplate>
<Grid Width="35">
<CheckBox HorizontalAlignment="Center" IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}" />
</Grid>
</DataTemplate>
</ui:DataGrid.RowHeaderTemplate>-->
<DataGrid.Columns>
<DataGridCheckBoxColumn
Width="60"
Binding="{Binding IsSelected, Mode=OneWayToSource, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}"
ElementStyle="{StaticResource DataGridCheckBoxElementDefaultStyle}"
Header="选择" />
<DataGridTextColumn Binding="{Binding FamilyCategory.Name}" Header="族类别" />
<DataGridTextColumn Binding="{Binding Name}" Header="族名称" />
</DataGrid.Columns>
</DataGrid>
<GroupBox
Grid.Row="1"
Grid.Column="1"
Header="保存选项">
<StackPanel>
<RadioButton Content="覆盖存在文件" IsChecked="{Binding IsOverride, UpdateSourceTrigger=PropertyChanged}" />
<RadioButton Content="忽略存在文件" />
</StackPanel>
</GroupBox>
<StackPanel
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center">
<CheckBox Content="添加族类别文件夹" IsChecked="{Binding CreateCategoryFolder}" />
<CheckBox Content="文件名添加族类别" IsChecked="{Binding AddCategoryPrefix}" />
<CheckBox Content="以三维为默认视图" IsChecked="{Binding View3dAsDefault}" />
</StackPanel>
<ui:TextBox
PlaceholderText="保存路径"
Text="{Binding PathToSaveFamily}"
TextOptions.TextFormattingMode="Display" />
<ui:Button
HorizontalAlignment="Stretch"
Command="{Binding SelectDirectoryCommand}"
Content="路径选择"
Cursor="Hand"
Icon="{ui:FontIcon '&#xEADF;',
FontFamily={StaticResource BoxIcons}}" />
<ComboBox
DisplayMemberPath="Title"
ItemsSource="{Binding SourceDocsList}"
SelectedItem="{Binding SourceDoc, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Text="源文档">
<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding GetFamiliesCommand}" CommandParameter="{Binding}" />
</i:EventTrigger>
</i:Interaction.Triggers>-->
</ComboBox>
<ui:Button
HorizontalAlignment="Stretch"
Command="{Binding SaveFamiliesCommand}"
CommandParameter="{Binding SelectedItems, ElementName=FamilySaveDg}"
Content="导出保存"
Icon="{ui:FontIcon Glyph=&#xEACE;,
FontFamily={StaticResource BoxIcons}}" />
</ex:AutoGrid>
</TabItem>
<TabItem Header="传递族">
<ex:AutoGrid
ChildMargin="5"
Columns="*,Auto"
Rows="*,Auto,Auto">
<DataGrid
x:Name="familyTransmitDg"
Grid.ColumnSpan="2"
d:ItemsSource="{d:SampleData}"
AutoGenerateColumns="False"
CanUserAddRows="False"
IsReadOnly="True"
ItemsSource="{Binding FamilyCollection}"
SelectionMode="Extended">
<!--<ui:DataGrid.RowHeaderTemplate>
<DataTemplate>
<Grid Width="35">
<CheckBox HorizontalAlignment="Center" IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}" />
</Grid>
</DataTemplate>
</ui:DataGrid.RowHeaderTemplate>-->
<DataGrid.Columns>
<DataGridCheckBoxColumn
Width="60"
Binding="{Binding IsSelected, Mode=OneWayToSource, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}"
ElementStyle="{StaticResource DataGridCheckBoxElementDefaultStyle}"
Header="选择" />
<DataGridTextColumn Binding="{Binding FamilyCategory.Name}" Header="族类别" />
<DataGridTextColumn Binding="{Binding Name}" Header="族名称" />
</DataGrid.Columns>
</DataGrid>
<ComboBox
Grid.Row="1"
Grid.Column="0"
DisplayMemberPath="Title"
ItemsSource="{Binding SourceDocsList, Mode=TwoWay}"
SelectedItem="{Binding SourceDoc, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Text="源文档">
<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding GetTargetDocListCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>-->
</ComboBox>
<Button
Grid.Row="1"
Grid.Column="1"
Command="{Binding TransmitFamilyCommand}"
CommandParameter="{Binding SelectedItems, ElementName=familyTransmitDg}"
Content="&#xEA84;"
FontFamily="{StaticResource BoxIcons}"
ToolTip="传递" />
<ComboBox
Grid.Row="2"
Grid.Column="0"
DisplayMemberPath="Title"
ItemsSource="{Binding TargetDocsList, Mode=TwoWay}"
SelectedItem="{Binding TargetDoc, UpdateSourceTrigger=PropertyChanged}"
Text="目标文档" />
<Button
Grid.Row="2"
Grid.Column="1"
Command="{Binding CancelCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}, Mode=FindAncestor}}"
Content="&#xEC84;"
FontFamily="{StaticResource BoxIcons}"
ToolTip="关闭" />
</ex:AutoGrid>
</TabItem>
</TabControl>
</ex:FluentWindowEx>