131 lines
8.7 KiB
Plaintext
131 lines
8.7 KiB
Plaintext
|
|
<controls:MaterialWindow
|
||
|
|
x:Class="Szmedi.RvKits.ModelManager.LevelSeparateWin"
|
||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
|
xmlns:controls="clr-namespace:Szmedi.RvKits.Controls"
|
||
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
|
|
xmlns:local="clr-namespace:Szmedi.RvKits.ModelManager"
|
||
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
|
|
Title="{Binding ProjectName, StringFormat={}构件划分 - {0}}"
|
||
|
|
Width="500"
|
||
|
|
Height="400"
|
||
|
|
MinWidth="400"
|
||
|
|
MinHeight="400"
|
||
|
|
d:DataContext="{d:DesignInstance Type=local:LevelSeparateViewModel}"
|
||
|
|
SizeToContent="Height"
|
||
|
|
mc:Ignorable="d">
|
||
|
|
<controls:MaterialWindow.Resources>
|
||
|
|
<ResourceDictionary Source="pack://application:,,,/Szmedi.RvKits;component/WPFUI.xaml" />
|
||
|
|
</controls:MaterialWindow.Resources>
|
||
|
|
<Grid>
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="*" />
|
||
|
|
<RowDefinition Height="Auto" />
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
<DataGrid
|
||
|
|
x:Name="ItemsDG"
|
||
|
|
d:ItemsSource="{d:SampleData ItemCount=5}"
|
||
|
|
AutoGenerateColumns="False"
|
||
|
|
CanUserAddRows="False"
|
||
|
|
ItemsSource="{Binding Items}"
|
||
|
|
SelectionUnit="FullRow"
|
||
|
|
ToolTip="修改划分名称,会填写对应元素的所属楼层属性">
|
||
|
|
<DataGrid.Columns>
|
||
|
|
<DataGridCheckBoxColumn Binding="{Binding IsVisible, UpdateSourceTrigger=PropertyChanged}" EditingElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnEditingStyle}" ElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnStyle}">
|
||
|
|
<DataGridCheckBoxColumn.Header>
|
||
|
|
<CheckBox Content="可见性" IsChecked="{Binding DataContext.IsAllItemsSelected, RelativeSource={RelativeSource AncestorType=DataGrid}}" />
|
||
|
|
</DataGridCheckBoxColumn.Header>
|
||
|
|
<DataGridCheckBoxColumn.HeaderStyle>
|
||
|
|
<Style BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}" TargetType="{x:Type DataGridColumnHeader}">
|
||
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||
|
|
</Style>
|
||
|
|
</DataGridCheckBoxColumn.HeaderStyle>
|
||
|
|
</DataGridCheckBoxColumn>
|
||
|
|
<!--<DataGridCheckBoxColumn
|
||
|
|
Binding="{Binding IsVisible, UpdateSourceTrigger=PropertyChanged}"
|
||
|
|
EditingElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnEditingStyle}"
|
||
|
|
ElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnStyle}"
|
||
|
|
Header="可见性" />-->
|
||
|
|
<DataGridTextColumn Binding="{Binding LevelName}" EditingElementStyle="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}" Header="划分">
|
||
|
|
<DataGridTextColumn.HeaderStyle>
|
||
|
|
<Style BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}" TargetType="{x:Type DataGridColumnHeader}">
|
||
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||
|
|
</Style>
|
||
|
|
</DataGridTextColumn.HeaderStyle>
|
||
|
|
</DataGridTextColumn>
|
||
|
|
<DataGridTextColumn Binding="{Binding Elements.Count}" Header="构件数" IsReadOnly="True">
|
||
|
|
<DataGridTextColumn.HeaderStyle>
|
||
|
|
<Style BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}" TargetType="{x:Type DataGridColumnHeader}">
|
||
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||
|
|
</Style>
|
||
|
|
</DataGridTextColumn.HeaderStyle>
|
||
|
|
</DataGridTextColumn>
|
||
|
|
<DataGridTextColumn Header="颜色" IsReadOnly="True">
|
||
|
|
<DataGridTextColumn.CellStyle>
|
||
|
|
<Style TargetType="{x:Type DataGridCell}">
|
||
|
|
<Setter Property="Background" Value="{Binding DataContext.Color, Converter={StaticResource RGBToBrushConverter}, RelativeSource={RelativeSource Self}}" />
|
||
|
|
</Style>
|
||
|
|
</DataGridTextColumn.CellStyle>
|
||
|
|
<DataGridTextColumn.HeaderStyle>
|
||
|
|
<Style BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}" TargetType="{x:Type DataGridColumnHeader}">
|
||
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||
|
|
</Style>
|
||
|
|
</DataGridTextColumn.HeaderStyle>
|
||
|
|
</DataGridTextColumn>
|
||
|
|
<DataGridTemplateColumn Header="导出元素">
|
||
|
|
<DataGridTemplateColumn.HeaderStyle>
|
||
|
|
<Style BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}" TargetType="{x:Type DataGridColumnHeader}">
|
||
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||
|
|
</Style>
|
||
|
|
</DataGridTemplateColumn.HeaderStyle>
|
||
|
|
<DataGridTemplateColumn.CellTemplate>
|
||
|
|
<DataTemplate>
|
||
|
|
<Button
|
||
|
|
x:Name="导出当前选择"
|
||
|
|
Command="{Binding DataContext.ExportToCsvCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
|
||
|
|
CommandParameter="{Binding}"
|
||
|
|
Content="导出"
|
||
|
|
Style="{StaticResource MaterialDesignPaperDarkButton}"
|
||
|
|
ToolTip="导出当前选择的楼层行" />
|
||
|
|
</DataTemplate>
|
||
|
|
</DataGridTemplateColumn.CellTemplate>
|
||
|
|
</DataGridTemplateColumn>
|
||
|
|
</DataGrid.Columns>
|
||
|
|
<!--<ListBox.ItemTemplate>
|
||
|
|
<DataTemplate>
|
||
|
|
<UniformGrid Rows="1">
|
||
|
|
<CheckBox Content="{Binding LevelName}" IsChecked="{Binding IsVisible, UpdateSourceTrigger=PropertyChanged}" ToolTip="勾选以显示" />
|
||
|
|
<TextBlock VerticalAlignment="Center" Text="{Binding Count, StringFormat={}数量:{0}}" />
|
||
|
|
</UniformGrid>
|
||
|
|
</DataTemplate>
|
||
|
|
</ListBox.ItemTemplate>-->
|
||
|
|
</DataGrid>
|
||
|
|
<UniformGrid Grid.Row="1" Columns="3">
|
||
|
|
<CheckBox Content="是否填充颜色区分" IsChecked="{Binding ToFillColor, UpdateSourceTrigger=PropertyChanged}" ToolTip="读取现有划分及根据标高划分命令是否一次性进行颜色填充" />
|
||
|
|
<!--<CheckBox
|
||
|
|
x:Name="CBFillLevelName"
|
||
|
|
Content="是否填写楼层"
|
||
|
|
IsChecked="{Binding ToFillLevelName, UpdateSourceTrigger=PropertyChanged}"
|
||
|
|
ToolTip="根据楼层划分命令或直接修改表中的划分列,是否直接赋予构件标高信息" />-->
|
||
|
|
<Button Command="{Binding ReadCurrentModelCommand}" Content="读取现有划分" ToolTip="获取当前项目的元素,并按所属楼层划分,未填写或没有该属性归为未知楼层, 嵌套共享族、幕墙,会根据主体族,刷新嵌套族属性" />
|
||
|
|
<Button Command="{Binding GroupByLevelCommand}" Content="根据标高划分" ToolTip="根据标高,对所有构件进行默认划分,具有 所属楼层 属性的构件自动填写,没有的该属性则不填写, 获取未定义或无法填写所属楼层的的构件,请使用读取现有划分命令" />
|
||
|
|
<Button
|
||
|
|
Command="{Binding SelectElementsCommand}"
|
||
|
|
CommandParameter="{Binding SelectedItem, ElementName=ItemsDG}"
|
||
|
|
Content="选中划分元素"
|
||
|
|
ToolTip="选中某一行的划分后,进行元素选择" />
|
||
|
|
<Button
|
||
|
|
Command="{Binding SetColorOverrideCommand}"
|
||
|
|
CommandParameter="{Binding SelectedItem, ElementName=ItemsDG}"
|
||
|
|
Content="填充颜色"
|
||
|
|
ToolTip="对当前选中的行的元素进行颜色填充" />
|
||
|
|
<Button Command="{Binding ResetColorOverrideCommand}" Content="重置颜色" ToolTip="将所有已经着色的构件,恢复其默认外观" />
|
||
|
|
</UniformGrid>
|
||
|
|
</Grid>
|
||
|
|
</controls:MaterialWindow>
|