整理代码
This commit is contained in:
172
ShrlAlgoToolkit.RevitAddins/RvFamily/FamilyProcessorView.xaml
Normal file
172
ShrlAlgoToolkit.RevitAddins/RvFamily/FamilyProcessorView.xaml
Normal file
@@ -0,0 +1,172 @@
|
||||
<ui:FluentWindowEx
|
||||
x:Class="ShrlAlgo.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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:ShrlAlgo.RvKits.RvFamily"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
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:,,,/ShrlAlgoToolkit.RevitAddins;component/WPFUI.xaml" />
|
||||
</Window.Resources>
|
||||
<TabControl Margin="5,5,5,5">
|
||||
<TabItem Header="保存族">
|
||||
<ui: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 '',
|
||||
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=,
|
||||
FontFamily={StaticResource BoxIcons}}" />
|
||||
</ui:AutoGrid>
|
||||
</TabItem>
|
||||
<TabItem Header="传递族">
|
||||
<ui: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=""
|
||||
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=""
|
||||
FontFamily="{StaticResource BoxIcons}"
|
||||
ToolTip="关闭" />
|
||||
</ui:AutoGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</ui:FluentWindowEx>
|
||||
Reference in New Issue
Block a user