291 lines
14 KiB
XML
291 lines
14 KiB
XML
<UserControl
|
|
x:Class="SWS.Electrical.Views.DialogRefreshAnnotation"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:Custom="http://www.galasoft.ch/mvvmlight"
|
|
xmlns:CustomControl="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:local="clr-namespace:SWS.Electrical"
|
|
xmlns:local2="clr-namespace:SWS.Model;assembly=SWS.Model"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:prism="http://prismlibrary.com/"
|
|
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
|
Width="900"
|
|
Height="700"
|
|
Background="#2D3135"
|
|
mc:Ignorable="d">
|
|
<prism:Dialog.WindowStyle>
|
|
<Style TargetType="Window">
|
|
<Setter Property="Width" Value="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Width}" />
|
|
<Setter Property="Height" Value="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Height}" />
|
|
|
|
<Setter Property="WindowState" Value="Normal" />
|
|
<Setter Property="WindowStyle" Value="None" />
|
|
<Setter Property="ResizeMode" Value="NoResize" />
|
|
</Style>
|
|
</prism:Dialog.WindowStyle>
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<Style TargetType="DataGrid">
|
|
<Setter Property="RowHeaderWidth" Value="0" />
|
|
<Setter Property="AutoGenerateColumns" Value="False" />
|
|
<Setter Property="CanUserAddRows" Value="False" />
|
|
<Setter Property="CanUserResizeColumns" Value="False" />
|
|
<Setter Property="CanUserResizeRows" Value="False" />
|
|
<Setter Property="HorizontalGridLinesBrush" Value="LightGray" />
|
|
<Setter Property="VerticalGridLinesBrush" Value="LightGray" />
|
|
<Setter Property="IsReadOnly" Value="False" />
|
|
<Setter Property="BorderThickness" Value="1,0" />
|
|
<Setter Property="BorderBrush" Value="LightGray" />
|
|
<Setter Property="RowHeight" Value="30" />
|
|
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
|
</Style>
|
|
|
|
<!-- DataGrid表头样式 -->
|
|
<Style TargetType="DataGridColumnHeader">
|
|
<Setter Property="FontSize" Value="13" />
|
|
<Setter Property="Background" Value="White" />
|
|
<Setter Property="BorderThickness" Value="1,1,1,1" />
|
|
<Setter Property="BorderBrush" Value="LightGray" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
</Style>
|
|
|
|
<!-- DataGrid复选框样式 -->
|
|
<Style x:Key="VerticalCheckBox" TargetType="CheckBox">
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="FontSize" Value="16" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type CheckBox}">
|
|
<StackPanel Name="sp" HorizontalAlignment="Center">
|
|
<ContentPresenter Margin="2" HorizontalAlignment="Center" />
|
|
<Border
|
|
x:Name="bd"
|
|
Width="20"
|
|
Height="20"
|
|
BorderBrush="Gray"
|
|
BorderThickness="1.5">
|
|
<Border.Background>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
|
<GradientStop Offset="0.05" Color="LightGray" />
|
|
<GradientStop Offset="1" Color="White" />
|
|
</LinearGradientBrush>
|
|
</Border.Background>
|
|
<Path
|
|
Name="checkPath"
|
|
Width="18"
|
|
Height="16"
|
|
Stroke="Black"
|
|
StrokeThickness="2" />
|
|
</Border>
|
|
</StackPanel>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter TargetName="checkPath" Property="Data" Value="M 1.5,5 L 7,13 17,0" />
|
|
</Trigger>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="bd" Property="Background" Value="LightGray" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- DataGrid单元格选中样式 #6495ED -->
|
|
<Style TargetType="DataGridCell">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="#6495ED" />
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
<telerik:RadBusyIndicator BusyContent="{Binding BusyContent}" IsBusy="{Binding IsBusy}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="70" />
|
|
<RowDefinition Height="300" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<CustomControl:customWindowTitleBar x:Name="titleBar" Grid.Row="0" />
|
|
|
|
<StackPanel
|
|
Grid.Row="1"
|
|
Height="30"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Width="150"
|
|
Margin="60,0,0,0"
|
|
HorizontalAlignment="Center"
|
|
Command="{Binding Command_GetAttribute}"
|
|
Content="获取元件属性值"
|
|
FontSize="16"
|
|
IsEnabled="{Binding IsEnableGetAttribute}" />
|
|
<Button
|
|
Width="140"
|
|
Margin="40,0,0,0"
|
|
HorizontalAlignment="Center"
|
|
Command="{Binding Command_RefreshAnnotation}"
|
|
Content="刷新标注"
|
|
FontSize="16"
|
|
IsEnabled="{Binding IsEnableRefreshAnnotation}" />
|
|
</StackPanel>
|
|
<TabControl Grid.Row="2" Height="auto">
|
|
<TabItem Header="{Binding NormalTagCount}">
|
|
<DataGrid
|
|
x:Name="dgTag"
|
|
Height="auto"
|
|
AutoGenerateColumns="False"
|
|
CanUserAddRows="False"
|
|
CanUserResizeColumns="True"
|
|
HeadersVisibility="Column"
|
|
ItemsSource="{Binding listAnnotation, Mode=TwoWay}"
|
|
RowHeight="22"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
SelectionMode="Single">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn
|
|
Width="auto"
|
|
Binding="{Binding ObjectTypeName}"
|
|
Header="元件类型"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="auto"
|
|
Binding="{Binding TagNumber}"
|
|
Header="元件位号"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="80"
|
|
Binding="{Binding TagHandid}"
|
|
Header="元件句柄"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="150"
|
|
Binding="{Binding AttributeName}"
|
|
Header="属性名"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding AttributeValue}"
|
|
Header="属性值"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="80"
|
|
Binding="{Binding AnnotationHandid}"
|
|
Header="标注句柄"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding AnnotationValue}"
|
|
Header="图纸标注值"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="100"
|
|
Binding="{Binding Status}"
|
|
Header="状态"
|
|
IsReadOnly="True" />
|
|
</DataGrid.Columns>
|
|
<DataGrid.RowStyle>
|
|
<Style TargetType="DataGridRow">
|
|
<Setter Property="Background" Value="White" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Status}" Value="已刷新">
|
|
<Setter Property="Background" Value="LightGreen" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Status}" Value="无需刷新">
|
|
<Setter Property="Background" Value="LightGreen" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</DataGrid.RowStyle>
|
|
</DataGrid>
|
|
</TabItem>
|
|
<TabItem Header="{Binding ErrTagCount}">
|
|
<DataGrid
|
|
Height="auto"
|
|
AutoGenerateColumns="False"
|
|
CanUserAddRows="False"
|
|
CanUserResizeColumns="True"
|
|
HeadersVisibility="Column"
|
|
ItemsSource="{Binding listErrAnnotation, Mode=TwoWay}"
|
|
RowHeight="22"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
SelectionMode="Single">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn
|
|
Width="auto"
|
|
Binding="{Binding ObjectTypeName}"
|
|
Header="元件类型"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="auto"
|
|
Binding="{Binding TagNumber}"
|
|
Header="元件位号"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="80"
|
|
Binding="{Binding TagHandid}"
|
|
Header="元件句柄"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="150"
|
|
Binding="{Binding AttributeName}"
|
|
Header="属性名"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding AttributeValue}"
|
|
Header="属性值"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="80"
|
|
Binding="{Binding AnnotationHandid}"
|
|
Header="标注句柄"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="*"
|
|
Binding="{Binding AnnotationValue}"
|
|
Header="图纸标注值"
|
|
IsReadOnly="True" />
|
|
<DataGridTextColumn
|
|
Width="100"
|
|
Binding="{Binding Status}"
|
|
Header="状态"
|
|
IsReadOnly="True" />
|
|
</DataGrid.Columns>
|
|
<DataGrid.RowStyle>
|
|
<Style TargetType="DataGridRow">
|
|
<Setter Property="Background" Value="White" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Status}" Value="已刷新">
|
|
<Setter Property="Background" Value="LightGreen" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</DataGrid.RowStyle>
|
|
</DataGrid>
|
|
</TabItem>
|
|
</TabControl>
|
|
<ListBox
|
|
Grid.Row="3"
|
|
Background="Black"
|
|
ItemsSource="{Binding listMsg}"
|
|
ScrollViewer.VerticalScrollBarVisibility="Visible">
|
|
<i:Interaction.Behaviors>
|
|
<local:ListBoxScrollToBottomBehavior />
|
|
</i:Interaction.Behaviors>
|
|
</ListBox>
|
|
</Grid>
|
|
</telerik:RadBusyIndicator>
|
|
</UserControl>
|