2025-08-20 12:10:35 +08:00
|
|
|
|
<ui:NeoWindow
|
2025-04-24 20:56:44 +08:00
|
|
|
|
x:Class="ShrlAlgoToolkit.RevitAddins.RvView.ViewManagerView"
|
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"
|
2025-04-24 20:56:44 +08:00
|
|
|
|
xmlns:assists="clr-namespace:ShrlAlgoToolkit.Mvvm.Assists;assembly=ShrlAlgoToolkit.Mvvm"
|
2024-09-22 11:05:41 +08:00
|
|
|
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
2025-04-24 20:56:44 +08:00
|
|
|
|
xmlns:converters="clr-namespace:ShrlAlgoToolkit.Mvvm.Converters;assembly=ShrlAlgoToolkit.Mvvm"
|
2024-09-22 11:05:41 +08:00
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
2025-04-24 20:56:44 +08:00
|
|
|
|
xmlns:local="clr-namespace:ShrlAlgoToolkit.RevitAddins.RvView"
|
2024-09-22 11:05:41 +08:00
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
2025-04-24 20:56:44 +08:00
|
|
|
|
xmlns:rvView="clr-namespace:ShrlAlgoToolkit.RevitAddins.RvView"
|
2025-08-20 12:10:35 +08:00
|
|
|
|
xmlns:ui="https://github.com/ShrlAlgo/NeoUI"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Title="视图管理"
|
|
|
|
|
|
Width="800"
|
|
|
|
|
|
Height="450"
|
|
|
|
|
|
d:DataContext="{d:DesignInstance Type=local:ViewManagerViewModel}"
|
|
|
|
|
|
Icon="{DynamicResource RevitIcon}"
|
|
|
|
|
|
mc:Ignorable="d">
|
2024-09-22 11:05:41 +08:00
|
|
|
|
<Window.Resources>
|
|
|
|
|
|
<ResourceDictionary>
|
|
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
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
|
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
|
<converters:SearchValueConverter x:Key="SearchValueConverter" />
|
2025-12-23 21:35:54 +08:00
|
|
|
|
<converters:EnumItemsSourceAndConverter x:Key="DetailLevelConverter" Type="{x:Type rvView:UserViewDetailLevel}" />
|
|
|
|
|
|
<converters:EnumItemsSourceAndConverter x:Key="ViewTypeConverter" Type="{x:Type rvView:UserViewType}" />
|
|
|
|
|
|
<converters:EnumItemsSourceAndConverter x:Key="DisplayStyleConverter" Type="{x:Type rvView:UserDisplayStyle}" />
|
|
|
|
|
|
<converters:EnumItemsSourceAndConverter x:Key="ViewDisciplineConverter" Type="{x:Type rvView:UserViewDiscipline}" />
|
|
|
|
|
|
<assists:BindingProxy x:Key="ViewDataGridProxy" Data="{Binding ElementName=ViewDataGrid}" />
|
2024-09-22 11:05:41 +08:00
|
|
|
|
|
|
|
|
|
|
</ResourceDictionary>
|
|
|
|
|
|
</Window.Resources>
|
2025-08-20 12:10:35 +08:00
|
|
|
|
<ui:Grid
|
2024-09-22 11:05:41 +08:00
|
|
|
|
ChildMargin="5"
|
|
|
|
|
|
Columns="*,Auto,Auto"
|
|
|
|
|
|
Rows="*,Auto">
|
|
|
|
|
|
<DataGrid
|
2025-12-23 21:35:54 +08:00
|
|
|
|
x:Name="ViewDataGrid"
|
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
Grid.ColumnSpan="3"
|
|
|
|
|
|
Height="380"
|
|
|
|
|
|
d:ItemsSource="{d:SampleData}"
|
2024-09-22 11:05:41 +08:00
|
|
|
|
AutoGenerateColumns="False"
|
|
|
|
|
|
CanUserAddRows="False"
|
|
|
|
|
|
EnableRowVirtualization="False"
|
|
|
|
|
|
FrozenColumnCount="2"
|
|
|
|
|
|
GridLinesVisibility="All"
|
|
|
|
|
|
ItemsSource="{Binding FilteredList}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
SelectionMode="Extended">
|
2024-09-22 11:05:41 +08:00
|
|
|
|
<b:Interaction.Triggers>
|
|
|
|
|
|
<b:EventTrigger EventName="SelectionChanged">
|
|
|
|
|
|
<!--<b:InvokeCommandAction Command="{Binding DataContext.UpdateExecuteCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" CommandParameter="{Binding SelectedItems, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" />-->
|
|
|
|
|
|
<b:InvokeCommandAction Command="{Binding UpdateExecuteCommand}" CommandParameter="{Binding SelectedItems, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}, Mode=FindAncestor}}" />
|
|
|
|
|
|
</b:EventTrigger>
|
|
|
|
|
|
|
|
|
|
|
|
<!--<b:EventTrigger EventName="CellEditEnding">
|
|
|
|
|
|
<b:InvokeCommandAction Command="{Binding UpdatePropertyCommand}" CommandParameter="{Binding SelectedItems, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" />
|
|
|
|
|
|
</b:EventTrigger>-->
|
|
|
|
|
|
</b:Interaction.Triggers>
|
|
|
|
|
|
<DataGrid.ContextMenu>
|
|
|
|
|
|
<ContextMenu>
|
|
|
|
|
|
<MenuItem
|
|
|
|
|
|
Command="{Binding CopyOnlyCommand}"
|
|
|
|
|
|
CommandParameter="{Binding Data.SelectedItems, Source={StaticResource ViewDataGridProxy}}"
|
|
|
|
|
|
Header="复制" />
|
|
|
|
|
|
<MenuItem
|
|
|
|
|
|
Command="{Binding CopyWithDetailCommand}"
|
|
|
|
|
|
CommandParameter="{Binding Data.SelectedItems, Source={StaticResource ViewDataGridProxy}}"
|
|
|
|
|
|
Header="带细节复制" />
|
|
|
|
|
|
<MenuItem
|
|
|
|
|
|
Command="{Binding CopyAsDependentCommand}"
|
|
|
|
|
|
CommandParameter="{Binding Data.SelectedItems, Source={StaticResource ViewDataGridProxy}}"
|
|
|
|
|
|
Header="复制作为相关" />
|
|
|
|
|
|
<MenuItem
|
|
|
|
|
|
Command="{Binding DeleteCommand}"
|
|
|
|
|
|
CommandParameter="{Binding Data.SelectedItems, Source={StaticResource ViewDataGridProxy}}"
|
|
|
|
|
|
Header="删除视图" />
|
|
|
|
|
|
</ContextMenu>
|
|
|
|
|
|
</DataGrid.ContextMenu>
|
|
|
|
|
|
<!--<DataGrid.RowHeaderTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<Grid Width="35">
|
|
|
|
|
|
<CheckBox HorizontalAlignment="Center" IsChecked="{Binding IsSelected, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}" />
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGrid.RowHeaderTemplate>-->
|
|
|
|
|
|
<DataGrid.Columns>
|
|
|
|
|
|
<DataGridTemplateColumn Width="80">
|
|
|
|
|
|
<DataGridTemplateColumn.HeaderTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<CheckBox Content="全选">
|
|
|
|
|
|
<b:Interaction.Triggers>
|
|
|
|
|
|
<b:EventTrigger EventName="Checked">
|
|
|
|
|
|
<b:CallMethodAction MethodName="SelectAll" TargetObject="{Binding ElementName=ViewDataGrid}" />
|
|
|
|
|
|
</b:EventTrigger>
|
|
|
|
|
|
<b:EventTrigger EventName="Unchecked">
|
|
|
|
|
|
<b:CallMethodAction MethodName="UnselectAll" TargetObject="{Binding ElementName=ViewDataGrid}" />
|
|
|
|
|
|
</b:EventTrigger>
|
|
|
|
|
|
</b:Interaction.Triggers>
|
|
|
|
|
|
</CheckBox>
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.HeaderTemplate>
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<CheckBox HorizontalAlignment="Center" IsChecked="{Binding IsSelected, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}" />
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
<DataGridTextColumn
|
|
|
|
|
|
Binding="{Binding Name, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
|
EditingElementStyle="{StaticResource DefaultTextBoxStyle}"
|
|
|
|
|
|
Header="视图名称">
|
|
|
|
|
|
<DataGridTextColumn.ElementStyle>
|
|
|
|
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</DataGridTextColumn.ElementStyle>
|
|
|
|
|
|
</DataGridTextColumn>
|
|
|
|
|
|
<DataGridTextColumn
|
|
|
|
|
|
Binding="{Binding UserViewType, Converter={StaticResource ViewTypeConverter}, Mode=OneTime}"
|
|
|
|
|
|
Header="视图类型"
|
|
|
|
|
|
IsReadOnly="True">
|
|
|
|
|
|
<DataGridTextColumn.ElementStyle>
|
|
|
|
|
|
<Style TargetType="{x:Type TextBlock}">
|
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</DataGridTextColumn.ElementStyle>
|
|
|
|
|
|
</DataGridTextColumn>
|
|
|
|
|
|
<DataGridTemplateColumn Header="视图比例">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
|
<TextBlock
|
|
|
|
|
|
HorizontalAlignment="Center"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
VerticalAlignment="Center"
|
2024-09-22 11:05:41 +08:00
|
|
|
|
IsEnabled="{Binding IsScaleEditable}"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Text="1:" />
|
2024-09-22 11:05:41 +08:00
|
|
|
|
<!--<TextBox IsEnabled="{Binding IsScaleEditable}" Text="{Binding Scale, StringFormat={}1:{0}}" />-->
|
|
|
|
|
|
<TextBox IsEnabled="{Binding IsScaleEditable}" Text="{Binding Scale, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
<!--<DataGridTemplateColumn Header="视图样板">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<TextBlock Style="{x:Null}" Text="{Binding ViewTemplate}" />
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataGridTemplateColumn.CellEditingTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<ComboBox
|
|
|
|
|
|
DisplayMemberPath="Name"
|
|
|
|
|
|
ItemsSource="{Binding DataContext.ViewTemplates, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
|
|
|
|
|
|
SelectedItem="{Binding ViewTemplate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
|
SelectedValue="Value"
|
|
|
|
|
|
Style="{StaticResource mdDataGridComboBox}" />
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellEditingTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>-->
|
|
|
|
|
|
<DataGridTemplateColumn Header="图形显示">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<ComboBox
|
|
|
|
|
|
IsEnabled="{Binding IsDisplayStyleEditable}"
|
|
|
|
|
|
ItemsSource="{Binding Source={StaticResource DisplayStyleConverter}}"
|
|
|
|
|
|
SelectedItem="{Binding DisplayStyle, Converter={StaticResource DisplayStyleConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
<DataGridTemplateColumn Header="详细程度">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<ComboBox
|
|
|
|
|
|
IsEnabled="{Binding IsDetailLevelEditable}"
|
|
|
|
|
|
ItemsSource="{Binding Source={StaticResource DetailLevelConverter}}"
|
|
|
|
|
|
SelectedItem="{Binding DetailLevel, Converter={StaticResource DetailLevelConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
<!--<DataGridComboBoxColumn
|
|
|
|
|
|
Header="详细程度"
|
|
|
|
|
|
ItemsSource="{Binding Source={StaticResource DetailLevelConverter}}"
|
|
|
|
|
|
SelectedValueBinding="{Binding DetailLevel, Mode=TwoWay, Converter={StaticResource DetailLevelConverter}, UpdateSourceTrigger=PropertyChanged}">
|
|
|
|
|
|
<DataGridComboBoxColumn.EditingElementStyle>
|
|
|
|
|
|
<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox">
|
|
|
|
|
|
<Setter Property="IsEnabled" Value="{Binding IsDetailLevelEditable}" />
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</DataGridComboBoxColumn.EditingElementStyle>
|
|
|
|
|
|
<DataGridComboBoxColumn.ElementStyle>
|
|
|
|
|
|
<Style TargetType="ComboBox">
|
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</DataGridComboBoxColumn.ElementStyle>
|
|
|
|
|
|
</DataGridComboBoxColumn>-->
|
|
|
|
|
|
<DataGridTemplateColumn Header="视图样板">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<ComboBox
|
|
|
|
|
|
DisplayMemberPath="Name"
|
|
|
|
|
|
IsEnabled="{Binding IsViewTemplateEditable}"
|
|
|
|
|
|
ItemsSource="{Binding ViewTemplates}"
|
|
|
|
|
|
SelectedItem="{Binding ViewTemplate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
<DataGridTemplateColumn Header="规程">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<ComboBox
|
|
|
|
|
|
IsEnabled="{Binding IsDisciplineEditable}"
|
|
|
|
|
|
ItemsSource="{Binding Source={StaticResource ViewDisciplineConverter}}"
|
|
|
|
|
|
SelectedItem="{Binding Discipline, Converter={StaticResource ViewDisciplineConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
<DataGridTemplateColumn Header="图纸编号">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<TextBox IsEnabled="{Binding IsSheetNumberEditable}" Text="{Binding SheetNumber, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
<DataGridTemplateColumn Header="图纸上的标题">
|
|
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
|
<TextBox IsEnabled="{Binding IsSheetNameEditable}" Text="{Binding SheetName, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
|
</DataGrid>
|
2025-08-20 12:10:35 +08:00
|
|
|
|
<TextBox
|
2025-12-23 21:35:54 +08:00
|
|
|
|
x:Name="TbSearch"
|
2025-04-24 20:56:10 +08:00
|
|
|
|
Grid.Row="1"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
ui:InputAssist.PlaceholderText="搜索视图"
|
|
|
|
|
|
Cursor="IBeam"
|
|
|
|
|
|
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" />
|
2025-08-20 12:10:35 +08:00
|
|
|
|
<Button
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Grid.Row="1"
|
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
|
ui:ControlAssist.Icon="{ui:Icon SymbolValue=Search}"
|
2024-09-22 11:05:41 +08:00
|
|
|
|
Command="{Binding SearchCommand}"
|
|
|
|
|
|
Content="搜索"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
IsDefault="True" />
|
2025-08-20 12:10:35 +08:00
|
|
|
|
<Button
|
2025-04-24 20:56:10 +08:00
|
|
|
|
Grid.Row="1"
|
2025-12-23 21:35:54 +08:00
|
|
|
|
Grid.Column="2"
|
|
|
|
|
|
ui:ControlAssist.Icon="{ui:Icon SymbolValue=Edit}"
|
|
|
|
|
|
Command="{Binding ConfirmCommand}"
|
|
|
|
|
|
Content="应用" />
|
2024-09-22 11:05:41 +08:00
|
|
|
|
|
2025-08-20 12:10:35 +08:00
|
|
|
|
</ui:Grid>
|
|
|
|
|
|
</ui:NeoWindow>
|