cba5ce17b2
- Aggiunti bottoni simula e lavora. - Aggiunto materiale gestito dal file ini.
573 lines
34 KiB
XML
573 lines
34 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
|
|
x:Class="OmagCUTDictionary">
|
|
|
|
<!-- ** COLORI ** -->
|
|
|
|
<!-- ** TAB CONTROL ** -->
|
|
<!-- ** Tab Item ** -->
|
|
<SolidColorBrush x:Key="TabItemBorderColor_Unselected" Color="Gray" />
|
|
<SolidColorBrush x:Key="TabItemBackground_Unselected" Color="Gray" />
|
|
<SolidColorBrush x:Key="TabItemTextColor_Unselected" Color="White" />
|
|
<SolidColorBrush x:Key="TabItemBorderColor_Selected" Color="DarkGray" />
|
|
<SolidColorBrush x:Key="TabItemBackground_Selected" Color="LightGray" />
|
|
<SolidColorBrush x:Key="TabItemTextColor_Selected" Color="Black" />
|
|
<!-- ** Tab Page ** -->
|
|
<SolidColorBrush x:Key="TabControlBackgroundColor" Color="Gray" />
|
|
<SolidColorBrush x:Key="TabPageBorderColor" Color="DarkGray" />
|
|
<SolidColorBrush x:Key="TabPageBorderColor_Shadow" Color="LightGray" />
|
|
<SolidColorBrush x:Key="TabPageColor" Color="#FFE5E5E5" />
|
|
|
|
<!-- ** BUTTON ** -->
|
|
<SolidColorBrush x:Key="ButtonBorderColor_Unselected" Color="DarkGray" />
|
|
<SolidColorBrush x:Key="ButtonBackGroundColor_Unselected" Color="LightGray" />
|
|
<SolidColorBrush x:Key="ButtonTextColor_Unselected" Color="Black" />
|
|
<SolidColorBrush x:Key="ButtonBorderColor_Selected" Color="LightGray" />
|
|
<SolidColorBrush x:Key="ButtonBackGroundColor_Selected" Color="LightGray" />
|
|
<SolidColorBrush x:Key="ButtonTextColor_Selected" Color="White" />
|
|
|
|
<!-- ** TOGGLEBUTTON ** -->
|
|
<SolidColorBrush x:Key="ToggleButtonBorderColor_Pressed" Color="Gray" />
|
|
<SolidColorBrush x:Key="ToggleButtonBackGroundColor_Pressed" Color="Gold" />
|
|
|
|
<!-- *************************************************************************** -->
|
|
|
|
<!-- ** PARAMETRI VARI (dimensioni, ecc...) ** -->
|
|
|
|
<!-- ** TAB CONTROL ** -->
|
|
|
|
<!-- ** Tab Header ** -->
|
|
|
|
<sys:Double x:Key="TabHeaderWidth">250</sys:Double>
|
|
<sys:Double x:Key="TabHeaderHeight">75</sys:Double>
|
|
<GridLength x:Key="TabHeaderImageColumnWidth">1.3*</GridLength>
|
|
<GridLength x:Key="TabHeaderTextBlockColumnWidth">3*</GridLength>
|
|
|
|
<!-- ** Tab Page ** -->
|
|
|
|
<GridLength x:Key="TabPageColumn0Width">11*</GridLength>
|
|
<GridLength x:Key="TabPageColumn1Width">1*</GridLength>
|
|
<GridLength x:Key="TabPageColumn2Width">0</GridLength>
|
|
<GridLength x:Key="TabPageRow0Width">1*</GridLength>
|
|
<GridLength x:Key="TabPageRow1Width">8*</GridLength>
|
|
<GridLength x:Key="TabPageRow2Width">1*</GridLength>
|
|
|
|
<!-- *************************************************************************** -->
|
|
|
|
<!-- ** STYLES ** -->
|
|
|
|
<!-- ** TAB CONTROL ** -->
|
|
|
|
<Style TargetType="{x:Type TabControl}">
|
|
<Setter Property="SnapsToDevicePixels" Value="true"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="TabControl">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<!--
|
|
The Border around each TabItem will allow us to draw the line
|
|
between the TabItemPanel and the TabControl (resp. the
|
|
TabPage-container) when a TabItem is NOT selected, which
|
|
replaces the bottom line of the TabItemPanel's border.
|
|
Thus, we'll avoid drawing the bottom line for the selected
|
|
TabItem. Also, since the TabItem, when selected, applies a left
|
|
Margin of 4px, we need to add these here as Padding.
|
|
-->
|
|
|
|
<Border Background="{StaticResource TabControlBackgroundColor}"
|
|
Padding="5,10,0,5">
|
|
<!-- This is the area in which TabItems (the strips) will be drawn. -->
|
|
<TabPanel IsItemsHost="True"/>
|
|
</Border>
|
|
<!--
|
|
This is the outer border of the TabControl itself, actually meaning
|
|
the Panel that will host a TabItem's content.
|
|
The top-border here will not be drawn as, otherwise, the TabItemPanel
|
|
would always show a thin line for the selected Tab (which we want
|
|
to avoid).
|
|
-->
|
|
|
|
<Border BorderThickness="0"
|
|
Grid.Column="1"
|
|
Background="{StaticResource TabControlBackgroundColor}" >
|
|
<!-- This is the first/outer Border drawn on the TabPage -->
|
|
<Border BorderThickness="2"
|
|
BorderBrush="{StaticResource TabPageBorderColor}"
|
|
CornerRadius="5"
|
|
Margin="0,3,3,3">
|
|
<!--
|
|
This is the second/inner Border drawn on the TabPage.
|
|
This Border is drawn with a horizontal Gradient that is transparent
|
|
on the left which produces the fading effect.
|
|
-->
|
|
<Border BorderThickness="2"
|
|
BorderBrush="{StaticResource TabPageBorderColor_Shadow}"
|
|
Background="{StaticResource TabPageColor}"
|
|
CornerRadius="3"
|
|
Margin="0"
|
|
Padding="2"
|
|
>
|
|
<!--
|
|
This is where the Content of the selected TabPage
|
|
will be rendered.
|
|
-->
|
|
<ContentPresenter ContentSource="SelectedContent" Margin="0"/>
|
|
</Border>
|
|
</Border>
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- ** Tab Item ** -->
|
|
|
|
<Style TargetType="{x:Type TabItem}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type TabItem}">
|
|
<!-- The Grid helps defining the general dimension of TabItems. -->
|
|
<Grid Width="{StaticResource TabHeaderWidth}" Height="{StaticResource TabHeaderHeight}" Margin="0,0,0,0">
|
|
<Border Name="Border"
|
|
BorderBrush="Black"
|
|
BorderThickness="2,2,0,2"
|
|
CornerRadius="4,0,0,4">
|
|
<Border.Effect>
|
|
<DropShadowEffect ShadowDepth="0" BlurRadius="10"/>
|
|
</Border.Effect>
|
|
<ContentPresenter x:Name="ContentSite"
|
|
VerticalAlignment="Stretch"
|
|
HorizontalAlignment="Stretch"
|
|
ContentSource="Header"
|
|
Margin="0"
|
|
RecognizesAccessKey="True"/>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<ControlTemplate.Triggers>
|
|
<!--The appearance of a TabItem when it's inactive/unselected-->
|
|
<Trigger Property="IsSelected" Value="False">
|
|
<Setter Property="Panel.ZIndex" Value="90" />
|
|
<Setter TargetName="Border" Property="BorderBrush"
|
|
Value="Transparent" />
|
|
<Setter Property="Foreground"
|
|
Value="{StaticResource TabItemTextColor_Unselected}" />
|
|
<Setter Property="Effect" TargetName="Border" >
|
|
<Setter.Value>
|
|
<DropShadowEffect ShadowDepth="0" BlurRadius="0" />
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
|
|
<!--The appearance of a TabItem when it's active/selected-->
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<!--We want the selected TabItem to always be on top.-->
|
|
<Setter Property="Panel.ZIndex" Value="100" />
|
|
<Setter TargetName="Border" Property="BorderBrush"
|
|
Value="{StaticResource TabItemBorderColor_Selected}" />
|
|
<Setter TargetName="Border" Property="Background"
|
|
Value="{StaticResource TabItemBackground_Selected}" />
|
|
|
|
<Setter Property="Foreground"
|
|
Value="{StaticResource TabItemTextColor_Selected}"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- Tab Header Image Style -->
|
|
<Style TargetType="Image" x:Key="TabHeaderImage">
|
|
<Setter Property="Stretch" Value="Uniform"/>
|
|
<Setter Property="Grid.Column" Value="0"/>
|
|
</Style>
|
|
|
|
<!-- Tab Header TextBlock Style -->
|
|
<Style TargetType="TextBlock" x:Key="TabHeaderTextBlock">
|
|
<Setter Property="FontSize" Value="25"/>
|
|
<Setter Property="Grid.Column" Value="1"/>
|
|
<Setter Property="Padding" Value="0,17,0,0"/>
|
|
</Style>
|
|
|
|
<!-- *************************************************************************** -->
|
|
|
|
<!-- ** BUTTON ** -->
|
|
|
|
<Style TargetType="Button">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border Name="Border"
|
|
CornerRadius="5"
|
|
Background="{StaticResource ButtonBackGroundColor_Unselected}"
|
|
BorderThickness="2"
|
|
BorderBrush="{StaticResource ButtonBorderColor_Unselected}"
|
|
Margin="2">
|
|
<Border.Effect>
|
|
<DropShadowEffect ShadowDepth="0" BlurRadius="10"/>
|
|
</Border.Effect>
|
|
<ContentPresenter HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
</ContentPresenter>
|
|
</Border>
|
|
|
|
<ControlTemplate.Triggers>
|
|
<!--The appearance of a Button when it's pressed-->
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter Property="Panel.ZIndex" Value="90" />
|
|
<Setter TargetName="Border" Property="BorderBrush"
|
|
Value="Transparent" />
|
|
<Setter TargetName="Border" Property="Background"
|
|
Value="Transparent" />
|
|
<Setter Property="Foreground"
|
|
Value="{StaticResource ButtonTextColor_Selected}" />
|
|
<Setter Property="Effect" TargetName="Border" >
|
|
<Setter.Value>
|
|
<DropShadowEffect ShadowDepth="0" BlurRadius="0" />
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
|
|
<!--The appearance of a Button when it's not pressed-->
|
|
<Trigger Property="IsPressed" Value="False">
|
|
<Setter Property="Foreground"
|
|
Value="{StaticResource ButtonTextColor_Unselected}"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- Button Image Style -->
|
|
<Style TargetType="Image" x:Key="ButtonImage">
|
|
<Setter Property="Stretch" Value="UniformToFill"/>
|
|
<Setter Property="Width" Value="35"/>
|
|
<Setter Property="Height" Value="35"/>
|
|
</Style>
|
|
|
|
<!-- Button TextBlock Style -->
|
|
<Style TargetType="TextBlock" x:Key="ButtonTextBlock">
|
|
<Setter Property="FontSize" Value="12"/>
|
|
<!--<Setter Property="Padding" Value="0,17,0,0"/>-->
|
|
<Setter Property="TextAlignment" Value="Center"/>
|
|
</Style>
|
|
|
|
<!-- *************************************************************************** -->
|
|
|
|
<!-- ** TOGGLEBUTTON ** -->
|
|
|
|
<Style TargetType="ToggleButton">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
<Border Name="Border"
|
|
CornerRadius="5"
|
|
Background="{StaticResource ButtonBackGroundColor_Unselected}"
|
|
BorderThickness="2"
|
|
BorderBrush="{StaticResource ButtonBorderColor_Unselected}"
|
|
Margin="2">
|
|
<Border.Effect>
|
|
<DropShadowEffect ShadowDepth="0" BlurRadius="10"/>
|
|
</Border.Effect>
|
|
<ContentPresenter HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
</ContentPresenter>
|
|
</Border>
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
<!--The appearance of a Button when it's checked-->
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter Property="Panel.ZIndex" Value="90" />
|
|
<Setter TargetName="Border" Property="BorderBrush"
|
|
Value="{StaticResource ToggleButtonBorderColor_Pressed}" />
|
|
<Setter TargetName="Border" Property="Background"
|
|
Value="{StaticResource ToggleButtonBackGroundColor_Pressed}" />
|
|
</Trigger>
|
|
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- *************************************************************************** -->
|
|
|
|
<!-- ** BORDER ** -->
|
|
|
|
<Style TargetType="Border" x:Key="CustomBorder">
|
|
<Setter Property="CornerRadius" Value="4"/>
|
|
<Setter Property="Background" Value="LightGray"/>
|
|
<Setter Property="BorderThickness" Value="2"/>
|
|
<Setter Property="BorderBrush" Value="DarkGray"/>
|
|
<Setter Property="Margin" Value="2" />
|
|
<Setter Property="Effect">
|
|
<Setter.Value>
|
|
<DropShadowEffect ShadowDepth="0" BlurRadius="10"/>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- *************************************************************************** -->
|
|
|
|
<!-- ** TEXTBOX ** -->
|
|
|
|
<Style TargetType="{x:Type TextBox}" x:Key="NumericKeyboard">
|
|
<Setter Property="IsReadOnly" Value="True"/>
|
|
<EventSetter Event="PreviewMouseDown" Handler="PreviewMouseDown"/>
|
|
<EventSetter Event="TextChanged" Handler="TextChanged" />
|
|
</Style>
|
|
|
|
<!-- *************************************************************************** -->
|
|
|
|
<!-- ** LISTBOX ** -->
|
|
|
|
<DataTemplate x:Key="DataTemplateItem">
|
|
<Grid >
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="1*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />
|
|
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" VerticalAlignment="Center" />
|
|
|
|
</Grid>
|
|
</DataTemplate>
|
|
|
|
<!-- *************************************************************************** -->
|
|
|
|
<!-- ** COMBOBOX ** -->
|
|
|
|
<Style x:Key="ComboBoxFocusVisual">
|
|
<Setter Property="Control.Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Rectangle StrokeDashArray="1 2" StrokeThickness="1" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" Margin="4,4,21,4"/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
|
|
<GradientStop Color="#F3F3F3" Offset="0"/>
|
|
<GradientStop Color="#EBEBEB" Offset="0.5"/>
|
|
<GradientStop Color="#DDDDDD" Offset="0.5"/>
|
|
<GradientStop Color="#CDCDCD" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
|
|
<Geometry x:Key="DownArrowGeometry">M 0 0 L 3.5 4 L 7 0 Z</Geometry>
|
|
<Style x:Key="ComboBoxReadonlyToggleButton" TargetType="ToggleButton">
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
|
<Setter Property="IsTabStop" Value="false"/>
|
|
<Setter Property="Focusable" Value="false"/>
|
|
<Setter Property="ClickMode" Value="Press"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
<Border Name="Border"
|
|
CornerRadius="5"
|
|
Background="{StaticResource ButtonBackGroundColor_Unselected}"
|
|
BorderThickness="2"
|
|
BorderBrush="{StaticResource ButtonBorderColor_Unselected}"
|
|
Margin="2" >
|
|
<Border.Effect>
|
|
<DropShadowEffect ShadowDepth="0" BlurRadius="10"/>
|
|
</Border.Effect>
|
|
<ContentPresenter HorizontalAlignment="Center"
|
|
VerticalAlignment="Center" >
|
|
</ContentPresenter>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsChecked" Value="true">
|
|
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ButtonBorderColor_Unselected}"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="BorderBrush" TargetName="Border" Value="#AFAFAF"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
|
|
<GradientStop Color="#ABADB3" Offset="0.05"/>
|
|
<GradientStop Color="#E2E3EA" Offset="0.07"/>
|
|
<GradientStop Color="#E3E9EF" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
|
<Setter Property="AllowDrop" Value="true"/>
|
|
<Setter Property="MinWidth" Value="0"/>
|
|
<Setter Property="MinHeight" Value="0"/>
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
|
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type TextBox}">
|
|
<ScrollViewer x:Name="PART_ContentHost" Background="Transparent" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
|
<Setter Property="IsTabStop" Value="false"/>
|
|
<Setter Property="Focusable" Value="false"/>
|
|
<Setter Property="ClickMode" Value="Press"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
<Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RoundCorners="false" SnapsToDevicePixels="true" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
|
|
<Path x:Name="Arrow" Data="{StaticResource DownArrowGeometry}" Fill="Black" HorizontalAlignment="Center" Margin="0,1,0,0" VerticalAlignment="Center"/>
|
|
</Themes:ButtonChrome>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsChecked" Value="true">
|
|
<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
|
|
<Grid x:Name="Placement" SnapsToDevicePixels="true">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
|
<Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=Placement}">
|
|
<Border x:Name="DropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
|
|
<ScrollViewer x:Name="DropDownScrollViewer">
|
|
<Grid RenderOptions.ClearTypeHint="Enabled">
|
|
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
|
<Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/>
|
|
</Canvas>
|
|
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
|
</Grid>
|
|
</ScrollViewer>
|
|
</Border>
|
|
</Themes:SystemDropShadowChrome>
|
|
</Popup>
|
|
<Themes:ListBoxChrome x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}"/>
|
|
<TextBox x:Name="PART_EditableTextBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}" Style="{StaticResource ComboBoxEditableTextBox}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
<ToggleButton Grid.Column="1" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsKeyboardFocusWithin" Value="true">
|
|
<Setter Property="Foreground" Value="Black"/>
|
|
</Trigger>
|
|
<Trigger Property="IsDropDownOpen" Value="true">
|
|
<Setter Property="RenderFocused" TargetName="Border" Value="true"/>
|
|
</Trigger>
|
|
<Trigger Property="HasItems" Value="false">
|
|
<Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
|
<Setter Property="Background" Value="#FFF4F4F4"/>
|
|
</Trigger>
|
|
<Trigger Property="IsGrouping" Value="true">
|
|
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
|
</Trigger>
|
|
<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
|
|
<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
|
|
<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
|
|
</Trigger>
|
|
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
|
|
<Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
|
|
<Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
<Style TargetType="{x:Type ComboBox}">
|
|
<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
|
|
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
|
|
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
|
<Setter Property="Padding" Value="4,3"/>
|
|
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
|
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ComboBox}">
|
|
<Grid x:Name="MainGrid" SnapsToDevicePixels="true">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
|
<Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=MainGrid}">
|
|
<Border x:Name="DropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
|
|
<ScrollViewer x:Name="DropDownScrollViewer">
|
|
<Grid RenderOptions.ClearTypeHint="Enabled">
|
|
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
|
<Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/>
|
|
</Canvas>
|
|
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
|
</Grid>
|
|
</ScrollViewer>
|
|
</Border>
|
|
</Themes:SystemDropShadowChrome>
|
|
</Popup>
|
|
<ToggleButton BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxReadonlyToggleButton}"/>
|
|
<ContentPresenter ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
|
|
<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
|
|
<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
|
|
</Trigger>
|
|
<Trigger Property="HasItems" Value="false">
|
|
<Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
|
<Setter Property="Background" Value="#FFF4F4F4"/>
|
|
</Trigger>
|
|
<Trigger Property="IsGrouping" Value="true">
|
|
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
|
</Trigger>
|
|
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
|
|
<Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
|
|
<Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsEditable" Value="true">
|
|
<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/>
|
|
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
|
|
<Setter Property="IsTabStop" Value="false"/>
|
|
<Setter Property="Padding" Value="3"/>
|
|
<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<!-- *************************************************************************** -->
|
|
|
|
</ResourceDictionary>
|