|
- <Application x:Class="BPASmartClient.MilkWithTea.App"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:BPASmartClient.MilkWithTea"
- StartupUri="MainWindow.xaml">
- <Application.Resources>
-
- <Style x:Key="ScrollThumbs" TargetType="{x:Type Thumb}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Thumb}">
- <Grid x:Name="Grid">
- <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="Transparent"/>
- <Border x:Name="Rectangle1" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Background="{TemplateBinding Background}"/>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="Tag" Value="Horizontal">
- <Setter TargetName="Rectangle1" Property="Width" Value="Auto"/>
- <Setter TargetName="Rectangle1" Property="Height" Value="7"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--滚动条样式-->
- <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
- <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
- <Setter Property="Foreground" Value="LightGray"/>
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Width" Value="11"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ScrollBar}">
- <Grid x:Name="GridRoot" Width="14" Background="{TemplateBinding Background}">
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <!--This is scrollbar track-->
- <Track x:Name="PART_Track" Grid.Row="0" IsDirectionReversed="True" Focusable="False">
- <Track.Thumb>
- <Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}" Style="{DynamicResource ScrollThumbs}"/>
- </Track.Thumb>
- <Track.IncreaseRepeatButton>
- <RepeatButton x:Name="PageUp" Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="False"/>
- </Track.IncreaseRepeatButton>
- <Track.DecreaseRepeatButton>
- <RepeatButton x:Name="PageDown" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="False"/>
- </Track.DecreaseRepeatButton>
- </Track>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="Thumb" Property="Visibility" Value="Collapsed"/>
- </Trigger>
- <Trigger Property="Orientation" Value="Horizontal">
- <Setter TargetName="GridRoot" Property="LayoutTransform">
- <Setter.Value>
- <RotateTransform Angle="-90"/>
- </Setter.Value>
- </Setter>
- <Setter TargetName="PART_Track" Property="LayoutTransform">
- <Setter.Value>
- <RotateTransform Angle="-90"/>
- </Setter.Value>
- </Setter>
- <Setter Property="Width" Value="Auto"/>
- <Setter Property="Height" Value="12"/>
- <Setter TargetName="Thumb" Property="Tag" Value="Horizontal"/>
- <Setter TargetName="PageDown" Property="Command" Value="ScrollBar.PageLeftCommand"/>
- <Setter TargetName="PageUp" Property="Command" Value="ScrollBar.PageRightCommand"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--datagrid标题栏样式-->
- <Style TargetType="DataGridColumnHeader">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="MinWidth" Value="0" />
- <Setter Property="MinHeight" Value="30" />
- <Setter Property="Foreground" Value="DarkSlateGray" />
- <Setter Property="FontSize" Value="18" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="Background" Value="#D3D3D3"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="DataGridColumnHeader">
-
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center"
- HorizontalAlignment="Center" />
- <Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill"
- Grid.Column="0" Width="8" Height="6" Fill="#D3D3D3" Margin="0,0,50,0"
- VerticalAlignment="Center" RenderTransformOrigin="1,1" />
- <Rectangle Width="1" Fill="Black" HorizontalAlignment="Right" Grid.ColumnSpan="1" />
- </Grid>
-
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Height" Value="25" />
- </Style>
- <Style TargetType="{x:Type DataGridCell}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="#FF31879E" />
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type DataGridCell}">
- <Border
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Height="{TemplateBinding Height}"
- SnapsToDevicePixels="True">
- <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
-
-
-
- <Style x:Key="buttonNormal" TargetType="{x:Type Button}">
- <Setter Property="FocusVisualStyle">
- <Setter.Value>
- <Style>
- <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>
- </Setter.Value>
- </Setter>
- <Setter Property="Background" Value="#58B0ED"/>
- <Setter Property="BorderBrush" Value="#FF707070"/>
- <Setter Property="Foreground" Value="White"/>
- <Setter Property="BorderThickness" Value="0"/>
- <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" CornerRadius="10" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
- <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" TargetName="border" Value="#FF3C7FB1"/>
- <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter Property="Background" TargetName="border" Value="#58B0ED "/>
- <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
- </Trigger>
- <Trigger Property="ToggleButton.IsChecked" Value="True">
- <Setter Property="Background" TargetName="border" Value="#FF3C7FB1"/>
- <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Background" TargetName="border" Value="#58B0ED"/>
- <Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
- <Setter Property="Foreground" Value="White"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <!--下拉列表样式-->
- <Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
- <Setter Property="IsExpanded" Value="False"></Setter>
- <Setter Property="Margin" Value="40,20"/>
- <Setter Property="FontSize" Value="20"/>
- <Setter Property="FontWeight" Value="Bold"/>
- <Setter Property="Foreground" Value="DarkSlateGray"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Expander}">
- <ControlTemplate.Resources>
- <Storyboard x:Key="STHide">
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
- Storyboard.TargetName="ExpandSite">
- <EasingDoubleKeyFrame KeyTime="0:0:0.0"
- Value="1" />
- <EasingDoubleKeyFrame KeyTime="0:0:0.5"
- Value="0" />
- </DoubleAnimationUsingKeyFrames>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
- Storyboard.TargetName="ExpandSite">
- <EasingDoubleKeyFrame KeyTime="0:0:0.5"
- Value="1" />
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- <Storyboard x:Key="STShow">
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
- Storyboard.TargetName="ExpandSite">
- <EasingDoubleKeyFrame KeyTime="0"
- Value="0" />
- <EasingDoubleKeyFrame KeyTime="0:0:0.3"
- Value="1" />
- </DoubleAnimationUsingKeyFrames>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
- Storyboard.TargetName="ExpandSite">
- <EasingDoubleKeyFrame KeyTime="0"
- Value="0" />
- <EasingDoubleKeyFrame KeyTime="0:0:0.6"
- Value="1" />
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </ControlTemplate.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="auto"></RowDefinition>
- </Grid.RowDefinitions>
-
- <Border BorderThickness="1" Background="White" BorderBrush="Black" CornerRadius="10" Padding="10,2">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="200"/>
- <ColumnDefinition Width="50"/>
- </Grid.ColumnDefinitions>
-
- <ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" VerticalAlignment="Center">
-
- </ContentPresenter>
- <ToggleButton x:Name="HeaderSite" Grid.Column="0" Grid.ColumnSpan="2" Background="Transparent" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Width="200"
- ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
- IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
- Style="{DynamicResource ExpanderToggleButtonStyle}" />
- </Grid>
- </Border>
- <ContentPresenter x:Name="ExpandSite" Grid.Row="1"
- ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
- <ContentPresenter.LayoutTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform />
- <TranslateTransform />
- </TransformGroup>
- </ContentPresenter.LayoutTransform>
- </ContentPresenter>
- </Grid>
- <ControlTemplate.Triggers>
- <EventTrigger RoutedEvent="FrameworkElement.Loaded">
- <BeginStoryboard Storyboard="{StaticResource STHide}" />
- </EventTrigger>
- <EventTrigger RoutedEvent="Expander.Expanded">
- <BeginStoryboard x:Name="STShow_BeginStoryboard"
- Storyboard="{StaticResource STShow}" />
- </EventTrigger>
- <EventTrigger RoutedEvent="Expander.Collapsed">
- <BeginStoryboard Storyboard="{StaticResource STHide}" />
- </EventTrigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value=" #E1FFFF"/>
- </Trigger>
- <Trigger Property="IsExpanded" Value="True">
- <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ExpanderToggleButtonStyle" TargetType="{x:Type ToggleButton}">
- <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
- <Setter Property="Height" Value="30" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="DarkSlateGray"/>
- <Setter Property="FontSize" Value="22" />
- <Setter Property="FontFamily" Value="宋体" />
- <Setter Property="FontWeight" Value="Bold" />
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- <Setter Property="Width" Value="50"></Setter>
- <Setter Property="Padding" Value="5 5"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Canvas Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
- Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
- <Canvas x:Name="canvNormal" Visibility="Visible"
- 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="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="10"/>
- <Path Data="M 0 0 L 6 6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="15"/>
- </Canvas>
- <Canvas x:Name="canvChecked" 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="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="15"/>
- <Path Data="M 0 0 L 6 -6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="20"/>
- </Canvas>
-
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- Margin="{TemplateBinding Padding}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
- </Canvas>
-
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="true">
- <Setter Property="Background" Value="SlateGray" />
- </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="Gray"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <!--GroupBox-->
- <Style x:Key="GroupBoxStyle1" TargetType="{x:Type GroupBox}">
- <Setter Property="BorderBrush" Value="#D5DFE5"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="Margin" Value="20"/>
- <Setter Property="BorderThickness" Value="10"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type GroupBox}">
- <Grid SnapsToDevicePixels="true">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="6"/>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="6"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto" MinHeight="59"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="6"/>
- </Grid.RowDefinitions>
- <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" Grid.Column="0" CornerRadius="4" Grid.Row="0" Grid.RowSpan="4" Background="Transparent" Margin="0,-0.25,0,0.25">
- <Border.Effect>
- <DropShadowEffect Color="#FFAAAAAA" Direction="350"/>
- </Border.Effect>
- </Border>
- <Border x:Name="Header" Grid.Column="1" Padding="3,1,3,0" Grid.Row="1" Grid.RowSpan="1" HorizontalAlignment="Right" Background="{x:Null}" Margin="0" Height="16.96" VerticalAlignment="Top"/>
- <ContentPresenter Grid.ColumnSpan="2" Grid.Column="1" Margin="{TemplateBinding Padding}" Grid.Row="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.RowSpan="1"/>
- <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" CornerRadius="4" Grid.Row="1" Grid.RowSpan="3">
- <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
- <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>
- </Border>
- </Border>
- <Grid x:Name="HeaderGrid" Height="47.2" VerticalAlignment="Stretch" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="1" Margin="0,7.982,-16,3.818" Grid.Row="1" HorizontalAlignment="Right">
- <Path Data="M12.19,0 L12.290733,14.847 -1.3000648E-08,14.847 z" Height="16.1" Margin="0,0,8.067,0" RenderTransformOrigin="0.499999978361064,0.499999995889058" Stretch="Fill" Stroke="Black" StrokeThickness="0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="12.29" >
- <Path.Fill>
- <LinearGradientBrush EndPoint="0.466,2.201" StartPoint="0.5,0">
- <GradientStop Color="#C66A6A6A" Offset="1"/>
- <GradientStop Color="#E1434343" Offset="0.855"/>
- <GradientStop Color="#FFC6C6C6" Offset="0.11"/>
- </LinearGradientBrush>
- </Path.Fill>
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform Angle="90.087"/>
- <TranslateTransform Y="-6.04399277075815" X="6.0531771644038841"/>
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- <Border BorderBrush="Black" BorderThickness="0" Margin="0,8.061,0,0" CornerRadius="16,0,0,16" Background="White">
- <Border.Effect>
- <DropShadowEffect Direction="195" BlurRadius="10" Opacity="0.305" ShadowDepth="6"/>
- </Border.Effect>
- <Border x:Name="contentBorder" BorderBrush="Black" Margin="6,6,0,6" CornerRadius="16,0,0,16">
- <Border.Background>
- <LinearGradientBrush EndPoint="1.002,0.498" StartPoint="-0.024,0.502">
- <GradientStop Color=" #4682B4" Offset="0.027"/>
- <GradientStop Color=" #F0FFFF" Offset="0.994"/>
- </LinearGradientBrush>
- </Border.Background>
- <Grid>
- <ContentControl HorizontalAlignment="Left" Margin="20,0,23,0" VerticalAlignment="Center" Foreground="White">
- <ContentPresenter ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="0" Width="212.323"/>
- </ContentControl>
- </Grid>
- </Border>
- </Border>
- </Grid>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <!--Combox-->
- <Style TargetType="{x:Type ComboBox}" x:Key="cmbstyle">
- <Setter Property="Background" Value="White"/>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <!--ComBoxItem-->
- <Style TargetType="ComboBoxItem">
- <Setter Property="MinHeight" Value="22"></Setter>
- <Setter Property="MinWidth" Value="60"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ComboBoxItem">
- <Border Name="Back" Background="Transparent" BorderThickness="0,0,0,0" BorderBrush="#81D779" Height="{TemplateBinding Height}" >
- <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"></ContentPresenter>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
- </Trigger>
- <Trigger Property="IsHighlighted" Value="True">
- <Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ComboBox}">
- <Border BorderThickness="1" BorderBrush="#CDC9C9 " CornerRadius="3" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Background="{TemplateBinding Background}" >
- <Grid Height="{TemplateBinding Height}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="3*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0" x:Name="grid" >
- <ToggleButton
- Width="{Binding ElementName=grid,Path=ActualWidth}"
- Height="{Binding ElementName=grid, Path=ActualHeight}"
- Content="{TemplateBinding Text}" VerticalAlignment="Center"
- HorizontalAlignment="Left" Margin="5,0,0,0"
- BorderThickness="0"
- Foreground="{TemplateBinding Foreground}"
- Background="{TemplateBinding Background}"
- IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"
- >
- <ToggleButton.Style >
- <Style TargetType="ToggleButton">
- <Setter Property="Background" Value="White"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ToggleButton">
- <Border Background="{TemplateBinding Background}" BorderThickness="0" >
- <TextBlock Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" Margin="4 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="White"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="False">
- <Setter Property="Background" Value="White"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- </ToggleButton.Style>
- </ToggleButton>
- </Grid>
-
- <Grid Grid.Column="1" >
- <ToggleButton IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
- Foreground="{TemplateBinding Foreground}"
- ClickMode="Press">
- <ToggleButton.Style>
- <Style TargetType="ToggleButton">
- <Setter Property="Background" Value="White"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ToggleButton">
- <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
- <Grid>
- <TextBlock Foreground="{TemplateBinding Foreground}" x:Name="arrow_tb" Text="󰊩" FontFamily="/BPASmartClient.CustomResource;component/Fonts/MT/#iconfont" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
- <TextBlock.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform/>
- <TranslateTransform/>
- </TransformGroup>
- </TextBlock.RenderTransform>
- </TextBlock>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
-
- </Trigger>
- <EventTrigger RoutedEvent="Checked">
- <BeginStoryboard>
- <Storyboard >
- <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
- <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
- <EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
-
- <EventTrigger RoutedEvent="Unchecked">
- <BeginStoryboard>
- <Storyboard >
- <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
- <EasingDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
- <EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ToggleButton.Style>
- </ToggleButton>
- </Grid>
- <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
- <Border CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
- <Border.Effect>
- <DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
- </Border.Effect>
- <ScrollViewer Margin="4,6,4,6" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
- <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
- <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
- </ScrollViewer>
- </Border>
- </Popup>
- </Grid>
-
-
- <Border.Effect>
- <DropShadowEffect ShadowDepth="-1" Opacity="0.3" Color="#FF969696" BlurRadius="5"/>
- </Border.Effect>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
-
-
- </Style>
- <!--开关按钮-->
- <Style x:Key="OpenCheckBoxStyle1" TargetType="{x:Type CheckBox}">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
- <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type CheckBox}">
- <ControlTemplate.Resources>
- <Storyboard x:Key="OnChecking">
- <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="slider" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
- <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="45"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- <Storyboard x:Key="OnUnchecking">
- <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="slider" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
- <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
- </DoubleAnimationUsingKeyFrames>
- <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="slider" Storyboard.TargetProperty="(FrameworkElement.Margin)">
- <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="1,1,1,1"/>
- </ThicknessAnimationUsingKeyFrames>
- </Storyboard>
- </ControlTemplate.Resources>
-
- <DockPanel x:Name="dockPanel">
- <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" RecognizesAccessKey="True" VerticalAlignment="Center"/>
- <Grid Margin="5,5,0,5" Width="80" Background="#FFC0CCD9">
- <TextBlock Text="OFF" TextWrapping="Wrap" FontWeight="Bold" FontSize="16" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,3,0" Foreground="Red"/>
- <TextBlock HorizontalAlignment="Left" Margin="2,0,0,0" FontSize="16" FontWeight="Bold" Text="ON" VerticalAlignment="Center" TextWrapping="Wrap" Foreground="#008000"/>
- <Border HorizontalAlignment="Left" x:Name="slider" Width="33" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3" RenderTransformOrigin="0.5,0.5" Margin="1,1,1,1">
- <Border.RenderTransform>
- <TransformGroup>
- <ScaleTransform ScaleX="1" ScaleY="1"/>
- <SkewTransform AngleX="0" AngleY="0"/>
- <RotateTransform Angle="0"/>
- <TranslateTransform X="0" Y="0"/>
- </TransformGroup>
- </Border.RenderTransform>
- <Border.BorderBrush>
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
- <GradientStop Color="#FFFFFFFF" Offset="0"/>
- <GradientStop Color="#FF4490FF" Offset="1"/>
- </LinearGradientBrush>
- </Border.BorderBrush>
- <Border.Background>
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
- <GradientStop Color="#FF8AB4FF" Offset="1"/>
- <GradientStop Color="#FFD1E2FF" Offset="0"/>
- </LinearGradientBrush>
- </Border.Background>
- </Border>
- </Grid>
- </DockPanel>
-
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Trigger.ExitActions>
- <BeginStoryboard Storyboard="{StaticResource OnUnchecking}" x:Name="OnUnchecking_BeginStoryboard"/>
- </Trigger.ExitActions>
- <Trigger.EnterActions>
- <BeginStoryboard Storyboard="{StaticResource OnChecking}" x:Name="OnChecking_BeginStoryboard"/>
- </Trigger.EnterActions>
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Storyboard x:Key="Move0">
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
- Storyboard.TargetName="contentRegion">
- <EasingDoubleKeyFrame KeyTime="0:0:0" Value="900">
-
- </EasingDoubleKeyFrame>
- <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0">
-
- </EasingDoubleKeyFrame>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
-
- <Storyboard x:Key="Move1">
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
- Storyboard.TargetName="contentRegion">
- <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="40">
- <EasingDoubleKeyFrame.EasingFunction>
- <BackEase EasingMode="EaseInOut"/>
- </EasingDoubleKeyFrame.EasingFunction>
- </EasingDoubleKeyFrame>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
-
- <Storyboard x:Key="Move2">
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
- Storyboard.TargetName="contentRegion">
- <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="80">
- <EasingDoubleKeyFrame.EasingFunction>
- <BackEase EasingMode="EaseInOut"/>
- </EasingDoubleKeyFrame.EasingFunction>
- </EasingDoubleKeyFrame>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
-
- <Style TargetType="TextBlock">
- <Setter Property="FontSize" Value="18"/>
- <Setter Property="Foreground" Value="DarkSlateGray"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- <Setter Property="HorizontalAlignment" Value="Center"/>
- <Setter Property="FontSize" Value="18"/>
- </Style>
-
- </Application.Resources>
- </Application>
|