命名调整
This commit is contained in:
@@ -32,11 +32,19 @@ public class ExplodeDwgCmd : ExternalCommand
|
||||
{
|
||||
foreach (var obj in instance.GetInstanceGeometry())
|
||||
{
|
||||
if (obj is Solid solid)
|
||||
try
|
||||
{
|
||||
var directShape = DirectShape.CreateElement(Document, f.FamilyCategory.Id);
|
||||
directShape.SetShape(new GeometryObject[] { solid });
|
||||
if (obj is Solid solid)
|
||||
{
|
||||
var directShape = DirectShape.CreateElement(Document, f.FamilyCategory.Id);
|
||||
directShape.SetShape(new GeometryObject[] { solid });
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,69 +1,65 @@
|
||||
<ui:FluentWindowEx
|
||||
Height="600"
|
||||
Title="重命名族"
|
||||
Width="900"
|
||||
d:DataContext="{d:DesignInstance local:RenameFamilyViewModel}"
|
||||
mc:Ignorable="d"
|
||||
x:Class="ShrlAlgoToolkit.RevitAddins.RvFamily.RenameFamilyView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:attach="clr-namespace:ShrlAlgoToolkit.Mvvm.Attach;assembly=ShrlAlgoToolkit.Mvvm"
|
||||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ShrlAlgoToolkit.RevitAddins.RvFamily"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:validationRules="clr-namespace:ShrlAlgoToolkit.Mvvm.ValidationRules;assembly=ShrlAlgoToolkit.Mvvm"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ui:FluentWindowEx x:Class="ShrlAlgoToolkit.RevitAddins.RvFamily.RenameFamilyView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:attach="clr-namespace:ShrlAlgoToolkit.Mvvm.Attach;assembly=ShrlAlgoToolkit.Mvvm"
|
||||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ShrlAlgoToolkit.RevitAddins.RvFamily"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:validationRules="clr-namespace:ShrlAlgoToolkit.Mvvm.ValidationRules;assembly=ShrlAlgoToolkit.Mvvm"
|
||||
Width="900"
|
||||
Height="600"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance local:RenameFamilyViewModel}"
|
||||
Title="重命名族">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary Source="pack://application:,,,/ShrlAlgoToolkit.RevitAddins;component/WPFUI.xaml" />
|
||||
</Window.Resources>
|
||||
<ui:AutoGrid
|
||||
ChildMargin="5"
|
||||
Columns="250,*,*,*"
|
||||
Rows="*,Auto">
|
||||
<ui:AutoGrid
|
||||
Columns="*"
|
||||
Grid.RowSpan="2"
|
||||
Rows="*,Auto,Auto">
|
||||
<ui:AutoGrid ChildMargin="5"
|
||||
Columns="250,*,*,*"
|
||||
Rows="*,Auto">
|
||||
<ui:AutoGrid Grid.RowSpan="2"
|
||||
Columns="*"
|
||||
Rows="*,Auto,Auto">
|
||||
<GroupBox Header="族类别">
|
||||
<ListBox
|
||||
DisplayMemberPath="Key"
|
||||
Height="400"
|
||||
ItemsSource="{Binding Collection, Mode=OneWay}"
|
||||
SelectionMode="Multiple"
|
||||
d:ItemsSource="{d:SampleData ItemCount=5}"
|
||||
x:Name="LbCategories">
|
||||
<!--<ListBox.ItemsPanel>
|
||||
<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>
|
||||
</ListBox.ItemsPanel> -->
|
||||
<!-- <ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>-->
|
||||
<!--<ListBox.ItemTemplate>
|
||||
</ListBox.ItemsPanel> -->
|
||||
<!-- <ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border CornerRadius="5" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>-->
|
||||
<!--<ListBox.ItemContainerStyle>
|
||||
</ListBox.ItemTemplate> -->
|
||||
<!-- <ListBox.ItemContainerStyle>
|
||||
<Style />
|
||||
</ListBox.ItemContainerStyle>-->
|
||||
</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>
|
||||
<!-- <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.ItemTemplate> -->
|
||||
</ListBox>
|
||||
</GroupBox>
|
||||
<DockPanel>
|
||||
@@ -77,40 +73,40 @@
|
||||
</b:EventTrigger>
|
||||
</b:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
Text="{Binding CategoryCount, StringFormat=类别数:{}{0:D}}"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding CategoryCount, StringFormat=类别数:{}{0:D}}" />
|
||||
</DockPanel>
|
||||
<ui:TextBoxEx PlaceholderText="过滤族类别" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</ui:AutoGrid>
|
||||
<DataGrid
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="3"
|
||||
Grid.Row="0"
|
||||
HeadersVisibility="Column"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
ItemsSource="{Binding RenameItems}"
|
||||
SelectionUnit="Cell"
|
||||
attach:TextSearch.SearchValue="{Binding Text, ElementName=TbFound, UpdateSourceTrigger=PropertyChanged}"
|
||||
x:Name="DgRename">
|
||||
<DataGrid x:Name="DgRename"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="3"
|
||||
attach:TextSearchAssist.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="attach:TextSearch.IsTextMatch">
|
||||
<!-- <Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" /> -->
|
||||
<Setter Property="attach:TextSearchAssist.IsTextMatch">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource SearchFamilyValueConverter}">
|
||||
<Binding Path="Content.Text" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="(attach:TextSearch.SearchValue)" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="(attach:TextSearchAssist.SearchValue)" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding RelativeSource="{RelativeSource Mode=Self}" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="attach:TextSearch.IsTextMatch" Value="True">
|
||||
<Trigger Property="attach:TextSearchAssist.IsTextMatch" Value="True">
|
||||
<Setter Property="Foreground" Value="SkyBlue" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
@@ -122,30 +118,27 @@
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn
|
||||
Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditingElementStyle="{StaticResource DataGridCheckBoxEditingElementDefaultStyle}"
|
||||
ElementStyle="{StaticResource DataGridCheckBoxElementDefaultStyle}"
|
||||
MinWidth="80">
|
||||
<DataGridCheckBoxColumn MinWidth="80"
|
||||
Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditingElementStyle="{StaticResource DataGridCheckBoxEditingElementDefaultStyle}"
|
||||
ElementStyle="{StaticResource DataGridCheckBoxElementDefaultStyle}">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<Border Background="Transparent">
|
||||
<CheckBox
|
||||
Content="全选"
|
||||
HorizontalAlignment="Center"
|
||||
IsChecked="{Binding DataContext.IsAllItemsSelected, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" />
|
||||
<CheckBox HorizontalAlignment="Center"
|
||||
Content="全选"
|
||||
IsChecked="{Binding DataContext.IsAllItemsSelected, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" />
|
||||
</Border>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
<!--<DataGridCheckBoxColumn.HeaderStyle>
|
||||
<!-- <DataGridCheckBoxColumn.HeaderStyle>
|
||||
<Style BasedOn="{StaticResource DefaultDataGridColumnHeaderStyle}" TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
</DataGridCheckBoxColumn.HeaderStyle>-->
|
||||
</DataGridCheckBoxColumn.HeaderStyle> -->
|
||||
</DataGridCheckBoxColumn>
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding CategoryName}"
|
||||
Header="族类别"
|
||||
IsReadOnly="True"
|
||||
MinWidth="80">
|
||||
<DataGridTextColumn MinWidth="80"
|
||||
Binding="{Binding CategoryName}"
|
||||
Header="族类别"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
@@ -153,11 +146,10 @@
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding OldFamilyName}"
|
||||
Header="族名称"
|
||||
IsReadOnly="True"
|
||||
MinWidth="80">
|
||||
<DataGridTextColumn MinWidth="80"
|
||||
Binding="{Binding OldFamilyName}"
|
||||
Header="族名称"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
@@ -165,11 +157,10 @@
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding NewFamilyName, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditingElementStyle="{StaticResource DefaultTextBoxStyle}"
|
||||
Header="新族名称"
|
||||
MinWidth="80">
|
||||
<DataGridTextColumn MinWidth="80"
|
||||
Binding="{Binding NewFamilyName, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditingElementStyle="{StaticResource DefaultTextBoxStyle}"
|
||||
Header="新族名称">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
@@ -181,18 +172,17 @@
|
||||
</DataGrid>
|
||||
<GroupBox Header="前/后缀">
|
||||
<UniformGrid Columns="1">
|
||||
<ui:TextBox
|
||||
IsEnabled="{Binding CanInput}"
|
||||
Margin="5"
|
||||
PlaceholderText="前缀"
|
||||
x:Name="CbPrefix">
|
||||
<ui:TextBox x:Name="CbPrefix"
|
||||
Margin="5"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
PlaceholderText="前缀">
|
||||
<Binding Path="PrefixText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validationRules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</ui:TextBox>
|
||||
<!--<TextBox
|
||||
<!-- <TextBox
|
||||
x:Name="TbPrefix"
|
||||
materialDesign:HintAssist.Hint="前缀"
|
||||
IsEnabled="{Binding CanInput}">
|
||||
@@ -203,12 +193,11 @@
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</TextBox.Text>
|
||||
</TextBox>-->
|
||||
<ui:TextBox
|
||||
IsEnabled="{Binding CanInput}"
|
||||
Margin="5"
|
||||
PlaceholderText="后缀"
|
||||
x:Name="TbSuffix">
|
||||
</TextBox> -->
|
||||
<ui:TextBox x:Name="TbSuffix"
|
||||
Margin="5"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
PlaceholderText="后缀">
|
||||
<Binding Path="SuffixText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validationRules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
@@ -219,22 +208,20 @@
|
||||
</GroupBox>
|
||||
<GroupBox Header="查找/替换">
|
||||
<StackPanel>
|
||||
<ui:TextBox
|
||||
IsEnabled="{Binding CanInput}"
|
||||
Margin="5"
|
||||
PlaceholderText="查找"
|
||||
x:Name="TbFound">
|
||||
<ui:TextBox x:Name="TbFound"
|
||||
Margin="5"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
PlaceholderText="查找">
|
||||
<Binding Path="FoundText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validationRules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
</Binding.ValidationRules>
|
||||
</Binding>
|
||||
</ui:TextBox>
|
||||
<ui:TextBox
|
||||
IsEnabled="{Binding CanInput}"
|
||||
Margin="5"
|
||||
PlaceholderText="替换"
|
||||
x:Name="TbReplace">
|
||||
<ui:TextBox x:Name="TbReplace"
|
||||
Margin="5"
|
||||
IsEnabled="{Binding CanInput}"
|
||||
PlaceholderText="替换">
|
||||
<Binding Path="ReplaceText" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validationRules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
@@ -249,7 +236,7 @@
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Grid.Row="0" Header="连接符">
|
||||
<TextBox IsEnabled="{Binding CanInput}" x:Name="TbSeparator">
|
||||
<TextBox x:Name="TbSeparator" IsEnabled="{Binding CanInput}">
|
||||
<Binding Path="Separator" UpdateSourceTrigger="PropertyChanged">
|
||||
<Binding.ValidationRules>
|
||||
<validationRules:UndefinedCharRules ValidatesOnTargetUpdated="True" />
|
||||
@@ -257,12 +244,11 @@
|
||||
</Binding>
|
||||
</TextBox>
|
||||
</GroupBox>
|
||||
<Button
|
||||
Command="{Binding ModifyNameCommand}"
|
||||
Content="修改名称"
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
ToolTip="勾选要修改的项进行修改" />
|
||||
<Button Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding ModifyNameCommand}"
|
||||
Content="修改名称"
|
||||
ToolTip="勾选要修改的项进行修改" />
|
||||
</Grid>
|
||||
</ui:AutoGrid>
|
||||
</ui:FluentWindowEx>
|
||||
</ui:FluentWindowEx>
|
||||
@@ -84,20 +84,20 @@
|
||||
ItemsSource="{Binding RenameItems}"
|
||||
SelectionMode="Extended"
|
||||
SelectionUnit="Cell"
|
||||
attach:TextSearch.SearchValue="{Binding Text, ElementName=TbFound, UpdateSourceTrigger=PropertyChanged}">
|
||||
attach:TextSearchAssist.SearchValue="{Binding Text, ElementName=TbFound, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGrid.Resources>
|
||||
<Style BasedOn="{StaticResource DefaultDataGridCellStyle}" TargetType="{x:Type DataGridCell}">
|
||||
<Setter Property="attach:TextSearch.IsTextMatch">
|
||||
<Setter Property="attach:TextSearchAssist.IsTextMatch">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource SearchTypeValueConverter}">
|
||||
<Binding Path="Content.Text" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="(attach:TextSearch.SearchValue)" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="(attach:TextSearchAssist.SearchValue)" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding RelativeSource="{RelativeSource Mode=Self}" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="attach:TextSearch.IsTextMatch" Value="True">
|
||||
<Trigger Property="attach:TextSearchAssist.IsTextMatch" Value="True">
|
||||
<Setter Property="Foreground" Value="SkyBlue" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
|
||||
Reference in New Issue
Block a user