<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:ctrls="clr-namespace:XHandler.Controls"
|
xmlns:cls ="clr-namespace:XHandler.Class.DataEx"
|
>
|
|
<ItemsPanelTemplate x:Key="NormalItemsPanel" >
|
<WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
|
ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}"
|
ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}"
|
IsItemsHost="True"
|
HorizontalAlignment="Center"/>
|
</ItemsPanelTemplate>
|
|
<!--#region 耗材style-->
|
<Style x:Key="ConsumableListViewItemStyle" TargetType="{x:Type ListViewItem}">
|
<Setter Property="OverridesDefaultStyle" Value="True"/>
|
<Setter Property="Control.Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="ListViewItem">
|
<Grid>
|
<Border x:Name="bg" Background="Transparent" CornerRadius="5" BorderThickness="0" Margin="5"/>
|
<ContentPresenter Margin="7"
|
Content="{TemplateBinding ContentControl.Content}"
|
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
|
ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
|
HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
|
VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
|
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"
|
/>
|
<!--<Border x:Name="bg" Background="Transparent" CornerRadius="5" BorderThickness="0" Margin="5"/>-->
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsSelected" Value="True">
|
<Setter Property="Background" TargetName="bg" Value="{DynamicResource listSelectedBrush}"/>
|
</Trigger>
|
<Trigger Property="IsEnabled" Value="False">
|
<Setter Property="Foreground">
|
<Setter.Value>
|
<DynamicResource ResourceKey="{x:Static SystemColors.GrayTextBrushKey}" />
|
</Setter.Value>
|
</Setter>
|
</Trigger>
|
<MultiTrigger>
|
<MultiTrigger.Conditions>
|
<Condition Property="IsMouseOver" Value="true" />
|
<Condition Property="IsSelected" Value="false"/>
|
</MultiTrigger.Conditions>
|
<Setter Property="Background" TargetName="bg" Value="{DynamicResource lightBlueBrush}"/>
|
</MultiTrigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
<!--<EventSetter Event="PreviewMouseMove" Handler="ListViewItem_PreviewMouseMove"/>-->
|
</Style>
|
|
<DataTemplate x:Key="ConsumableListViewItemDataTemplate">
|
<Border Width="110" Height="100" >
|
<Grid Margin="2">
|
<Grid.RowDefinitions>
|
<RowDefinition Height="*"/>
|
<RowDefinition Height="30"/>
|
</Grid.RowDefinitions>
|
<!--<Image Grid.Row="0" Name="idImage" Source="{Binding method_ico, Converter={StaticResource cmdIconConvert}}" Stretch="Uniform" Height="32"/>-->
|
<ctrls:ControlLabware Grid.Row="0" LabwareWidth="90" LabwareHeight="50" LabwareRealLength="{Binding labware_length}" LabwareRealWidth="{Binding labware_width}"
|
LeftSideColor="{Binding labware_color_lside,Converter={StaticResource colorConvert}}"
|
FrontColor="{Binding labware_color_front,Converter={StaticResource colorConvert}}"
|
TopColor="{Binding labware_color_top,Converter={StaticResource colorConvert}}"
|
BorderColor="{Binding labware_color_line,Converter={StaticResource colorConvert}}"
|
labwareWellInfoList="{Binding labwareWellInfoList}"
|
|
Rows="{Binding number_row}" Columns="{Binding number_column}" WellColor="White" IsFill="true"
|
LabwareType="{Binding labware_type_id}" LabwareName="{Binding labware_name}" />
|
<Image Grid.Row="0" Name="idImage" Source="pack://application:,,,./Assets/Consumables/default.png" HorizontalAlignment="Left"
|
VerticalAlignment="Top" Width="32" Visibility="{Binding is_default_type, Converter={StaticResource intToVisibleConvert}}"/>
|
|
<TextBlock Grid.Row="1" x:Name="idText" Text="{Binding labware_name}" FontSize="14" Foreground="Black" TextTrimming="WordEllipsis"
|
VerticalAlignment="Center" Tag="{Binding labware_id}" HorizontalAlignment="Center" ToolTip="{Binding labware_name}"/>
|
</Grid>
|
</Border>
|
</DataTemplate>
|
|
<DataTemplate x:Key="ShelfListViewItemDataTemplate">
|
<Border Width="110" Height="100" >
|
<Grid Margin="2">
|
<Grid.RowDefinitions>
|
<RowDefinition Height="*"/>
|
<RowDefinition Height="30"/>
|
</Grid.RowDefinitions>
|
<ctrls:ShelfLabware Grid.Row="0" ShelfLength="{Binding labware_length}" ShelfWidth="{Binding labware_width}" ShelfTrash="False"/>
|
<Image Grid.Row="0" Name="idImage" Source="pack://application:,,,./Assets/Consumables/default.png" HorizontalAlignment="Left"
|
VerticalAlignment="Top" Width="32" Visibility="{Binding is_default_type, Converter={StaticResource intToVisibleConvert}}"/>
|
|
<TextBlock Grid.Row="1" x:Name="idText" Text="{Binding labware_name}" FontSize="14" Foreground="Black" TextTrimming="WordEllipsis"
|
VerticalAlignment="Center" Tag="{Binding labware_id}" HorizontalAlignment="Center" ToolTip="{Binding labware_name}"/>
|
</Grid>
|
</Border>
|
</DataTemplate>
|
<!--#endregion-->
|
|
<!--#region 运行TreeView Style-->
|
<Style x:Key="RunTreeViewItemStyle" TargetType="{x:Type TreeViewItem}">
|
<Setter Property="IsSelected" Value="{Binding isSelected, Mode=TwoWay}"/>
|
<Setter Property="IsExpanded" Value="True"/>
|
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
<Setter Property="Padding" Value="1,0,0,0"/>
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
<!--<Setter Property="Focusable" Value="False"/> 注释掉可操作-->
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="{x:Type TreeViewItem}">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition MinWidth="1" Width="auto"/>
|
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="Auto"/>
|
<RowDefinition/>
|
</Grid.RowDefinitions>
|
<ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed"/>
|
<Rectangle x:Name="Hd" Grid.Column="1" Fill="{DynamicResource blueBrush}" Opacity="0" Width="5"/>
|
<Border x:Name="Bd" Grid.Column="2" BorderThickness="0 0 0 2" Background="{Binding IsError, Converter={StaticResource methodBackgroundConvert}}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
<Border.BorderBrush>
|
<VisualBrush>
|
<VisualBrush.Visual>
|
<Rectangle StrokeDashArray="4 4" Stroke="LightGray" StrokeThickness="1"
|
Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
|
Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}"/>
|
</VisualBrush.Visual>
|
</VisualBrush>
|
</Border.BorderBrush>
|
|
<ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
</Border>
|
<ItemsPresenter x:Name="ItemsHost" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" />
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsExpanded" Value="false">
|
<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
|
</Trigger>
|
<Trigger Property="HasItems" Value="false">
|
<Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
|
</Trigger>
|
<Trigger Property="IsEnabled" Value="false">
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
</Trigger>
|
|
<DataTrigger Binding="{Binding isRun}" Value="true">
|
<Setter Property="Background" TargetName="Bd" Value="{Binding IsError, Converter={StaticResource methodRanBackgroundConvert}}"/>
|
</DataTrigger>
|
|
<Trigger Property="IsSelected" Value="true">
|
<Setter Property="Opacity" TargetName="Hd" Value="1"/>
|
<Setter Property="Background" TargetName="Bd" Value="{Binding IsError, Converter={StaticResource methodSelectedBackgroundConvert}}"/>
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
<Style.Triggers>
|
<Trigger Property="VirtualizingPanel.IsVirtualizing" Value="true">
|
<Setter Property="ItemsPanel">
|
<Setter.Value>
|
<ItemsPanelTemplate>
|
<VirtualizingStackPanel/>
|
</ItemsPanelTemplate>
|
</Setter.Value>
|
</Setter>
|
</Trigger>
|
</Style.Triggers>
|
</Style>
|
|
<HierarchicalDataTemplate x:Key="RunTreeviewTemplate" DataType="{x:Type cls:MethodExEx}" ItemsSource="{Binding Children}">
|
<Border Width="auto" Height="56" Margin="{Binding Level, Converter={StaticResource leverToThicknessConvert}}">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="50"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
<TextBlock Grid.Column="0" FontSize="14" Text="{Binding strIndex}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold"
|
Foreground="{Binding isEnabled, Converter={StaticResource enableToBrush}}" Margin="10 0"/>
|
<Image Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Stretch="Uniform" Height="32">
|
<Image.Source>
|
<MultiBinding Converter="{StaticResource workflowIconMultiConvert}">
|
<Binding Path="method_ico"/>
|
<Binding Path="isEnabled"/>
|
<Binding Path="method_group_id"/>
|
</MultiBinding>
|
</Image.Source>
|
</Image>
|
|
<TextBlock Grid.Column="2" FontSize="16" Text="{Binding method_name}" VerticalAlignment="Center"
|
Foreground="{Binding isEnabled, Converter={StaticResource enableToBrush}}"/>
|
<TextBlock Grid.Column="3" FontSize="14" Margin="20,0,0,0" HorizontalAlignment="Left" Text="{Binding method_Tipcontent}" VerticalAlignment="Center"
|
Foreground="{Binding isEnabled, Converter={StaticResource enableToBrush}}" TextWrapping="WrapWithOverflow"/>
|
</Grid>
|
</Border>
|
</HierarchicalDataTemplate>
|
<!--#endregion-->
|
</ResourceDictionary>
|