Files
ShrlAlgoToolkit/ShrlAlgoToolkit.RevitAddins/FamMaster/FamilyProcessorView.xaml

174 lines
8.8 KiB
Plaintext
Raw Normal View History

2026-01-02 17:30:41 +08:00
<ui:MelWindow
2026-02-22 20:03:42 +08:00
x:Class="ShrlAlgoToolkit.RevitAddins.FamMaster.FamilyProcessorView"
2024-09-22 11:05:41 +08:00
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2025-12-23 21:35:54 +08:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2024-09-22 11:05:41 +08:00
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:drawing="clr-namespace:System.Drawing;assembly=System.Drawing"
2024-09-22 11:05:41 +08:00
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
2025-04-24 20:56:44 +08:00
xmlns:local="clr-namespace:ShrlAlgoToolkit.RevitAddins.RvFamily"
2024-09-22 11:05:41 +08:00
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
2026-01-02 17:30:41 +08:00
xmlns:ui="https://github.com/ShrlAlgo/Melskin"
2026-02-22 20:03:42 +08:00
xmlns:famMaster="clr-namespace:ShrlAlgoToolkit.RevitAddins.FamMaster"
2025-12-23 21:35:54 +08:00
Title="族复用"
Width="380"
Height="600"
MinWidth="380"
MinHeight="400"
2026-02-22 20:03:42 +08:00
d:DataContext="{d:DesignInstance Type=famMaster:FamilyProcessorViewModel}"
2025-12-23 21:35:54 +08:00
Icon="{DynamicResource RevitIcon}"
mc:Ignorable="d">
2024-09-22 11:05:41 +08:00
<Window.Resources>
2025-04-24 20:56:10 +08:00
<ResourceDictionary Source="pack://application:,,,/ShrlAlgoToolkit.RevitAddins;component/WPFUI.xaml" />
2024-09-22 11:05:41 +08:00
</Window.Resources>
<TabControl Margin="5,5,5,5">
<TabItem Header="保存族">
2025-08-20 12:10:35 +08:00
<ui:Grid
2024-09-22 11:05:41 +08:00
ChildMargin="5"
Columns="*,*"
Rows="*,Auto,Auto,Auto">
<DataGrid
2025-12-23 21:35:54 +08:00
x:Name="FamilySaveDg"
Grid.ColumnSpan="2"
d:ItemsSource="{d:SampleData}"
2024-09-22 11:05:41 +08:00
AutoGenerateColumns="False"
CanUserAddRows="False"
IsReadOnly="True"
ItemsSource="{Binding FamilyCollection}"
2025-12-23 21:35:54 +08:00
SelectionMode="Extended">
2024-09-22 11:05:41 +08:00
<!--<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
2025-12-23 21:35:54 +08:00
Width="60"
2024-09-22 11:05:41 +08:00
Binding="{Binding IsSelected, Mode=OneWayToSource, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}"
2025-10-10 11:19:58 +08:00
ElementStyle="{StaticResource DataGridCheckBoxStyle}"
2025-12-23 21:35:54 +08:00
Header="选择" />
2024-09-22 11:05:41 +08:00
<DataGridTextColumn Binding="{Binding FamilyCategory.Name}" Header="族类别" />
<DataGridTextColumn Binding="{Binding Name}" Header="族名称" />
</DataGrid.Columns>
</DataGrid>
<GroupBox
2025-04-24 20:56:44 +08:00
Grid.Row="1"
2025-12-23 21:35:54 +08:00
Grid.Column="1"
2024-09-22 11:05:41 +08:00
Header="保存选项">
<StackPanel>
<RadioButton Content="覆盖存在文件" IsChecked="{Binding IsOverride, UpdateSourceTrigger=PropertyChanged}" />
<RadioButton Content="忽略存在文件" />
</StackPanel>
</GroupBox>
<StackPanel
2025-04-24 20:56:44 +08:00
Grid.Row="1"
2025-12-23 21:35:54 +08:00
Grid.Column="0"
2024-09-22 11:05:41 +08:00
VerticalAlignment="Center">
<CheckBox Content="添加族类别文件夹" IsChecked="{Binding CreateCategoryFolder}" />
<CheckBox Content="文件名添加族类别" IsChecked="{Binding AddCategoryPrefix}" />
2024-09-22 11:05:41 +08:00
<CheckBox Content="以三维为默认视图" IsChecked="{Binding View3dAsDefault}" />
</StackPanel>
2025-08-20 12:10:35 +08:00
<TextBox
2025-12-23 21:35:54 +08:00
ui:InputAssist.PlaceholderText="保存路径"
2024-09-22 11:05:41 +08:00
Text="{Binding PathToSaveFamily}"
2025-12-23 21:35:54 +08:00
TextOptions.TextFormattingMode="Display" />
2025-08-20 12:10:35 +08:00
<Button
2025-12-23 21:35:54 +08:00
HorizontalAlignment="Stretch"
ui:ControlAssist.Icon="{ui:Icon '&#xEADF;',
FontFamily={StaticResource BoxIcons}}"
2024-09-22 11:05:41 +08:00
Command="{Binding SelectDirectoryCommand}"
Content="路径选择"
2025-12-23 21:35:54 +08:00
Cursor="Hand" />
2024-09-22 11:05:41 +08:00
<ComboBox
2025-12-23 21:35:54 +08:00
ui:InputAssist.PlaceholderText="导出的项目文件"
2024-09-22 11:05:41 +08:00
DisplayMemberPath="Title"
ItemsSource="{Binding SourceDocsList}"
2025-12-23 21:35:54 +08:00
SelectedItem="{Binding SourceDoc, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
2024-09-22 11:05:41 +08:00
<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding GetFamiliesCommand}" CommandParameter="{Binding}" />
</i:EventTrigger>
</i:Interaction.Triggers>-->
</ComboBox>
2025-08-20 12:10:35 +08:00
<Button
2025-12-23 21:35:54 +08:00
HorizontalAlignment="Stretch"
ui:ControlAssist.Icon="{ui:Icon Glyph=&#xEACE;,
FontFamily={StaticResource BoxIcons}}"
2024-09-22 11:05:41 +08:00
Command="{Binding SaveFamiliesCommand}"
CommandParameter="{Binding SelectedItems, ElementName=FamilySaveDg}"
2025-12-23 21:35:54 +08:00
Content="导出保存" />
2025-08-20 12:10:35 +08:00
</ui:Grid>
2024-09-22 11:05:41 +08:00
</TabItem>
<TabItem Header="传递族">
2025-08-20 12:10:35 +08:00
<ui:Grid
2024-09-22 11:05:41 +08:00
ChildMargin="5"
Columns="*,Auto"
Rows="*,Auto,Auto">
<DataGrid
2025-12-23 21:35:54 +08:00
x:Name="familyTransmitDg"
Grid.ColumnSpan="2"
d:ItemsSource="{d:SampleData}"
2024-09-22 11:05:41 +08:00
AutoGenerateColumns="False"
CanUserAddRows="False"
IsReadOnly="True"
ItemsSource="{Binding FamilyCollection}"
2025-12-23 21:35:54 +08:00
SelectionMode="Extended">
2024-09-22 11:05:41 +08:00
<!--<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
2025-12-23 21:35:54 +08:00
Width="60"
2024-09-22 11:05:41 +08:00
Binding="{Binding IsSelected, Mode=OneWayToSource, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}"
2025-10-10 11:19:58 +08:00
ElementStyle="{StaticResource DataGridCheckBoxStyle}"
2025-12-23 21:35:54 +08:00
Header="选择" />
2024-09-22 11:05:41 +08:00
<DataGridTextColumn Binding="{Binding FamilyCategory.Name}" Header="族类别" />
<DataGridTextColumn Binding="{Binding Name}" Header="族名称" />
</DataGrid.Columns>
</DataGrid>
<ComboBox
2025-04-24 20:56:44 +08:00
Grid.Row="1"
2025-12-23 21:35:54 +08:00
Grid.Column="0"
DisplayMemberPath="Title"
2024-09-22 11:05:41 +08:00
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
2025-12-23 21:35:54 +08:00
Grid.Row="1"
Grid.Column="1"
2024-09-22 11:05:41 +08:00
Command="{Binding TransmitFamilyCommand}"
CommandParameter="{Binding SelectedItems, ElementName=familyTransmitDg}"
Content="&#xEA84;"
FontFamily="{StaticResource BoxIcons}"
ToolTip="传递" />
<ComboBox
2025-04-24 20:56:44 +08:00
Grid.Row="2"
2025-12-23 21:35:54 +08:00
Grid.Column="0"
DisplayMemberPath="Title"
2024-09-22 11:05:41 +08:00
ItemsSource="{Binding TargetDocsList, Mode=TwoWay}"
SelectedItem="{Binding TargetDoc, UpdateSourceTrigger=PropertyChanged}"
Text="目标文档" />
<Button
2025-12-23 21:35:54 +08:00
Grid.Row="2"
Grid.Column="1"
2024-09-22 11:05:41 +08:00
Command="{Binding CancelCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}, Mode=FindAncestor}}"
Content="&#xEC84;"
FontFamily="{StaticResource BoxIcons}"
ToolTip="关闭" />
2025-08-20 12:10:35 +08:00
</ui:Grid>
2024-09-22 11:05:41 +08:00
</TabItem>
</TabControl>
2026-01-02 17:30:41 +08:00
</ui:MelWindow>