96 lines
5.1 KiB
Plaintext
96 lines
5.1 KiB
Plaintext
|
|
<Window x:Class="Laservall.Solidworks.Windows.ColumnConfigWindow"
|
||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
|
xmlns:local="clr-namespace:Laservall.Solidworks.Windows"
|
||
|
|
Title="列配置" Height="520" Width="460"
|
||
|
|
WindowStartupLocation="CenterOwner"
|
||
|
|
ResizeMode="NoResize">
|
||
|
|
<Window.Resources>
|
||
|
|
<local:InverseBoolToVisibilityConverter x:Key="InverseBoolToVisConverter"/>
|
||
|
|
<Style x:Key="SectionLabel" TargetType="TextBlock">
|
||
|
|
<Setter Property="FontSize" Value="13"/>
|
||
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||
|
|
<Setter Property="Foreground" Value="#333"/>
|
||
|
|
<Setter Property="Margin" Value="0,0,0,6"/>
|
||
|
|
</Style>
|
||
|
|
</Window.Resources>
|
||
|
|
<Grid Margin="16">
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<TextBlock Grid.Row="0" Style="{StaticResource SectionLabel}" Text="选择要显示和导出的列:"/>
|
||
|
|
|
||
|
|
<Border Grid.Row="1" BorderBrush="#DCDCDC" BorderThickness="1" CornerRadius="4">
|
||
|
|
<DataGrid x:Name="ColumnsGrid"
|
||
|
|
AutoGenerateColumns="False"
|
||
|
|
CanUserAddRows="False"
|
||
|
|
CanUserDeleteRows="False"
|
||
|
|
CanUserReorderColumns="False"
|
||
|
|
CanUserSortColumns="False"
|
||
|
|
HeadersVisibility="Column"
|
||
|
|
GridLinesVisibility="Horizontal"
|
||
|
|
HorizontalGridLinesBrush="#F0F0F0"
|
||
|
|
RowHeaderWidth="0"
|
||
|
|
SelectionMode="Single"
|
||
|
|
BorderThickness="0"
|
||
|
|
FontSize="13"
|
||
|
|
RowHeight="32">
|
||
|
|
<DataGrid.ColumnHeaderStyle>
|
||
|
|
<Style TargetType="DataGridColumnHeader">
|
||
|
|
<Setter Property="Background" Value="#F5F5F5"/>
|
||
|
|
<Setter Property="Padding" Value="8,6"/>
|
||
|
|
<Setter Property="FontSize" Value="13"/>
|
||
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||
|
|
<Setter Property="BorderBrush" Value="#E0E0E0"/>
|
||
|
|
<Setter Property="BorderThickness" Value="0,0,0,1"/>
|
||
|
|
</Style>
|
||
|
|
</DataGrid.ColumnHeaderStyle>
|
||
|
|
<DataGrid.Columns>
|
||
|
|
<DataGridTextColumn Header="列名" Binding="{Binding Name}" Width="*" IsReadOnly="True"/>
|
||
|
|
<DataGridCheckBoxColumn Header="显示" Binding="{Binding IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="60"/>
|
||
|
|
<DataGridCheckBoxColumn Header="导出" Binding="{Binding IsExport, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="60"/>
|
||
|
|
<DataGridTemplateColumn Header="" Width="50">
|
||
|
|
<DataGridTemplateColumn.CellTemplate>
|
||
|
|
<DataTemplate>
|
||
|
|
<Button Content="删除" FontSize="11" Padding="4,1"
|
||
|
|
Click="DeleteColumn_Click"
|
||
|
|
Visibility="{Binding IsFixed, Converter={StaticResource InverseBoolToVisConverter}}"/>
|
||
|
|
</DataTemplate>
|
||
|
|
</DataGridTemplateColumn.CellTemplate>
|
||
|
|
</DataGridTemplateColumn>
|
||
|
|
</DataGrid.Columns>
|
||
|
|
</DataGrid>
|
||
|
|
</Border>
|
||
|
|
|
||
|
|
<Grid Grid.Row="2" Margin="0,12,0,0">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="*"/>
|
||
|
|
<ColumnDefinition Width="Auto"/>
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
<Grid Grid.Column="0">
|
||
|
|
<TextBox x:Name="NewPropKeyBox" FontSize="13" Padding="6,4"
|
||
|
|
VerticalContentAlignment="Center"
|
||
|
|
TextChanged="NewPropKeyBox_TextChanged"/>
|
||
|
|
<TextBlock x:Name="NewPropKeyPlaceholder" Text="输入自定义属性名称..."
|
||
|
|
FontSize="13" Foreground="#999" Padding="8,5"
|
||
|
|
VerticalAlignment="Center" IsHitTestVisible="False"/>
|
||
|
|
</Grid>
|
||
|
|
<Button Grid.Column="1" Content="添加属性" Margin="8,0,0,0" Padding="12,5"
|
||
|
|
FontSize="13" Click="AddCustomProp_Click"/>
|
||
|
|
</Grid>
|
||
|
|
|
||
|
|
<TextBlock Grid.Row="3" Margin="0,4,0,0" FontSize="11" Foreground="#888"
|
||
|
|
Text="添加的自定义属性将从零件配置的自定义属性中读取对应值"/>
|
||
|
|
|
||
|
|
<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,16,0,0">
|
||
|
|
<Button Content="确定" Width="80" Padding="0,6" FontSize="13" Click="OK_Click" IsDefault="True"/>
|
||
|
|
<Button Content="取消" Width="80" Padding="0,6" FontSize="13" Margin="8,0,0,0" Click="Cancel_Click" IsCancel="True"/>
|
||
|
|
</StackPanel>
|
||
|
|
</Grid>
|
||
|
|
</Window>
|