Files
ShrlAlgoToolkit/ShrlAlgoToolkit.RevitAddins/RvMEP/HeadroomCheckView.xaml

149 lines
6.6 KiB
Plaintext
Raw Normal View History

<ui:FluentWindowEx
x:Class="ShrlAlgo.RvKits.RvMEP.HeadroomCheckView"
2024-09-22 11:05:41 +08:00
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ShrlAlgo.RvKits.RvMEP"
2024-09-22 11:05:41 +08:00
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
2024-09-22 11:05:41 +08:00
Title="净空检查"
Width="400"
Height="800"
d:DataContext="{d:DesignInstance local:HeadroomCheckViewModel}"
mc:Ignorable="d">
<Window.Resources>
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
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<DataGrid
Grid.Row="0"
Grid.Column="0"
Height="200"
Margin="5"
d:ItemsSource="{d:SampleData ItemCount=5}"
AutoGenerateColumns="False"
CanUserAddRows="False"
ItemsSource="{Binding Rooms}"
SelectionMode="Extended">
<DataGrid.Columns>
<DataGridCheckBoxColumn
Width="60"
Binding="{Binding IsSelected}"
ElementStyle="{StaticResource DataGridCheckBoxElementDefaultStyle}"
Header="选择" />
<DataGridTextColumn
Binding="{Binding Name}"
Header="房间名称"
IsReadOnly="True" />
<DataGridTemplateColumn Header="颜色" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border Background="{Binding Color, Converter={StaticResource Revit2MediaColorConverter}}" ToolTip="生成三维房间时的颜色" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" />
<DataGrid
Grid.Row="2"
Grid.Column="0"
Height="340"
Margin="5"
AutoGenerateColumns="False"
CanUserAddRows="False"
IsReadOnly="True"
ItemsSource="{Binding ErrorModels}"
ToolTip="双击行可快速定位">
<b:Interaction.Triggers>
<b:EventTrigger EventName="MouseDoubleClick">
<b:InvokeCommandAction Command="{Binding ShowElementCommand}" CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}, Mode=FindAncestor}}" />
</b:EventTrigger>
</b:Interaction.Triggers>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Element.Category.Name}" Header="类别名称" />
<DataGridTextColumn Binding="{Binding Element.Name}" Header="元素名称" />
<DataGridTextColumn Binding="{Binding Level.Name}" Header="主体" />
<DataGridTextColumn Binding="{Binding Element.Id}" Header="元素Id" />
<DataGridTextColumn Binding="{Binding ErrorMessage}" Header="错误信息" />
<DataGridTemplateColumn Header="操作">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<!-- 按钮参数绑定到当前行的绑定的Item -->
<Button
Command="{Binding DataContext.ShowElementCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}, Mode=FindAncestor}}"
CommandParameter="{Binding}"
Content="定位构件" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<!-- 树状结构,按楼层=>专业=>管线 -->
<GridSplitter Grid.Row="3" HorizontalAlignment="Stretch" />
2025-04-24 20:56:10 +08:00
<ui:StackPanel
2024-09-22 11:05:41 +08:00
Grid.Row="4"
Grid.Column="0"
Margin="5"
Spacing="5">
<!--<TextBlock
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="排除高度低的管线(mm)" />-->
<ui:TextBoxEx
2024-09-22 11:05:41 +08:00
MinWidth="120"
Header="排除高度低的管线:"
HeaderPlacement="Left"
Suffix="mm"
Text="1000" />
<!--<TextBlock
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="排除长度短的管线(mm)" />-->
<ui:TextBoxEx
2024-09-22 11:05:41 +08:00
MinWidth="120"
Header="排除长度短的管线:"
HeaderPlacement="Left"
Suffix="mm"
Text="500" />
<!--<TextBlock
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="净高要求高度(mm)" />-->
<ui:TextBoxEx
2024-09-22 11:05:41 +08:00
MinWidth="120"
Header="净高要求高度:"
HeaderPlacement="Left"
Suffix="mm"
Text="2600" />
<Button
HorizontalAlignment="Stretch"
Command="{Binding AnalysisHeadroomCommand}"
Content="净高分析"
ToolTip="得到净高分析的平面以及不满足净高要求的管线" />
<!--<Button
Command="{Binding FindOverCommand}"
Content="查询管线"
ToolTip="根据净高要求查询" />-->
<Button
HorizontalAlignment="Stretch"
Command="{Binding ResetRoomHeightCommand}"
Content="重设高度"
ToolTip="重新设置房间高度为4000mm避免影响平面查看" />
<Button
HorizontalAlignment="Stretch"
Command="{Binding GenerateRoom3DCommand}"
Content="房间实体"
ToolTip="生成三维房间实体" />
2025-04-24 20:56:10 +08:00
</ui:StackPanel>
2024-09-22 11:05:41 +08:00
</Grid>
</ui:FluentWindowEx>