2025-09-16 16:06:41 +08:00
|
|
|
<controls:MaterialWindow
|
|
|
|
|
x:Class="Szmedi.RvKits.Modeling.InstanceCreatorWin"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2025-09-19 09:18:09 +08:00
|
|
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
2025-09-16 16:06:41 +08:00
|
|
|
xmlns:controls="clr-namespace:Szmedi.RvKits.Controls"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:local="clr-namespace:Szmedi.RvKits.Modeling"
|
|
|
|
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
2025-09-19 09:18:09 +08:00
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
2025-09-16 16:06:41 +08:00
|
|
|
Title="族实例布置"
|
|
|
|
|
Width="400"
|
|
|
|
|
Height="400"
|
|
|
|
|
d:DataContext="{d:DesignInstance local:InstanceCreatorViewModel}"
|
|
|
|
|
mc:Ignorable="d">
|
|
|
|
|
<controls:MaterialWindow.Resources>
|
|
|
|
|
<ResourceDictionary Source="pack://application:,,,/Szmedi.RvKits;component/WPFUI.xaml" />
|
|
|
|
|
</controls:MaterialWindow.Resources>
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<ComboBox
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
materialDesign:HintAssist.Hint="族名称"
|
|
|
|
|
DisplayMemberPath="Name"
|
|
|
|
|
IsEditable="True"
|
|
|
|
|
ItemsSource="{Binding FamiliesView}"
|
2025-09-19 09:18:09 +08:00
|
|
|
SelectedItem="{Binding SelectedFamily, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}">
|
2025-09-16 16:06:41 +08:00
|
|
|
<!--<b:Interaction.Triggers>
|
|
|
|
|
<b:EventTrigger EventName="PreviewTextInput">
|
|
|
|
|
<b:InvokeCommandAction Command="{Binding PreviewTextInputCommand}" PassEventArgsToCommand="True"/>
|
|
|
|
|
</b:EventTrigger>
|
|
|
|
|
</b:Interaction.Triggers>-->
|
|
|
|
|
</ComboBox>
|
|
|
|
|
<ComboBox
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
materialDesign:HintAssist.Hint="族类型"
|
|
|
|
|
DisplayMemberPath="Name"
|
|
|
|
|
IsSynchronizedWithCurrentItem="True"
|
|
|
|
|
ItemsSource="{Binding FamilySymbols}"
|
|
|
|
|
SelectedItem="{Binding SelectedFamilySymbol, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
<Image
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
Grid.RowSpan="2"
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
Width="64"
|
|
|
|
|
Height="64"
|
|
|
|
|
Margin="5"
|
|
|
|
|
Source="{Binding Image}" />
|
2025-09-19 09:18:09 +08:00
|
|
|
<TextBox
|
|
|
|
|
Grid.Row="3"
|
|
|
|
|
materialDesign:TextFieldAssist.PrefixText="偏移量:"
|
|
|
|
|
materialDesign:TextFieldAssist.SuffixText="mm">
|
2025-09-16 16:06:41 +08:00
|
|
|
<TextBox.Text>
|
|
|
|
|
<Binding Path="Offset" UpdateSourceTrigger="PropertyChanged">
|
|
|
|
|
<Binding.ValidationRules>
|
|
|
|
|
<helper:DoubleValidationRule xmlns:helper="clr-namespace:Szmedi.Toolkit.Assists" ValidatesOnTargetUpdated="True" />
|
|
|
|
|
</Binding.ValidationRules>
|
|
|
|
|
</Binding>
|
|
|
|
|
</TextBox.Text>
|
|
|
|
|
</TextBox>
|
|
|
|
|
<DataGrid
|
|
|
|
|
Grid.Row="2"
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
Grid.ColumnSpan="2"
|
|
|
|
|
d:ItemsSource="{d:SampleData ItemCount=5}"
|
|
|
|
|
AutoGenerateColumns="False"
|
|
|
|
|
ItemsSource="{Binding RelatedProps}"
|
|
|
|
|
ToolTip="根据提取的图层,就近将文字内容赋值给创建族实例的参数">
|
|
|
|
|
<DataGrid.Columns>
|
|
|
|
|
<DataGridCheckBoxColumn
|
|
|
|
|
Binding="{Binding IsChecked, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
EditingElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnEditingStyle}"
|
|
|
|
|
ElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnStyle}"
|
|
|
|
|
Header="是否赋值" />
|
|
|
|
|
<DataGridTextColumn
|
|
|
|
|
Binding="{Binding Name, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
|
|
|
|
ElementStyle="{StaticResource MaterialDesignDataGridTextColumnStyle}"
|
|
|
|
|
Header="参数名" />
|
|
|
|
|
<DataGridTemplateColumn Header="选择图层">
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Button
|
|
|
|
|
Command="{Binding DataContext.PickLayerCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
|
|
|
|
|
CommandParameter="{Binding}"
|
|
|
|
|
Content="{Binding LayerName, Mode=OneWay}"
|
|
|
|
|
IsEnabled="{Binding IsChecked, Mode=OneWay}"
|
|
|
|
|
Style="{StaticResource MaterialDesignPaperDarkButton}" />
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
<Button
|
|
|
|
|
Grid.Row="3"
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
Width="85"
|
|
|
|
|
Command="{Binding CloseWinCommand}"
|
|
|
|
|
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
|
|
|
|
|
Content="布置"
|
|
|
|
|
ToolTip="选择dwg块并布置族实例" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</controls:MaterialWindow>
|