|
@@ -0,0 +1,169 @@
|
|
|
+<Application x:Class="KFC.App"
|
|
|
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
+ xmlns:local="clr-namespace:KFC"
|
|
|
+ StartupUri="MainWindow.xaml">
|
|
|
+ <Application.Resources>
|
|
|
+
|
|
|
+ <Style x:Key="FocusVisual">
|
|
|
+ <Setter Property="Control.Template">
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate>
|
|
|
+ <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+ </Style>
|
|
|
+ <SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
|
|
|
+ <SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
|
|
|
+ <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
|
|
|
+ <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
|
|
|
+ <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
|
|
|
+ <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
|
|
|
+ <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
|
|
|
+ <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
|
|
|
+ <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
|
|
|
+ <Style x:Key="ButtonKFC" TargetType="{x:Type Button}">
|
|
|
+ <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
|
|
+ <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
|
|
|
+ <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
|
|
|
+ <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
|
|
+ <Setter Property="BorderThickness" Value="1"/>
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
+ <Setter Property="Padding" Value="1"/>
|
|
|
+ <Setter Property="Template">
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate TargetType="{x:Type Button}">
|
|
|
+ <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
|
|
+ <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
|
+ </Border>
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <Trigger Property="IsDefaulted" Value="true">
|
|
|
+ <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
|
|
+ </Trigger>
|
|
|
+ <Trigger Property="IsEnabled" Value="false">
|
|
|
+ <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
|
|
|
+ <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
|
|
|
+ <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
|
|
|
+ </Trigger>
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+ </Style>
|
|
|
+ <Style x:Key="ButtonKFC2" TargetType="{x:Type Button}">
|
|
|
+ <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
|
|
+ <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
|
|
|
+ <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
|
|
|
+ <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
|
|
+ <Setter Property="BorderThickness" Value="1"/>
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
+ <Setter Property="Padding" Value="1"/>
|
|
|
+ <Setter Property="Template">
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate TargetType="{x:Type Button}">
|
|
|
+ <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
|
|
|
+ <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
|
+ </Border>
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <Trigger Property="IsDefaulted" Value="true">
|
|
|
+ <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
|
|
+ </Trigger>
|
|
|
+ <Trigger Property="IsEnabled" Value="false">
|
|
|
+ <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
|
|
|
+ <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
|
|
|
+ <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
|
|
|
+ </Trigger>
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+ </Style>
|
|
|
+ <LinearGradientBrush x:Key="TabItem.Static.Background" EndPoint="0,1" StartPoint="0,0">
|
|
|
+ <GradientStop Color="#F0F0F0" Offset="0.0"/>
|
|
|
+ <GradientStop Color="#E5E5E5" Offset="1.0"/>
|
|
|
+ </LinearGradientBrush>
|
|
|
+ <SolidColorBrush x:Key="TabItem.Static.Border" Color="#ACACAC"/>
|
|
|
+ <LinearGradientBrush x:Key="TabItem.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
|
|
|
+ <GradientStop Color="#ECF4FC" Offset="0.0"/>
|
|
|
+ <GradientStop Color="#DCECFC" Offset="1.0"/>
|
|
|
+ </LinearGradientBrush>
|
|
|
+ <SolidColorBrush x:Key="TabItem.MouseOver.Border" Color="#7EB4EA"/>
|
|
|
+ <SolidColorBrush x:Key="TabItem.Disabled.Background" Color="#F0F0F0"/>
|
|
|
+ <SolidColorBrush x:Key="TabItem.Disabled.Border" Color="#D9D9D9"/>
|
|
|
+ <SolidColorBrush x:Key="TabItem.Selected.Border" Color="#ACACAC"/>
|
|
|
+ <SolidColorBrush x:Key="TabItem.Selected.Background" Color="#FFFFFF"/>
|
|
|
+ <Style x:Key="TabKFC" TargetType="{x:Type TabItem}">
|
|
|
+ <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
|
|
+ <Setter Property="Foreground" Value="Black"/>
|
|
|
+ <Setter Property="Background" Value="{StaticResource TabItem.Static.Background}"/>
|
|
|
+ <Setter Property="BorderBrush" Value="{StaticResource TabItem.Static.Border}"/>
|
|
|
+ <Setter Property="Margin" Value="0"/>
|
|
|
+ <Setter Property="Padding" Value="6,2,6,2"/>
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
|
|
+ <Setter Property="Template">
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate TargetType="{x:Type TabItem}">
|
|
|
+ <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
|
|
|
+ <Border x:Name="mainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Margin="0">
|
|
|
+ <Border x:Name="innerBorder" BorderBrush="{StaticResource TabItem.Selected.Border}" BorderThickness="1,1,1,0" Margin="-1" Opacity="0"/>
|
|
|
+ </Border>
|
|
|
+ <ContentPresenter x:Name="contentPresenter" ContentSource="Header" Focusable="False" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
|
|
+ </Grid>
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <MultiDataTrigger>
|
|
|
+ <MultiDataTrigger.Conditions>
|
|
|
+ <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
|
|
|
+ <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
|
|
|
+ </MultiDataTrigger.Conditions>
|
|
|
+ <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
|
|
|
+ <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
|
|
|
+ <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
|
|
|
+ <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
|
|
|
+ <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
|
|
|
+ </MultiDataTrigger>
|
|
|
+ <MultiDataTrigger>
|
|
|
+ <MultiDataTrigger.Conditions>
|
|
|
+ <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
|
|
|
+ <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
|
|
|
+ </MultiDataTrigger.Conditions>
|
|
|
+ <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
|
|
|
+ <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
|
|
|
+ <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
|
|
|
+ <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
|
|
|
+ <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
|
|
|
+ </MultiDataTrigger>
|
|
|
+ <MultiDataTrigger>
|
|
|
+ <MultiDataTrigger.Conditions>
|
|
|
+ <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
|
|
|
+ <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
|
|
|
+ </MultiDataTrigger.Conditions>
|
|
|
+ <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
|
|
|
+ <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
|
|
|
+ <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
|
|
|
+ <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
|
|
|
+ <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
|
|
|
+ </MultiDataTrigger>
|
|
|
+ <MultiDataTrigger>
|
|
|
+ <MultiDataTrigger.Conditions>
|
|
|
+ <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
|
|
|
+ <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
|
|
|
+ </MultiDataTrigger.Conditions>
|
|
|
+ <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
|
|
|
+ <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
|
|
|
+ <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
|
|
|
+ <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
|
|
|
+ <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
|
|
|
+ </MultiDataTrigger>
|
|
|
+
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ </Application.Resources>
|
|
|
+</Application>
|