年度变更建库软件5.0版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

333 lines
22 KiB

6 months ago
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<SolidColorBrush x:Key="ItemMouseOverBackground" Color="AliceBlue"></SolidColorBrush>
<SolidColorBrush x:Key="ItemSelectedBackground" Color="#FFDEEFFD"></SolidColorBrush>
<Style x:Key="DefaultTreeViewItem" TargetType="{x:Type TreeViewItem}">
<Setter Property="MinHeight" Value="20" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Margin" Value="0" />
<Setter Property="IsExpanded" Value="True" />
<Setter Property="IsSelected" Value="{Binding IsChecked}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TreeViewItem}">
<StackPanel>
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"
MinHeight="{TemplateBinding MinHeight}" UseLayoutRounding="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<!--多层级间隔,暂缓-->
<!--<Grid Margin="{Binding Converter={StaticResource LengthConverter}, RelativeSource={x:Static RelativeSource.TemplatedParent}}"-->
<Grid Margin="{TemplateBinding Margin}" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="18" Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!--展开收缩按钮-->
<ToggleButton x:Name="ExpanderBtn"
IsChecked="{Binding Path=IsExpanded, RelativeSource={x:Static RelativeSource.TemplatedParent}, Mode=TwoWay}"
ClickMode="Press" >
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border>
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</ToggleButton.Template>
<ToggleButton.Content>
<!--<TextBlock x:Name="ExpanderIcon" Foreground="{TemplateBinding Foreground}" Text="&#xe62c;" />-->
<!--<Image x:Name="ExpanderIcon" Source="../Resources/UnExpanded.png" Width="14" Height="14"/>-->
<Image x:Name="ExpanderIcon" Source="/KUI;component/Resources/UnExpanded.png" Width="14" Height="14"/>
</ToggleButton.Content>
</ToggleButton>
<!--内容-->
<ContentPresenter x:Name="PART_Header" Grid.Column="1" ContentSource="Header"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
</Border>
<ItemsPresenter Margin="18,0,0,0" x:Name="ItemsHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="False">
<Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="IsExpanded" Value="True">
<!--<Setter TargetName="ExpanderIcon" Property="Source" Value="../Resources/Expanded.png" />-->
<Setter TargetName="ExpanderIcon" Property="Source" Value="/KUI;component/Resources/Expanded.png" />
</Trigger>
<Trigger Property="HasItems" Value="False">
<Setter TargetName="ExpanderIcon" Property="Visibility" Value="Hidden" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource ItemMouseOverBackground}" />
<!--<Setter Property="Foreground" Value="{StaticResource ItemMouseOverForeground}" />-->
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{StaticResource ItemSelectedBackground}" />
<!--<Setter Property="Foreground" Value="{StaticResource ItemSelectedForeground}" />-->
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True" />
<Condition Property="Selector.IsSelectionActive" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource ItemSelectedBackground}" />
<!--<Setter Property="Foreground" Value="{StaticResource ItemSelectedForeground}" />-->
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<!--<Setter Property="ContextMenu" Value="{StaticResource RouterMenu}" />-->
</Style>
<!--TreeView样式-->
<Style x:Key="DefaultTreeView" TargetType="{x:Type TreeView}">
<Setter Property="ScrollViewer.CanContentScroll" Value="True" />
<Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="True"></Setter>
<Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Recycling" />
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
<!--<Setter Property="Background" Value="{StaticResource ItemsContentBackground}"/>-->
<Setter Property="ItemContainerStyle" Value="{StaticResource DefaultTreeViewItem}"></Setter>
<Setter Property="BorderThickness" Value="0" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<VirtualizingStackPanel IsItemsHost="True" IsVirtualizing="True" VirtualizationMode="Recycling" Margin="0"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Expander样式-->
<Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
<Setter Property="Foreground" Value="Black"/>
<Setter Property="FontFamily" Value="宋体" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Background" Value="#ffffff"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Expander}">
<Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<ToggleButton x:Name="HeaderSite"
ContentTemplate="{TemplateBinding HeaderTemplate}"
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
Content="{TemplateBinding Header}"
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{DynamicResource ToggleButtonStyle}" />
<Border x:Name="ExpandSite" Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Visibility="Collapsed"
Canvas.Top="0" Canvas.Left="0"
Focusable="false"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="#ffffff" ScrollViewer.VerticalScrollBarVisibility="Hidden">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ContentPresenter Margin="30 0" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" />
</ScrollViewer>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ToggleButtonStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Height" Value="32" />
<Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="Black"/>
<Setter Property="FontSize" Value="12" />
<Setter Property="FontFamily" Value="宋体" />
<!--<Setter Property="FontWeight" Value="Bold" />-->
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Padding" Value="10 5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border BorderBrush="AliceBlue" BorderThickness="0,2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Canvas x:Name="canvNormal" Grid.Column="1" Visibility="Visible" Height="{TemplateBinding Height}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Canvas.Right="30">
<Rectangle Height="35" Fill="Red" Canvas.Right="30"/>
<Path Data="M 0 0 L 6 -6 12 0 " Stroke="#7D7D7D" StrokeThickness="2" Canvas.Right="35" Canvas.Top="18"/>
<!--<Rectangle Width="{TemplateBinding Width}" Height="1" Canvas.Bottom="0" Fill="#E3E3E3" />-->
</Canvas>
<Canvas x:Name="canvChecked" Grid.Column="1" Visibility="Hidden" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Canvas.Right="30">
<Path Data="M 0 0 L 6 6 12 0 " Stroke="#7D7D7D" StrokeThickness="2" Canvas.Right="35" Canvas.Top="18"/>
<Rectangle Width="{TemplateBinding Width}" Height="1" Canvas.Bottom="0" Fill="#E3E3E3" />
</Canvas>
<Image x:Name="imgIcon" Source="pack://siteoforigin:,,,/Images/拓扑检查.png" Width="18" HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<RotateTransform Angle="0"></RotateTransform>
</Image.RenderTransform>
</Image>
<ContentPresenter Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="AliceBlue"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Visibility" TargetName="canvChecked" Value="Visible" />
<Setter Property="Visibility" TargetName="canvNormal" Value="Hidden" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<DataTrigger Binding="{Binding CheckState}" Value="检查中">
<Setter TargetName="imgIcon" Property="Source" Value="pack://siteoforigin:,,,/Images/loading.png" />
<DataTrigger.EnterActions>
<StopStoryboard BeginStoryboardName="enterStory">
</StopStoryboard>
<BeginStoryboard x:Name="enterStory">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="imgIcon" Duration="0:0:0.7" To="360" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" RepeatBehavior="Forever"></DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<StopStoryboard BeginStoryboardName="enterStory">
</StopStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
<DataTrigger Binding="{Binding CheckState}" Value="检查完成">
<Setter TargetName="imgIcon" Property="Source" Value="pack://siteoforigin:,,,/Images/拓扑检查.png" />
<DataTrigger.ExitActions>
<StopStoryboard BeginStoryboardName="enterStory">
</StopStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Height" Value="30" />
<Setter Property="FontSize" Value="13" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="border" CornerRadius="0" Margin="2" BorderBrush="Black"
BorderThickness="0,0,0,0.2">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="10,0,0,0" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="white" />
<Setter TargetName="border" Property="Background" Value="#FF46679A" />
<Setter TargetName="border" Property="BorderBrush" Value="#FF46679A" />
<Setter TargetName="border" Property="BorderThickness" Value="4,0,0,0.5" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<MultiTrigger.Setters>
<Setter Property="Foreground" Value="#FF46679A" />
<Setter TargetName="border" Property="Background" Value="white" />
<Setter TargetName="border" Property="BorderBrush" Value="#FF46679A" />
<Setter TargetName="border" Property="BorderThickness" Value="0,0,0,0.2" />
</MultiTrigger.Setters>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<HierarchicalDataTemplate x:Key="ItemNode" ItemsSource="{Binding}">
<StackPanel Orientation="Horizontal" Height="28">
<Image Width="18" Source="{Binding Icon}" Height="18" Margin="2,0" />
<TextBlock Text="【" FontSize="13" VerticalAlignment="Center" Margin="3,0,0,0"></TextBlock>
<TextBlock Text="{Binding ErrorType}" FontSize="13" VerticalAlignment="Center" Margin="3,0,0,0"></TextBlock>
<TextBlock Text="】" FontSize="13" VerticalAlignment="Center" Margin="3,0,0,0"></TextBlock>
<TextBlock Text="{Binding ErrorDesc}" FontSize="13" VerticalAlignment="Center" Margin="3,0,0,0"></TextBlock>
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate x:Key="ItemNode2" ItemsSource="{Binding}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="240" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<CheckBox Content="{Binding DataFeaterinfor}" IsChecked="{Binding IsChecked,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" />
<!--<Button Grid.Column="1" VerticalAlignment="Center" Content="分割" BorderThickness="0" Background="Transparent">
<Button.Template>
<ControlTemplate TargetType="Button">
<Label Content="{TemplateBinding Content}" HorizontalContentAlignment="Center" Foreground="Blue"/>
</ControlTemplate>
</Button.Template>
</Button>-->
</Grid>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate x:Key="ItemNode3" ItemsSource="{Binding}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="240" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<CheckBox Content="{Binding GroupName}" IsChecked="{Binding IsChecked,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" />
<!--<Button Grid.Column="1" VerticalAlignment="Center" Content="分割" BorderThickness="0" Background="Transparent">
<Button.Template>
<ControlTemplate TargetType="Button">
<Label Content="{TemplateBinding Content}" HorizontalContentAlignment="Center" Foreground="Blue"/>
</ControlTemplate>
</Button.Template>
</Button>-->
</Grid>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate x:Key="TvItemNode" ItemsSource="{Binding}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Height="28">
<!--<Image Width="18" Source="{Binding Icon}" Height="18" Margin="8,0" />-->
<CheckBox Content="{Binding RuleName}" VerticalContentAlignment="Center" IsChecked="{Binding IsChecked,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" />
<!--<TextBlock Name="txtBox" Text="{Binding Name}" FontSize="13" VerticalAlignment="Center" Margin="3,0,0,0">
</TextBlock>-->
</StackPanel>
<!--<HierarchicalDataTemplate.Triggers>
<DataTrigger Binding="{Binding IsOpenEdit,Mode=TwoWay}" Value="true">
<Setter TargetName="txtBox" Property="Foreground" Value="Red" />
</DataTrigger>
</HierarchicalDataTemplate.Triggers>-->
</HierarchicalDataTemplate>
</ResourceDictionary>