整理代码
This commit is contained in:
149
ShrlAlgoToolkit.RevitAddins/RvMEP/HeadroomCheckView.xaml
Normal file
149
ShrlAlgoToolkit.RevitAddins/RvMEP/HeadroomCheckView.xaml
Normal file
@@ -0,0 +1,149 @@
|
||||
<ui:FluentWindowEx
|
||||
x:Class="ShrlAlgo.RvKits.RvMEP.HeadroomCheckView"
|
||||
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"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
Title="净空检查"
|
||||
Width="400"
|
||||
Height="800"
|
||||
d:DataContext="{d:DesignInstance local:HeadroomCheckViewModel}"
|
||||
mc:Ignorable="d">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary Source="pack://application:,,,/ShrlAlgoToolkit.RevitAddins;component/WPFUI.xaml" />
|
||||
</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" />
|
||||
<ui:StackPanel
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Margin="5"
|
||||
Spacing="5">
|
||||
<!--<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="排除高度低的管线(mm):" />-->
|
||||
<ui:TextBoxEx
|
||||
MinWidth="120"
|
||||
Header="排除高度低的管线:"
|
||||
HeaderPlacement="Left"
|
||||
Suffix="mm"
|
||||
Text="1000" />
|
||||
<!--<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="排除长度短的管线(mm):" />-->
|
||||
<ui:TextBoxEx
|
||||
MinWidth="120"
|
||||
Header="排除长度短的管线:"
|
||||
HeaderPlacement="Left"
|
||||
Suffix="mm"
|
||||
Text="500" />
|
||||
<!--<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="净高要求高度(mm):" />-->
|
||||
<ui:TextBoxEx
|
||||
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="生成三维房间实体" />
|
||||
</ui:StackPanel>
|
||||
</Grid>
|
||||
</ui:FluentWindowEx>
|
||||
Reference in New Issue
Block a user