WPF 常用控件样式

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:InterfaceDesign">

    <Style x:Key="BtnInfoStyle" TargetType="Button">
        <!--<Setter Property="Width" Value="70"/>
        <Setter Property="Height" Value="25"/>-->
        <Setter Property="Foreground" Value="#FFFFFF"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Background" Value="#F89437"/>
        <Setter Property="FontFamily" Value="Microsoft YaHei"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="border" CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
                        <TextBlock Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="Background" Value="#F38B2A"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="border" Property="Background" Value="#F38B2A"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ImgBtnStyle" TargetType="Button">
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="FontFamily" Value="Microsoft YaHei"/>
        <Setter Property="Foreground" Value="#ffffff"/>
        <Setter Property="Background" Value="#515050"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Background="{TemplateBinding Background}">
                        <Image x:Name="m_img" Source="Images/icon_topbar_sign_out_normal.png" Width="14" Height="15"/>
                        <TextBlock x:Name="txtBox" Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" 
                                   FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="6,0,0,0"/>
                    </StackPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="m_img" Property="Source" Value="Images/icon_topbar_sign_out_touch.png"/>
                            <Setter TargetName="txtBox" Property="Foreground" Value="#f89437"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="m_img" Property="Source" Value="Images/icon_topbar_sign_out_touch.png"/>
                            <Setter TargetName="txtBox" Property="Foreground" Value="#f89437"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--密码框控件样式-->
    <Style x:Key="newCheckBoxStyle" TargetType="CheckBox">
        <Setter Property="IsChecked" Value="False"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="#063357"/>
        <Setter Property="FontFamily" Value="Microsoft YaHei"/>
        <Setter Property="FontSize" Value="18"/>
        <Setter Property="FontWeight" Value="Bold"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <DockPanel  Background="{TemplateBinding Background}" ToolTip="{TemplateBinding Content}" LastChildFill="False" Width="{TemplateBinding Width}">
                        <Image Margin="2 0 0 0" DockPanel.Dock="Left" x:Name="_img"  Stretch="None" Source="../images/icon_eyes_close.png"/>
                        <TextBlock DockPanel.Dock="Left" Margin="3 0 0 0" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" />
                    </DockPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter TargetName="_img" Property="Source" Value="/InterfaceDesign;component/Images/icon_eyes_open.png"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <SolidColorBrush x:Key="Static.Border" Color="#e9e9e9"/>
    <SolidColorBrush x:Key="MouseOver.Border" Color="#f89437"/>
    <SolidColorBrush x:Key="Focus.Border" Color="#f89437"/>
    <Style x:Key="PasswordBoxStyle1" TargetType="{x:Type PasswordBox}">
        <Setter Property="Width" Value="260"/>
        <Setter Property="Height" Value="40"/>
        <Setter Property="PasswordChar" Value="*"/>
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
        <Setter Property="BorderBrush" Value="{StaticResource Static.Border}"/>
        <Setter Property="Foreground" Value="#666666"/> <!--{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}-->
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="AllowDrop" Value="true"/>
        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <Border x:Name="m_mainBorder" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="5" 
                            BorderThickness="1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="40"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="30"/>
                            </Grid.ColumnDefinitions>
                            <Image Source="/InterfaceDesign;component/Images/icon_password.png" Height="16" Width="14" Margin="14,0,12,0"/>
                            <StackPanel Orientation="Horizontal" Grid.Column="1">
                                <Border VerticalAlignment="Center" x:Name="border" BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" 
                                        SnapsToDevicePixels="True">
                                    <ScrollViewer x:Name="PART_ContentHost"  Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
                                              >
                                    </ScrollViewer>
                                </Border>
                                <TextBlock Text="请输入密码" x:Name="tipTxt" VerticalAlignment="Center"
                                       FontFamily="Microsoft YaHei" Foreground="#acacac" FontSize="14"/>
                                <TextBox x:Name="m_txtBlockPasswordShower" Background="Transparent" MinWidth="180" VerticalAlignment="Center" Visibility="Collapsed" 
                                     FontFamily="Microsoft YaHei" FontSize="14" Foreground="#acacac" BorderThickness="0" 
                                     Text="{Binding Path=Password, RelativeSource={RelativeSource TemplatedParent},UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"/>
                                <!---->
                            </StackPanel>
                            <CheckBox Grid.Column="2" Style="{StaticResource newCheckBoxStyle}" x:Name="m_chboxEye" 
                                       Margin="0,0,10,0"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsChecked, ElementName=m_chboxEye}" Value="True">
                            <Setter Property="Visibility" Value="Visible" TargetName="m_txtBlockPasswordShower"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="border"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsChecked, ElementName=m_chboxEye}" Value="False">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="m_txtBlockPasswordShower"/>
                            <Setter Property="Visibility" Value="Visible" TargetName="border"/>
                        </DataTrigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="border" Value="0.56"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="BorderBrush" TargetName="m_mainBorder" Value="{StaticResource MouseOver.Border}"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter Property="BorderBrush" TargetName="m_mainBorder" Value="{StaticResource Focus.Border}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
                    <Condition Property="IsSelectionActive" Value="false"/>
                </MultiTrigger.Conditions>
                <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
            </MultiTrigger>
        </Style.Triggers>
    </Style>
    
    <SolidColorBrush x:Key="ButtonBrush" Color="Green" />

    <Storyboard x:Key="ChangeBackgroundStoryboard">
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush">
            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ButtonBrush}" />
        </ObjectAnimationUsingKeyFrames>
    </Storyboard>

    <!--用户管理删除的样式-->
                                <Style x:Key="TxtBlockStyle" TargetType="TextBlock">
                                    <Setter Property="Foreground" Value="#606266">
                                    </Setter>
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Foreground" Value="#ff2626"/>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>

                                <Style x:Key="DtGridTxtBox" TargetType="{x:Type TextBox}">
                                    <Setter Property="Width" Value="180"/>
                                    <Setter Property="Height" Value="34"/>
                                    <Setter Property="Background" Value="#ffffff"/>
                                    <Setter Property="BorderBrush" Value="#f89437"/>
                                    <Setter Property="BorderThickness" Value="1"/>
                                    <Setter Property="VerticalContentAlignment" Value="Center"/>
                                    <Setter Property="FontSize" Value="14"/>

                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type TextBox}">

                                                <Border  x:Name="border" BorderBrush="{TemplateBinding BorderBrush}"
                             BorderThickness="{TemplateBinding BorderThickness}"
                             Width="{TemplateBinding Width}"
                             Height="{TemplateBinding Height}"
                             Background="{TemplateBinding Background}" SnapsToDevicePixels="true">

                                                    <ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center"
                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                                </Border>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <Style x:Key="TxtBoxStyle" TargetType="{x:Type TextBox}">
                                    <Setter Property="Width" Value="200"/>
                                    <Setter Property="Height" Value="31"/>
                                    <Setter Property="Background" Value="#ffffff"/>
                                    <Setter Property="Foreground" Value="#666666"/>
                                    <Setter Property="BorderBrush" Value="#e2e2e2"/>
                                    <Setter Property="BorderThickness" Value="1"/>
                                    <Setter Property="VerticalContentAlignment" Value="Center"/>
                                    <Setter Property="FontSize" Value="14"/>
                                    <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type TextBox}">
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="28" />
                                                        <ColumnDefinition Width="*"/>
                                                    </Grid.ColumnDefinitions>
                                                    <!--<Label Background="{TemplateBinding Background}"/>-->
                                                    <Border Grid.Column="1" x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}"  CornerRadius="4"
                                Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                                                        <!--Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"-->
                                                        <ScrollViewer x:Name="PART_ContentHost" Margin="13,0,0,0" VerticalAlignment="Center" 
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                                    </Border>
                                                </Grid>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsEnabled" Value="false">
                                                        <Setter Property="Opacity" TargetName="border" Value="0.56"/>
                                                    </Trigger>
                                                    <Trigger Property="IsMouseOver" Value="true">
                                                        <Setter Property="BorderBrush" TargetName="border" Value="#f89437"/>
                                                    </Trigger>
                                                    <Trigger Property="IsFocused" Value="true">
                                                        <Setter Property="BorderBrush" TargetName="border" Value="#f89437"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                    <!--<Style.Triggers>
            <EventTrigger RoutedEvent="GotFocus">
                <BeginStoryboard  Storyboard="{StaticResource ChangeBackgroundStoryboard}" />
            </EventTrigger>
            <EventTrigger RoutedEvent="LostFocus">
                <BeginStoryboard Storyboard="{StaticResource ChangeBackgroundStoryboard}" />
            </EventTrigger>
        </Style.Triggers>-->
                                </Style>

                                <Style TargetType="Button" x:Key="eventBtn">
                                    <Style.Triggers>
                                        <EventTrigger RoutedEvent="MouseEnter">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <DoubleAnimation To="150" Duration="0:0:0.2"
                         	Storyboard.TargetProperty="Width"/>
                                                    <DoubleAnimation To="150" Duration="0:0:0.2"
                        	Storyboard.TargetProperty="Height"/>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>

                                        <EventTrigger RoutedEvent="MouseLeave">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0:0:0.2"
                             	Storyboard.TargetProperty="Width"/>
                                                    <DoubleAnimation Duration="0:0:0.2"
                            	Storyboard.TargetProperty="Height"/>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </Style.Triggers>
                                </Style>

                                <!--下拉按钮-->
                                <Style TargetType="ToggleButton" x:Key="ComboxStyleBtn">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Border x:Name="Back" Background="#ffffff" CornerRadius="0,4,4,0">
                                                    <!--BorderThickness="0,1,1,1" BorderBrush="#e2e2e2"-->
                                                    <Path Name="PathFill" Fill="#d5d6d7" Width="8" Height="5" StrokeThickness="0" Data="M5,0 L10,10 L0,10 z" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
                                                        <Path.RenderTransform>
                                                            <TransformGroup>
                                                                <ScaleTransform/>
                                                                <SkewTransform/>
                                                                <RotateTransform Angle="180"/>
                                                                <TranslateTransform/>
                                                            </TransformGroup>
                                                        </Path.RenderTransform>
                                                    </Path>
                                                </Border>
                                                <!--<ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="PathFill" Property="Fill" Value="red"></Setter>
                            <Setter TargetName="Back" Property="Background" Value="#ffffff"></Setter>
                            <Setter TargetName="Back" Property="BorderBrush" Value="#e2e2e2"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>-->
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!--Combox-->
                                <Style TargetType="ComboBox" x:Key="ComboBoxStyle">
                                    <Setter Property="ItemContainerStyle">
                                        <Setter.Value>
                                            <!--ComBoxItem-->
                                            <Style TargetType="ComboBoxItem">
                                                <Setter Property="Height" Value="30"></Setter>
                                                <Setter Property="MinWidth" Value="60"></Setter>
                                                <Setter Property="Foreground" Value="#666666"/>
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="ComboBoxItem">
                                                            <Border Name="Back" Background="#ffffff">
                                                                <Grid Width="{TemplateBinding Width}">
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition />
                                                                        <ColumnDefinition Width="38"/>
                                                                    </Grid.ColumnDefinitions>
                                                                    <ContentPresenter x:Name="m_CP" Grid.Column="0" ContentSource="{Binding Source}"
                                                          VerticalAlignment="Center" HorizontalAlignment="Left" Margin="14,0,0,0">
                                                                        <!--设置下拉框中字体颜色-->
                                                                        <!--<TextBlock.Foreground >
                                                <LinearGradientBrush >
                                                    <GradientStop Color="Red"/>
                                                </LinearGradientBrush>
                                            </TextBlock.Foreground>-->
                                                                        <TextBlock.FontFamily>
                                                                            <FontFamily>
                                                                                "Microsoft YaHei"
                                                                            </FontFamily>
                                                                        </TextBlock.FontFamily>
                                                                        <TextBlock.FontSize>
                                                                            14
                                                                        </TextBlock.FontSize>
                                                                        <!--<TextBlock.FontWeight>
                                                <FontWeight>
                                                    Bold
                                                </FontWeight>
                                            </TextBlock.FontWeight>-->
                                                                    </ContentPresenter>
                                                                    <Image x:Name="m_img" Source="/InterfaceDesign;component/Images/icon_duihao.png" 
                                               Width="8" Height="6" Visibility="Hidden" Grid.Column="1"/>
                                                                </Grid>
                                                            </Border>
                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsMouseOver" Value="True">
                                                                    <Setter TargetName="Back" Property="Background" Value="#fff3e9"/>
                                                                    <Setter TargetName="m_CP" Property="TextBlock.Foreground" Value="#f89437"/>
                                                                    <Setter TargetName="m_img" Property="Visibility" Value="Visible"/>
                                                                </Trigger>
                                                                <Trigger Property="IsHighlighted" Value="True">
                                                                    <Setter TargetName="Back" Property="Background" Value="#fff3e9"/>
                                                                    <Setter TargetName="m_CP" Property="TextBlock.Foreground" Value="#f89437"/>
                                                                    <Setter TargetName="m_img" Property="Visibility" Value="Visible"/>
                                                                </Trigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="ComboBox">
                                                <Grid Background="#ffffff" >
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="0.7*"/>
                                                        <ColumnDefinition Width="0.3*" MaxWidth="30"/>
                                                    </Grid.ColumnDefinitions>
                                                    <TextBlock Grid.Column="0" Text="{TemplateBinding Text}" Background="#ffffff" Foreground="#666666"
                                   FontSize="14" VerticalAlignment="Center" Margin="15,0,0,0"/>
                                                    <!--VerticalContentAlignment="Center" IsReadOnly="{TemplateBinding IsReadOnly}"-->
                                                    <Border Grid.Column="0" BorderThickness="1,1,0,1" BorderBrush="#e2e2e2" CornerRadius="4,0,0,4"/>

                                                    <Border Grid.Column="1" BorderThickness="0,1,1,1" BorderBrush="#e2e2e2" CornerRadius="0,4,4,0">
                                                        <ToggleButton Style="{StaticResource ComboxStyleBtn}" ClickMode="Press"
                                          IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                    </Border>
                                                    <Popup x:Name="Popup" IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" Focusable="False"
                               AllowsTransparency="True" PopupAnimation="Slide">
                                                        <Border x:Name="DropDown" SnapsToDevicePixels="True" CornerRadius="4" BorderBrush="#e2e2e2"
                                    MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" >
                                                            <!--下拉框阴影效果-->
                                                            <Border.Effect>
                                                                <DropShadowEffect Color="#6f6f6f" BlurRadius="5" ShadowDepth="2" Opacity="0.33"/>
                                                            </Border.Effect>
                                                            <ScrollViewer Margin="4,6,4,6" CanContentScroll="True"
                                              Style="{DynamicResource ScrollViewerStyle}" MaxHeight="{TemplateBinding MaxDropDownHeight}" 
                                              SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                                                                <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
                                                                <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="#ffffff"/>
                                                            </ScrollViewer>
                                                        </Border>
                                                    </Popup>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!--RadioButton-->
                                <Style x:Key="RadioBtnStyle" TargetType="RadioButton">
                                    <Setter Property="IsChecked" Value="False"/>
                                    <Setter Property="Background" Value="Transparent"/>
                                    <Setter Property="Foreground" Value="#666666"/>
                                    <Setter Property="FontFamily" Value="Microsoft YaHei"/>
                                    <Setter Property="FontSize" Value="14"/>
                                    <!--<Setter Property="FontWeight" Value="Bold"/>-->
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="RadioButton">
                                                <DockPanel  Background="{TemplateBinding Background}" ToolTip="{TemplateBinding Content}" 
                                LastChildFill="False" Width="{TemplateBinding Width}">
                                                    <Image Margin="2 0 0 0" DockPanel.Dock="Left" x:Name="_img"  Stretch="None" 
                               Source="/InterfaceDesign;component/Images/icon_未选中圆.png" />
                                                    <TextBlock DockPanel.Dock="Left" Margin="3 0 0 0" VerticalAlignment="Center" 
                                   Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" />
                                                </DockPanel>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsChecked" Value="true">
                                                        <Setter TargetName="_img" Property="Source" Value="/InterfaceDesign;component/Images/icon_选中圆.png"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <Style TargetType="ListBoxItem">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                                <Border x:Name="border" CornerRadius="0" Margin="2" 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 TargetName="border" Property="Background" Value="white" />
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!--CheckBox-->
                                <Style x:Key="CheckBoxStyle" TargetType="CheckBox">
                                    <Setter Property="IsEnabled" Value="True"/>
                                    <Setter Property="IsChecked" Value="False"/>
                                    <Setter Property="Background" Value="#ffffff"/>
                                    <Setter Property="Foreground" Value="#666666"/>
                                    <Setter Property="FontFamily" Value="Microsoft YaHei"/>
                                    <Setter Property="FontSize" Value="14"/>

                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="CheckBox">
                                                <DockPanel Background="{TemplateBinding Background}" ToolTip="{TemplateBinding Content}" LastChildFill="False" Width="{TemplateBinding Width}">
                                                    <Image Margin="2 0 0 0" DockPanel.Dock="Left" x:Name="m_img"  Stretch="None" Source="/InterfaceDesign;component/Images/icon_unChecked.png"/>
                                                    <TextBlock DockPanel.Dock="Left" Margin="12 0 0 0" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" />
                                                </DockPanel>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsChecked" Value="true">
                                                        <Setter TargetName="m_img" Property="Source" Value="/InterfaceDesign;component/Images/icon_checked.png"/>
                                                    </Trigger>
                                                    <Trigger Property="IsEnabled" Value="false">
                                                        <Setter TargetName="m_img" Property="Source" Value="/InterfaceDesign;component/Images/icon_disable.png"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!--Button-->
                                <Style TargetType="Button" x:Key="ButtonStyle1">
                                    <Setter Property="Background" Value="#f89437"/>
                                    <Setter Property="Foreground" Value="#ffffff"/>
                                    <Setter Property="FontSize" Value="14"/>
                                    <!--<Setter Property="BorderBrush" Value="#18cad6"/>-->
                                    <Setter Property="BorderThickness" Value="0"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="Button">
                                                <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                            SnapsToDevicePixels="True" CornerRadius="4">
                                                    <TextBlock Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}"
                                   VerticalAlignment="Center" HorizontalAlignment="Center"/>

                                                </Border>
                                                <ControlTemplate.Triggers>
                                                    <!--<Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" Value="#4f5b68"/>
                            <Setter Property="Foreground" Value="#8f8f8f"/>
                            <Setter Property="BorderBrush" Value="#717676"/>
                        </Trigger>-->
                                                    <Trigger Property="IsMouseOver" Value="True">
                                                        <Setter TargetName="border" Property="Background" Value="#f38b2a"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!--Button-->
                                <Style TargetType="Button" x:Key="ButtonStyle2">
                                    <Setter Property="Background" Value="#ffffff"/>
                                    <Setter Property="Foreground" Value="#f89437"/>
                                    <Setter Property="FontSize" Value="14"/>
                                    <Setter Property="Width" Value="70"/>
                                    <Setter Property="Height" Value="33"/>
                                    <Setter Property="BorderBrush" Value="#f89437"/>
                                    <Setter Property="BorderThickness" Value="1"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="Button">
                                                <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                            SnapsToDevicePixels="True" CornerRadius="4">
                                                    <TextBlock Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}"
                                   VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                                </Border>
                                                <ControlTemplate.Triggers>
                                                    <!--<Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" Value="#4f5b68"/>
                            <Setter Property="Foreground" Value="#8f8f8f"/>
                            <Setter Property="BorderBrush" Value="#717676"/>
                        </Trigger>-->
                                                    <Trigger Property="IsMouseOver" Value="True">
                                                        <Setter TargetName="border" Property="Background" Value="#f38b2a"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!-- ScrollViewer 滚动条 -->
                                <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
                                    <Setter Property="OverridesDefaultStyle" Value="true"/>
                                    <Setter Property="IsTabStop" Value="false"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Grid>
                                                    <!--滚动条颜色-->
                                                    <Border Background="#646465" CornerRadius="3"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                                <Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
                                    <Setter Property="OverridesDefaultStyle" Value="true"/>
                                    <Setter Property="Background" Value="Transparent"/>
                                    <Setter Property="Focusable" Value="false"/>
                                    <Setter Property="IsTabStop" Value="false"/>
                                    <Setter Property="Opacity" Value="0.2"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type RepeatButton}">
                                                <Rectangle Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                                <Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
                                    <Setter Property="OverridesDefaultStyle" Value="true"/>
                                    <Setter Property="Background" Value="Transparent"/>
                                    <Setter Property="Focusable" Value="false"/>
                                    <Setter Property="IsTabStop" Value="false"/>
                                    <Setter Property="Opacity" Value="0.2"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type RepeatButton}">
                                                <Rectangle Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!--滚动条上下按钮-->
                                <Style x:Key="VerticalScrollBarPageButton2" TargetType="{x:Type RepeatButton}">
                                    <Setter Property="OverridesDefaultStyle"  Value="true"/>
                                    <Setter Property="Background" Value="Transparent"/>
                                    <Setter Property="Focusable" Value="false"/>
                                    <Setter Property="IsTabStop" Value="false"/>
                                    <Setter Property="Opacity"  Value="0"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type RepeatButton}">
                                                <Rectangle Fill="#90000000" Width="0" Height="0"/>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <Style x:Key="for_scrollbar" TargetType="{x:Type ScrollBar}">
                                    <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
                                    <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
                                    <Setter Property="Background" Value="Transparent"/>
                                    <Setter Property="Margin" Value="0,1,1,6"/>
                                    <Setter Property="Width"  Value="5"/>
                                    <Setter Property="MinWidth"  Value="5"/>
                                    <Setter Property="Opacity"   Value="0.2"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type ScrollBar}">
                                                <Grid x:Name="Bg" SnapsToDevicePixels="true">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="auto"></RowDefinition>
                                                        <RowDefinition Height="*"></RowDefinition>
                                                        <RowDefinition Height="auto"></RowDefinition>
                                                    </Grid.RowDefinitions>
                                                    <RepeatButton  Grid.Row="0" Style="{StaticResource VerticalScrollBarPageButton2}" Command="{x:Static ScrollBar.PageUpCommand}"/>
                                                    <Track x:Name="PART_Track"   Grid.Row="1" IsEnabled="{TemplateBinding IsMouseOver}" IsDirectionReversed="true">
                                                        <Track.DecreaseRepeatButton>
                                                            <RepeatButton Style="{StaticResource VerticalScrollBarPageButton}" Command="{x:Static ScrollBar.PageUpCommand}"/>
                                                        </Track.DecreaseRepeatButton>
                                                        <Track.IncreaseRepeatButton>
                                                            <RepeatButton Style="{StaticResource VerticalScrollBarPageButton}" Command="{x:Static ScrollBar.PageDownCommand}"/>
                                                        </Track.IncreaseRepeatButton>
                                                        <Track.Thumb>
                                                            <Thumb Style="{StaticResource ScrollBarThumb}"/>
                                                        </Track.Thumb>
                                                    </Track>
                                                    <RepeatButton Grid.Row="2" Style="{StaticResource VerticalScrollBarPageButton2}" Command="{x:Static ScrollBar.PageDownCommand}"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                    <Style.Triggers>
                                        <Trigger Property="Orientation" Value="Horizontal">
                                            <Setter Property="Background"  Value="Transparent"/>
                                            <Setter Property="Margin" Value="1,0,6,1"/>
                                            <Setter Property="Height"   Value="5"/>
                                            <Setter Property="MinHeight"  Value="5"/>
                                            <Setter Property="Width"    Value="Auto"/>
                                            <Setter Property="Opacity" Value="0.2"/>
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type ScrollBar}">
                                                        <Grid x:Name="Bg" SnapsToDevicePixels="true">
                                                            <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
                                                                <Track.DecreaseRepeatButton>
                                                                    <RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}"  Command="{x:Static ScrollBar.PageLeftCommand}"/>
                                                                </Track.DecreaseRepeatButton>
                                                                <Track.IncreaseRepeatButton>
                                                                    <RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}"  Command="{x:Static ScrollBar.PageRightCommand}"/>
                                                                </Track.IncreaseRepeatButton>
                                                                <Track.Thumb>
                                                                    <Thumb Style="{StaticResource ScrollBarThumb}"/>
                                                                </Track.Thumb>
                                                            </Track>
                                                        </Grid>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>

                                <Style x:Key="for_scrollviewer"
           TargetType="{x:Type ScrollViewer}">
                                    <Setter Property="BorderBrush" Value="LightGray"/>
                                    <Setter Property="BorderThickness" Value="0"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type ScrollViewer}">
                                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
                                                    <Grid Background="{TemplateBinding Background}">
                                                        <ScrollContentPresenter  Cursor="{TemplateBinding Cursor}" Margin="{TemplateBinding Padding}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                        <ScrollBar x:Name="PART_VerticalScrollBar"
                                       HorizontalAlignment="Right"
                                       Maximum="{TemplateBinding ScrollableHeight}"
                                       Orientation="Vertical"
                                       Style="{StaticResource for_scrollbar}"
                                       ViewportSize="{TemplateBinding ViewportHeight}"
                                       Value="{TemplateBinding VerticalOffset}"
                                       Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                                                        <ScrollBar x:Name="PART_HorizontalScrollBar"
                                       Maximum="{TemplateBinding ScrollableWidth}"
                                       Orientation="Horizontal"
                                       Style="{StaticResource for_scrollbar}"
                                       VerticalAlignment="Bottom"
                                       Value="{TemplateBinding HorizontalOffset}"
                                       ViewportSize="{TemplateBinding ViewportWidth}"
                                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                                                    </Grid>
                                                </Border>
                                                <ControlTemplate.Triggers>
                                                    <EventTrigger RoutedEvent="ScrollChanged" >
                                                        <BeginStoryboard>
                                                            <Storyboard>
                                                                <DoubleAnimation
                                        Storyboard.TargetName="PART_VerticalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0.8"
                                        Duration="0:0:1"/>
                                                                <DoubleAnimation
                                        Storyboard.TargetName="PART_VerticalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0.2"
                                        Duration="0:0:1"
                                        BeginTime="0:0:1"/>
                                                                <DoubleAnimation
                                        Storyboard.TargetName="PART_HorizontalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0.8"
                                        Duration="0:0:1"/>
                                                                <DoubleAnimation
                                        Storyboard.TargetName="PART_HorizontalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0.2"
                                        Duration="0:0:1"
                                        BeginTime="0:0:1"/>
                                                            </Storyboard>
                                                        </BeginStoryboard>
                                                    </EventTrigger>
                                                    <EventTrigger RoutedEvent="MouseEnter"
                                      SourceName="PART_VerticalScrollBar">
                                                        <BeginStoryboard>
                                                            <Storyboard>
                                                                <DoubleAnimation
                                        Storyboard.TargetName="PART_VerticalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0.8"
                                        Duration="0:0:0.7"/>
                                                            </Storyboard>
                                                        </BeginStoryboard>
                                                    </EventTrigger>
                                                    <EventTrigger RoutedEvent="MouseLeave"
                                      SourceName="PART_VerticalScrollBar">
                                                        <BeginStoryboard>
                                                            <Storyboard>
                                                                <DoubleAnimation
                                        Storyboard.TargetName="PART_VerticalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0.2"
                                        Duration="0:0:0.7"/>
                                                            </Storyboard>
                                                        </BeginStoryboard>
                                                    </EventTrigger>
                                                    <EventTrigger RoutedEvent="MouseEnter"
                                      SourceName="PART_HorizontalScrollBar">
                                                        <BeginStoryboard>
                                                            <Storyboard>
                                                                <DoubleAnimation
                                        Storyboard.TargetName="PART_HorizontalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0.8"
                                        Duration="0:0:0.7"/>
                                                            </Storyboard>
                                                        </BeginStoryboard>
                                                    </EventTrigger>
                                                    <EventTrigger RoutedEvent="MouseLeave"
                                      SourceName="PART_HorizontalScrollBar">
                                                        <BeginStoryboard>
                                                            <Storyboard>
                                                                <DoubleAnimation
                                        Storyboard.TargetName="PART_HorizontalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0.2"
                                        Duration="0:0:0.7"/>
                                                            </Storyboard>
                                                        </BeginStoryboard>
                                                    </EventTrigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!--默认ScrollBar-->
                                <Style x:Key="ScrollBarStyle" TargetType="ScrollBar" BasedOn="{StaticResource for_scrollbar}"/>

                                <!--默认ScrollView-->
                                <Style x:Key="ScrollViewerStyle" TargetType="ScrollViewer" BasedOn="{StaticResource for_scrollviewer}"/>

                                <!--DataGrid样式-->
                                <Style TargetType="DataGrid" x:Key="DataGridStyle">
                                    <!--网格线颜色-->
                                    <Setter Property="CanUserResizeColumns" Value="True"/>
                                    <Setter Property="Background" Value="#f7f7f7" />
                                    <!--表头背景色-->
                                    <Setter Property="BorderBrush" Value="#e8e8e8" />
                                    <!--DataGrid外框颜色-->
                                    <!--表格中横纵线的颜色(不包括表头)-->
                                    <Setter Property="HorizontalGridLinesBrush">
                                        <Setter.Value>
                                            <SolidColorBrush Color="#e8e8e8"/>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="VerticalGridLinesBrush">
                                        <Setter.Value>
                                            <SolidColorBrush Color="#e8e8e8"/>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type DataGrid}">
                                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" x:Name="border"
                            Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
                                                    <ScrollViewer x:Name="DG_ScrollViewer" Focusable="false">
                                                        <ScrollViewer.Template>
                                                            <ControlTemplate TargetType="{x:Type ScrollViewer}">
                                                                <Grid>
                                                                    <Grid.ColumnDefinitions>
                                                                        <!--第一列-->
                                                                        <ColumnDefinition x:Name="col_rowheader" Width="0" />
                                                                        <ColumnDefinition Width="*" />
                                                                        <ColumnDefinition Width="Auto" />
                                                                    </Grid.ColumnDefinitions>
                                                                    <Grid.RowDefinitions>
                                                                        <RowDefinition Height="Auto" />
                                                                        <RowDefinition Height="*" />
                                                                        <RowDefinition Height="Auto" />
                                                                    </Grid.RowDefinitions>
                                                                    <!--表格头部-->
                                                                    <DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.Column="1" Grid.ColumnSpan="2"
                                                    Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" />
                                                                    <!--主数据区-->
                                                                    <Grid Grid.Row="1" Grid.ColumnSpan="2">
                                                                        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="2" />
                                                                    </Grid>
                                                                    <!--垂直滑动条-->
                                                                    <ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}"
                                                   Orientation="Vertical" Grid.Row="0" Grid.RowSpan="3" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                                   Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                                                   ViewportSize="{TemplateBinding ViewportHeight}" Style="{StaticResource for_scrollbar}"/>
                                                                    <!--横向滑动条-->
                                                                    <ScrollBar x:Name="PART_HorizontalScrollBar" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2"
                                                       Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal"
                                                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                                       Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                                                       ViewportSize="{TemplateBinding ViewportWidth}" Style="{StaticResource for_scrollbar}"/>
                                                                </Grid>
                                                            </ControlTemplate>
                                                        </ScrollViewer.Template>
                                                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                                    </ScrollViewer>
                                                </Border>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsEnabled" Value="false">
                                                        <Setter Property="Opacity" Value="0.5" TargetName="border" />
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!--列头分割线-->
                                <Style x:Key="DefaultColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
                                    <Setter Property="Width" Value="4" />
                                    <!--列头分割线的背景色-->
                                    <!--<Setter Property="Background" Value="Red" />-->
                                    <Setter Property="Cursor" Value="SizeWE" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type Thumb}">
                                                <Border Padding="{TemplateBinding Padding}" Background="Transparent" Margin="0 0 0 2">
                                                    <Rectangle HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Width="1" Fill="{TemplateBinding Background}" />
                                                </Border>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <!--标题栏样式-->
                                <Style TargetType="DataGridColumnHeader">
                                    <Setter Property="Height" Value="45"/>
                                    <Setter Property="SnapsToDevicePixels" Value="True" />
                                    <Setter Property="MinWidth" Value="0" />
                                    <Setter Property="MinHeight" Value="28" />
                                    <Setter Property="Foreground" Value="#333333" />
                                    <Setter Property="FontSize" Value="14" />
                                    <Setter Property="FontFamily" Value="Microsoft YaHei" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="DataGridColumnHeader">
                                                <!--标题栏横框-->
                                                <Border x:Name="BackgroundBorder" BorderThickness="0,1,0,1" BorderBrush="#e8e8e8" Width="Auto">
                                                    <Grid >
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="*" />
                                                        </Grid.ColumnDefinitions>
                                                        <ContentPresenter  Margin="14,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                                        <Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill"  Grid.Column="2" 
                                  Width="8" Height="6" Fill="White" Margin="0,0,50,0" VerticalAlignment="Center" RenderTransformOrigin="1,1" />
                                                        <!--标题栏纵线-->
                                                        <Rectangle Width="2" Fill="#e8e8e8" HorizontalAlignment="Right" Grid.ColumnSpan="1" />
                                                        <!--不设置的话,会影响标题列不能拖拽-->
                                                        <Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" HorizontalContentAlignment="Left"
                               Style="{StaticResource DefaultColumnHeaderGripperStyle}" />

                                                        <Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" HorizontalContentAlignment="Right" 
                                   Background="Transparent" Style="{StaticResource DefaultColumnHeaderGripperStyle}"/>
                                                    </Grid>
                                                </Border>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                                <!--行样式触发-->
                                <!--背景色改变必须先设置cellStyle 因为cellStyle会覆盖rowStyle样式-->
                                <Style  TargetType="DataGridRow">
                                    <Setter Property="Background" Value="#FfFfFf" />
                                    <Setter Property="Height" Value="36"/>
                                    <Setter Property="Foreground" Value="#606266" />
                                    <Setter Property="FontSize" Value="14"/>
                                    <Setter Property="FontFamily" Value="Microsoft YaHei"/>
                                    <Style.Triggers>
                                        <!--隔行换色-->
                                        <!--<Trigger Property="AlternationIndex" Value="0" >
                <Setter Property="Background" Value="#e7e7e7" />
            </Trigger>
            <Trigger Property="AlternationIndex" Value="1" >
                <Setter Property="Background" Value="#f2f2f2" />
            </Trigger>-->

                                        <!--<Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="#fff3e7"/>
                -->
                                        <!--<Setter Property="Foreground" Value="White"/>-->
                                        <!--
            </Trigger>-->

                                        <Trigger Property="IsSelected" Value="True">
                                            <!--<Setter Property="Foreground" Value="Black"/>-->
                                            <Setter Property="Background" Value="#fff3e7"/>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>

                                <!--单元格样式触发-->
                                <Style TargetType="DataGridCell">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="DataGridCell">
                                                <TextBlock TextAlignment="Left" VerticalAlignment="Center" Margin="15,0,0,0" >
                           <ContentPresenter />
                                                </TextBlock>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                    <Style.Triggers>
                                        <Trigger Property="IsSelected" Value="True">
                                            <Setter Property="Foreground" Value="#606266"/>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>



