169 lines
9.1 KiB
Plaintext
169 lines
9.1 KiB
Plaintext
|
|
<controls:MaterialWindow
|
|||
|
|
x:Class="Szmedi.RevitToolkit.Approval.Views.ReviewMetroSignView"
|
|||
|
|
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:d="http://schemas.microsoft.com/expression/blend/2008"
|
|||
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|||
|
|
xmlns:viewmodels="clr-namespace:Szmedi.RevitToolkit.Approval.ViewModels"
|
|||
|
|
Title="轨道交通标识检查"
|
|||
|
|
Width="800"
|
|||
|
|
Height="600"
|
|||
|
|
d:DataContext="{d:DesignInstance Type=viewmodels:ReviewMetroSignViewModel}"
|
|||
|
|
Style="{DynamicResource SZMEDIWindowStyle}"
|
|||
|
|
mc:Ignorable="d">
|
|||
|
|
<controls:MaterialWindow.Resources>
|
|||
|
|
<ResourceDictionary Source="pack://application:,,,/Szmedi.RevitToolkit.Approval;component/SZMEDIResources.xaml" />
|
|||
|
|
</controls:MaterialWindow.Resources>
|
|||
|
|
<Grid>
|
|||
|
|
<DataGrid
|
|||
|
|
x:Name="ReviewDataGrid"
|
|||
|
|
Margin="5"
|
|||
|
|
AutoGenerateColumns="False"
|
|||
|
|
CanUserAddRows="False"
|
|||
|
|
EnableColumnVirtualization="True"
|
|||
|
|
EnableRowVirtualization="True"
|
|||
|
|
GridLinesVisibility="Horizontal"
|
|||
|
|
ItemsSource="{Binding Items}"
|
|||
|
|
VirtualizingPanel.IsVirtualizingWhenGrouping="True"
|
|||
|
|
VirtualizingStackPanel.IsVirtualizing="True"
|
|||
|
|
VirtualizingStackPanel.VirtualizationMode="Recycling">
|
|||
|
|
<!-- <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>-->
|
|||
|
|
<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>
|
|||
|
|
<!-- <DataGridTextColumn Width="Auto"
|
|||
|
|
Binding="{Binding Sign, UpdateSourceTrigger=LostFocus}"
|
|||
|
|
EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
|
|||
|
|
Header="标识" />-->
|
|||
|
|
<DataGridComboBoxColumn Width="*" Header="标识">
|
|||
|
|
<DataGridComboBoxColumn.EditingElementStyle>
|
|||
|
|
<Style BasedOn="{StaticResource MaterialDesignDataGridComboBox}" 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="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>
|
|||
|
|
<!-- <DataGridTemplateColumn>
|
|||
|
|
<DataGridTemplateColumn.CellTemplate>
|
|||
|
|
<DataTemplate>
|
|||
|
|
<ComboBox Width="Auto"
|
|||
|
|
ItemsSource="{Binding Signs, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
|||
|
|
SelectedItem="{Binding Sign}" />
|
|||
|
|
</DataTemplate>
|
|||
|
|
</DataGridTemplateColumn.CellTemplate>
|
|||
|
|
</DataGridTemplateColumn>-->
|
|||
|
|
<DataGridTextColumn
|
|||
|
|
Width="*"
|
|||
|
|
Binding="{Binding Element.Id}"
|
|||
|
|
Header="元素ID"
|
|||
|
|
IsReadOnly="True" />
|
|||
|
|
<DataGridTextColumn
|
|||
|
|
Width="*"
|
|||
|
|
Binding="{Binding Element.Category.Name}"
|
|||
|
|
Header="族类别"
|
|||
|
|
IsReadOnly="True" />
|
|||
|
|
<DataGridTextColumn
|
|||
|
|
Width="2*"
|
|||
|
|
Binding="{Binding Element.Name}"
|
|||
|
|
Header="实例"
|
|||
|
|
IsReadOnly="True" />
|
|||
|
|
<DataGridTemplateColumn Width="*" Header="操作">
|
|||
|
|
<DataGridTemplateColumn.CellTemplate>
|
|||
|
|
<DataTemplate>
|
|||
|
|
<!-- 按钮参数绑定到当前行的绑定的Item -->
|
|||
|
|
<Button
|
|||
|
|
Command="{Binding DataContext.ShowElementCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
|
|||
|
|
CommandParameter="{Binding}"
|
|||
|
|
Content="定位构件" />
|
|||
|
|
</DataTemplate>
|
|||
|
|
</DataGridTemplateColumn.CellTemplate>
|
|||
|
|
</DataGridTemplateColumn>
|
|||
|
|
</DataGrid.Columns>
|
|||
|
|
</DataGrid>
|
|||
|
|
<Button
|
|||
|
|
Margin="5"
|
|||
|
|
HorizontalAlignment="Right"
|
|||
|
|
VerticalAlignment="Bottom"
|
|||
|
|
Command="{Binding UpdateCodeCommand}"
|
|||
|
|
Content="刷新编码" />
|
|||
|
|
<!-- <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>
|