Files
RevitArchive/RevitKits/WBSCoder/ComponentCodeAddedCheckerPage.xaml

66 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

2026-02-23 14:58:05 +08:00
<Page
x:Class="Sai.Common.Shared.WBSCoder.ComponentCodeAddedCheckerPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Sai.Common.Shared.WBSCoder"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="ComponentCodeAddedCheckerPage"
d:DataContext="{d:DesignInstance Type=local:ComponentCodeAddedCheckerViewModel}"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Page.Resources>
<ResourceDictionary Source="/Sai.RvKits;component/Styles/WPFUI.xaml" />
</Page.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<DataGrid
Grid.Row="0"
Grid.ColumnSpan="2"
Margin="5"
d:ItemsSource="{d:SampleData}"
AutoGenerateColumns="False"
CanUserAddRows="False"
Cursor="Hand"
ItemsSource="{Binding ElementsWithErrorCode, Mode=TwoWay}">
<DataGrid.Columns>
<DataGridTextColumn
Binding="{Binding Category.Name}"
Header="类别名称"
IsReadOnly="True" />
<DataGridTextColumn
Binding="{Binding Name}"
Header="元素名"
IsReadOnly="True" />
<DataGridTextColumn
Binding="{Binding Id}"
Header="元素Id"
IsReadOnly="True" />
<DataGridTemplateColumn Header="操作">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<!-- 按钮参数绑定到当前行的绑定的Item -->
<Button
Command="{Binding DataContext.LocationElementCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
CommandParameter="{Binding}"
ToolTip="定位元素">
<materialDesign:PackIcon Kind="LocationEnter" />
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<Button
Grid.Row="1"
HorizontalAlignment="Right"
Command="{Binding CheckComponentsCommand}"
Content="校验构件"
Cursor="Hand" />
</Grid>
</Page>