</ResourceDictionary>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
WPF(Windows Presentation Foundation)是一种用于创建Windows应用程序的UI框架,提供了丰富的件和布局件,下面是对常用件和布局件的详细描述: 常用件: 1. Button(按钮):用于触发特定操作或事件,如提交表单、打开对话框等。可以通过设置样式来自定义按钮的外观。 2. TextBox(文本框):用于接收用户输入的文本信息,如用户名、密码等。支持文本验证、自动完成等功能。 3. Label(标签):用于显示文本信息,如标题、说明等。可以设置字体、颜色、对齐方式等属性。 4. ComboBox(组合框):用于选择列表中的一项,可以是预定义选项或自定义输入。可以设置下拉列表展示方式、选中项等。 5. ListBox(列表框):用于显示列表中的多个项,用户可以选择其中的一项或多项。支持数据绑定和自定义项模板。 6. DataGrid(数据表格):用于展示和编辑数据集,支持排序、筛选、分组等功能。可以自定义列样式和编辑模式。 7. CheckBox(复选框):用于选择多个选项中的一个或多个。支持绑定Boolean值,可以设置选中状态和样式。 8. RadioButton(单选按钮):用于选择多个选项中的一个。可以使用GroupBox进行分组管理,支持绑定枚举值。 9. Slider(滑块):用于在一个范围内选择一个数值。可以设置最小值、最大值、刻度等属性,支持双向绑定。 10. Image(图片):用于显示图像文件或其他图形资源。支持设置源文件、缩放模式、透明度等属性。 布局件: 1. Grid(网格):最常用的布局件,将子元素按照行和列的方式排列。可以设置行和列的大小、对齐方式等。 2. StackPanel(堆栈面板):将子元素按照水平或垂直方向依次排列。支持自动布局和可伸缩性。 3. WrapPanel(自动换行面板):将子元素按照水平或垂直方向排列,当空间不足时自动换行。适用于流式布局。 4. DockPanel(停靠面板):将子元素停靠在上、下、左、右或中心位置。支持设置停靠顺序和占位大小。 5. Canvas(画布):允许通过绝对定位来放置子元素。可以设置子元素的坐标和大小。 6. UniformGrid(均匀网格):将子元素按照指定的行列数均匀排列。可以设置行数、列数和对齐方式。 7. GridSplitter(网格分隔条):用于在Grid中调整行和列的大小。可以水平或垂直拖动来调整布局。 以上是WPF常用件和布局件的详细描述,开发人员可以根据具体需求选择合适的件和布局方式来设计用户界面。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值