237 lines
13 KiB
Plaintext
237 lines
13 KiB
Plaintext
|
|
<controls:MaterialWindow
|
|||
|
|
x:Class="Szmedi.RevitToolkit.Approval.Views.ReviewArchiSignView"
|
|||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|||
|
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
|||
|
|
xmlns:controls="clr-namespace:Szmedi.RevitToolkit.Approval.Controls"
|
|||
|
|
xmlns:conv="clr-namespace:Szmedi.RevitToolkit.Approval.Converters"
|
|||
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|||
|
|
xmlns:dgx="urn:tom-englert.de/DataGridExtensions"
|
|||
|
|
xmlns:ex="clr-namespace:Szmedi.RevitToolkit.Approval.Extensions"
|
|||
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|||
|
|
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|||
|
|
xmlns:model="clr-namespace:Szmedi.RevitToolkit.Approval.Models"
|
|||
|
|
xmlns:viewmodels="clr-namespace:Szmedi.RevitToolkit.Approval.ViewModels"
|
|||
|
|
Title="建筑工程标识检查"
|
|||
|
|
Width="800"
|
|||
|
|
Height="600"
|
|||
|
|
d:DataContext="{d:DesignInstance Type=viewmodels:ReviewArchiSignViewModel}"
|
|||
|
|
Style="{DynamicResource SZMEDIWindowStyle}"
|
|||
|
|
mc:Ignorable="d">
|
|||
|
|
<controls:MaterialWindow.Resources>
|
|||
|
|
<ResourceDictionary Source="pack://application:,,,/Szmedi.RevitToolkit.Approval;component/SZMEDIResources.xaml" />
|
|||
|
|
</controls:MaterialWindow.Resources>
|
|||
|
|
<Grid>
|
|||
|
|
<Grid.RowDefinitions>
|
|||
|
|
<RowDefinition Height="1*" />
|
|||
|
|
<RowDefinition Height="Auto" />
|
|||
|
|
</Grid.RowDefinitions>
|
|||
|
|
|
|||
|
|
<DataGrid
|
|||
|
|
x:Name="DataGridElements"
|
|||
|
|
Grid.Row="0"
|
|||
|
|
Margin="5"
|
|||
|
|
AutoGenerateColumns="False"
|
|||
|
|
CanUserAddRows="False"
|
|||
|
|
EnableColumnVirtualization="True"
|
|||
|
|
EnableRowVirtualization="True"
|
|||
|
|
GridLinesVisibility="Horizontal"
|
|||
|
|
ItemsSource="{Binding Items}"
|
|||
|
|
VirtualizingPanel.IsVirtualizingWhenGrouping="True"
|
|||
|
|
VirtualizingStackPanel.IsVirtualizing="True"
|
|||
|
|
VirtualizingStackPanel.VirtualizationMode="Recycling">
|
|||
|
|
<!-- 附加我们的行为 -->
|
|||
|
|
<DataGrid.GroupStyle>
|
|||
|
|
<GroupStyle ContainerStyle="{StaticResource GroupHeaderStyle}">
|
|||
|
|
<GroupStyle.Panel>
|
|||
|
|
<ItemsPanelTemplate>
|
|||
|
|
<DataGridRowsPresenter />
|
|||
|
|
</ItemsPanelTemplate>
|
|||
|
|
</GroupStyle.Panel>
|
|||
|
|
</GroupStyle>
|
|||
|
|
</DataGrid.GroupStyle>
|
|||
|
|
<DataGrid.Columns>
|
|||
|
|
<DataGridTemplateColumn Width="80">
|
|||
|
|
<DataGridTemplateColumn.HeaderTemplate>
|
|||
|
|
<DataTemplate>
|
|||
|
|
<CheckBox Content="全选">
|
|||
|
|
<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="Checked">
|
|||
|
|
<b:CallMethodAction MethodName="SelectAll" TargetObject="{Binding ElementName=DataGridElements}" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
<b:EventTrigger EventName="Unchecked">
|
|||
|
|
<b:CallMethodAction MethodName="UnselectAll" TargetObject="{Binding ElementName=DataGridElements}" />
|
|||
|
|
</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>
|
|||
|
|
<!-- <Style TargetType="DataGridCell">
|
|||
|
|
<Setter Property="MinHeight" Value="40" />
|
|||
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|||
|
|
-->
|
|||
|
|
<!-- 确保 TextBlock 也垂直居中(如果列内容是 TextBlock) -->
|
|||
|
|
<!-- <Setter Property="Template">
|
|||
|
|
<Setter.Value>
|
|||
|
|
<ControlTemplate TargetType="DataGridCell">
|
|||
|
|
<Grid Background="{TemplateBinding Background}">
|
|||
|
|
<ContentPresenter VerticalAlignment="Center" />
|
|||
|
|
</Grid>
|
|||
|
|
</ControlTemplate>
|
|||
|
|
</Setter.Value>
|
|||
|
|
</Setter>
|
|||
|
|
</Style>-->
|
|||
|
|
<DataGridTextColumn Width="Auto"
|
|||
|
|
Binding="{Binding Sign,Mode=TwoWay}"
|
|||
|
|
Header="标识" IsReadOnly="True"/>
|
|||
|
|
<!-- <DataGridComboBoxColumn Width="Auto" Header="标识" ItemsSource="{Binding Signs}" SelectedValueBinding="{Binding Sign}"/> -->
|
|||
|
|
<!--<DataGridCheckBoxColumn Binding="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}" />-->
|
|||
|
|
<DataGridComboBoxColumn Width="Auto" Header="选择标识">
|
|||
|
|
<DataGridComboBoxColumn.EditingElementStyle>
|
|||
|
|
<Style BasedOn="{StaticResource MaterialDesignComboBox}" TargetType="ComboBox">
|
|||
|
|
<Setter Property="IsEditable" Value="True" />
|
|||
|
|
<Setter Property="ItemsSource" Value="{Binding DataContext.Signs, RelativeSource={RelativeSource AncestorType=DataGrid}}" />
|
|||
|
|
<Setter Property="SelectedValue" Value="{Binding Sign, UpdateSourceTrigger=PropertyChanged}" />
|
|||
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|||
|
|
</Style>
|
|||
|
|
</DataGridComboBoxColumn.EditingElementStyle>
|
|||
|
|
<DataGridComboBoxColumn.ElementStyle>
|
|||
|
|
<!--<Style TargetType="TextBlock">
|
|||
|
|
<Setter Property="Text" Value="{Binding Sign, UpdateSourceTrigger=PropertyChanged}" />
|
|||
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|||
|
|
</Style>-->
|
|||
|
|
<Style BasedOn="{StaticResource MaterialDesignComboBox}" TargetType="ComboBox">
|
|||
|
|
<Setter Property="ItemsSource" Value="{Binding DataContext.Signs, RelativeSource={RelativeSource AncestorType=DataGrid}}" />
|
|||
|
|
<Setter Property="SelectedValue" Value="{Binding Sign, UpdateSourceTrigger=PropertyChanged}" />
|
|||
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|||
|
|
</Style>
|
|||
|
|
</DataGridComboBoxColumn.ElementStyle>
|
|||
|
|
</DataGridComboBoxColumn>
|
|||
|
|
<DataGridTextColumn
|
|||
|
|
Width="100"
|
|||
|
|
Binding="{Binding Element.Id}"
|
|||
|
|
Header="元素Id"
|
|||
|
|
IsReadOnly="True" />
|
|||
|
|
<DataGridTextColumn
|
|||
|
|
Width="120"
|
|||
|
|
Binding="{Binding Element.Category.Name}"
|
|||
|
|
Header="族类别"
|
|||
|
|
IsReadOnly="True" />
|
|||
|
|
<DataGridTextColumn
|
|||
|
|
Width="120"
|
|||
|
|
Binding="{Binding Element, Converter={x:Static conv:ElementToElementTypeNameConverter.Instance}}"
|
|||
|
|
Header="族"
|
|||
|
|
IsReadOnly="True" />
|
|||
|
|
<DataGridTextColumn
|
|||
|
|
Width="*"
|
|||
|
|
Binding="{Binding Element.Name}"
|
|||
|
|
Header="实例"
|
|||
|
|
IsReadOnly="True" />
|
|||
|
|
<DataGridTemplateColumn Width="Auto" Header="操作">
|
|||
|
|
<DataGridTemplateColumn.CellTemplate>
|
|||
|
|
<DataTemplate>
|
|||
|
|
<!-- 按钮参数绑定到当前行的绑定的Item -->
|
|||
|
|
<Button
|
|||
|
|
HorizontalAlignment="Center"
|
|||
|
|
Command="{Binding DataContext.ShowElementCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
|
|||
|
|
CommandParameter="{Binding}"
|
|||
|
|
Content="定位构件" />
|
|||
|
|
</DataTemplate>
|
|||
|
|
</DataGridTemplateColumn.CellTemplate>
|
|||
|
|
</DataGridTemplateColumn>
|
|||
|
|
</DataGrid.Columns>
|
|||
|
|
</DataGrid>
|
|||
|
|
<UniformGrid
|
|||
|
|
Grid.Row="1"
|
|||
|
|
Margin="10"
|
|||
|
|
HorizontalAlignment="Right"
|
|||
|
|
Rows="1">
|
|||
|
|
<ComboBox
|
|||
|
|
Margin="5"
|
|||
|
|
md:HintAssist.HelperText="切换专业以获取标识"
|
|||
|
|
md:HintAssist.Hint="当前模型的专业"
|
|||
|
|
ItemsSource="{ex:EnumSource BindToDescription=True,
|
|||
|
|
EnumType={x:Type model:Major}}"
|
|||
|
|
SelectedValue="{Binding SelectedMajor}"
|
|||
|
|
Style="{StaticResource MaterialDesignOutlinedComboBox}"
|
|||
|
|
ToolTip="设置专业获取可选的标识">
|
|||
|
|
<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="PreviewTextInput">
|
|||
|
|
<b:InvokeCommandAction Command="{Binding PreviewTextInputCommand}" PassEventArgsToCommand="True" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
</b:Interaction.Triggers>
|
|||
|
|
</ComboBox>
|
|||
|
|
<ComboBox
|
|||
|
|
Margin="5"
|
|||
|
|
IsEditable="True"
|
|||
|
|
md:HintAssist.HelperText="输入关键字以检索标识"
|
|||
|
|
md:HintAssist.Hint="批处理的标识"
|
|||
|
|
SelectedItem="{Binding SelectedSign}"
|
|||
|
|
Style="{StaticResource MaterialDesignOutlinedComboBox}"
|
|||
|
|
ItemsSource="{Binding SignCollectionView}"
|
|||
|
|
Text="{Binding SignText, UpdateSourceTrigger=PropertyChanged}">
|
|||
|
|
<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="PreviewTextInput">
|
|||
|
|
<b:InvokeCommandAction Command="{Binding PreviewTextInputCommand}" PassEventArgsToCommand="True" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
</b:Interaction.Triggers>
|
|||
|
|
</ComboBox>
|
|||
|
|
<!--<ComboBox Width="120"
|
|||
|
|
Margin="5"
|
|||
|
|
IsEditable="True"
|
|||
|
|
ItemsSource="{Binding Signs}"
|
|||
|
|
md:HintAssist.Hint="修改标识"
|
|||
|
|
SelectedItem="{Binding SelectedSign}"
|
|||
|
|
Style="{StaticResource MaterialDesignOutlinedComboBox}">
|
|||
|
|
<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="PreviewTextInput">
|
|||
|
|
<b:InvokeCommandAction Command="{Binding PreviewTextInputCommand}" PassEventArgsToCommand="True" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
-->
|
|||
|
|
<!-- <b:EventTrigger EventName="DropDownOpened">
|
|||
|
|
<b:InvokeCommandAction Command="{Binding FilterItemsCommand}" CommandParameter="{Binding ElementName=cmbxPortList}"/>
|
|||
|
|
</b:EventTrigger>-->
|
|||
|
|
<!--
|
|||
|
|
</b:Interaction.Triggers>
|
|||
|
|
</ComboBox>-->
|
|||
|
|
<Button
|
|||
|
|
HorizontalAlignment="Center"
|
|||
|
|
Command="{Binding BatchModifySignsCommand}"
|
|||
|
|
CommandParameter="{Binding ElementName=DataGridElements, Path=SelectedItems}"
|
|||
|
|
Content="批量修改标识"
|
|||
|
|
ToolTip="批量修改已选中的元素标识" />
|
|||
|
|
</UniformGrid>
|
|||
|
|
<!-- <StackPanel>
|
|||
|
|
|
|||
|
|
<TreeView x:Name="ElemTreeView"
|
|||
|
|
MinWidth="200"
|
|||
|
|
ItemsSource="{Binding KeyValues}">
|
|||
|
|
<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="MouseDoubleClick">
|
|||
|
|
<b:InvokeCommandAction Command="{Binding LocationElementCommand}" CommandParameter="{Binding ElementName=ElemTreeView, Path=SelectedItem}" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
</b:Interaction.Triggers>
|
|||
|
|
<TreeView.ItemTemplate>
|
|||
|
|
<HierarchicalDataTemplate ItemsSource="{Binding Value}">
|
|||
|
|
<TextBlock Text="{Binding Key}" />
|
|||
|
|
<HierarchicalDataTemplate.ItemTemplate>
|
|||
|
|
<DataTemplate>
|
|||
|
|
<StackPanel Orientation="Horizontal">
|
|||
|
|
<TextBlock Text="{Binding Name}" />
|
|||
|
|
<TextBlock Text="-" />
|
|||
|
|
<TextBlock Text="{Binding Id}" />
|
|||
|
|
</StackPanel>
|
|||
|
|
</DataTemplate>
|
|||
|
|
</HierarchicalDataTemplate.ItemTemplate>
|
|||
|
|
</HierarchicalDataTemplate>
|
|||
|
|
</TreeView.ItemTemplate>
|
|||
|
|
</TreeView>
|
|||
|
|
</StackPanel>-->
|
|||
|
|
</Grid>
|
|||
|
|
</controls:MaterialWindow>
|