123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="BaseStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <!-- 按钮 源码行数:2782-3171 -->
- <!-- ButtonBase基样式 -->
- <Style
- x:Key="ButtonBaseBaseStyle"
- BasedOn="{StaticResource BaseStyle}"
- TargetType="{x:Type ButtonBase}">
- <Setter Property="Height" Value="{DynamicResource DefaultControlHeight}" />
- <Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
- <Setter Property="Padding" Value="{DynamicResource DefaultControlPadding}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- </Style>
- <!-- Button基样式 -->
- <Style
- x:Key="ButtonBaseStyle"
- BasedOn="{StaticResource ButtonBaseBaseStyle}"
- TargetType="{x:Type Button}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Grid>
- <Border
- x:Name="border"
- Padding="0"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="5"
- SnapsToDevicePixels="true">
- <!-- 点击时显示 -->
- <Grid x:Name="PressedLayer" Visibility="Collapsed">
- <Rectangle
- Height="3"
- VerticalAlignment="Top"
- Fill="#1F000000"
- RadiusX="4"
- RadiusY="4">
- <Rectangle.Effect>
- <BlurEffect Radius="5" />
- </Rectangle.Effect>
- </Rectangle>
- <Border
- BorderBrush="#1F000000"
- BorderThickness="1,0"
- CornerRadius="4">
- <Border.Effect>
- <BlurEffect Radius="3" />
- </Border.Effect>
- </Border>
- </Grid>
- </Border>
- <Border BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5">
- <ContentPresenter
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- <!-- 禁用时显示 -->
- <Rectangle
- x:Name="EnabledLayer"
- Fill="#4CFFFFFF"
- RadiusX="4"
- RadiusY="4"
- Visibility="Collapsed" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="PressedLayer" Property="Visibility" Value="Visible" />
- <Setter TargetName="border" Property="BorderBrush" Value="#80cccccc" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="EnabledLayer" Property="Visibility" Value="Visible" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- ToggleButton基样式 -->
- <Style
- x:Key="ToggleButtonBaseStyle"
- BasedOn="{StaticResource ButtonBaseBaseStyle}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Grid>
- <Border
- x:Name="border"
- Padding="0"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="5"
- SnapsToDevicePixels="true">
- <!-- 点下时显示 -->
- <Grid x:Name="CheckedLayer" Visibility="Collapsed">
- <Rectangle
- Height="3"
- VerticalAlignment="Top"
- Fill="#1F000000"
- RadiusX="5"
- RadiusY="5">
- <Rectangle.Effect>
- <BlurEffect Radius="5" />
- </Rectangle.Effect>
- </Rectangle>
- <Border
- BorderBrush="#1F000000"
- BorderThickness="1,0"
- CornerRadius="5">
- <Border.Effect>
- <BlurEffect Radius="3" />
- </Border.Effect>
- </Border>
- </Grid>
- </Border>
- <Border BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5">
- <ContentPresenter
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- <!-- 禁用时显示 -->
- <Rectangle
- x:Name="EnabledLayer"
- Fill="#4CFFFFFF"
- RadiusX="4"
- RadiusY="4"
- Visibility="Collapsed" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="CheckedLayer" Property="Visibility" Value="Visible" />
- <Setter TargetName="border" Property="BorderBrush" Value="#80cccccc" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="EnabledLayer" Property="Visibility" Value="Visible" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- Button -->
- <Style
- x:Key="btn"
- BasedOn="{StaticResource ButtonBaseStyle}"
- TargetType="{x:Type Button}">
- <Setter Property="Background" Value="{DynamicResource Background-Default1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Default1}" />
- <Setter Property="Foreground" Value="{DynamicResource Foreground-Default}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#e6e6e6" />
- <Setter Property="BorderBrush" Value="#adadad" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="btn-primary"
- BasedOn="{StaticResource ButtonBaseStyle}"
- TargetType="{x:Type Button}">
- <Setter Property="Background" Value="{DynamicResource Background-Primary1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Primary1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#3071a9" />
- <Setter Property="BorderBrush" Value="#285e8e" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="btn-success"
- BasedOn="{StaticResource ButtonBaseStyle}"
- TargetType="{x:Type Button}">
- <Setter Property="Background" Value="{DynamicResource Background-Success1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Success1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#449d44" />
- <Setter Property="BorderBrush" Value="#398439" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="btn-info"
- BasedOn="{StaticResource ButtonBaseStyle}"
- TargetType="{x:Type Button}">
- <Setter Property="Background" Value="{DynamicResource Background-Info1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Info1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#31b0d5" />
- <Setter Property="BorderBrush" Value="#269abc" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="btn-warning"
- BasedOn="{StaticResource ButtonBaseStyle}"
- TargetType="{x:Type Button}">
- <Setter Property="Background" Value="{DynamicResource Background-Warning1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Warning1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#ec971f" />
- <Setter Property="BorderBrush" Value="#d58512" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="btn-danger"
- BasedOn="{StaticResource ButtonBaseStyle}"
- TargetType="{x:Type Button}">
- <Setter Property="Background" Value="{DynamicResource Background-Danger1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Danger1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#c9302c" />
- <Setter Property="BorderBrush" Value="#ac2925" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <!-- ToggleButton -->
- <Style BasedOn="{StaticResource ToggleButtonBaseStyle}" TargetType="{x:Type ToggleButton}">
- <Setter Property="Background" Value="{DynamicResource Background-Default1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Default1}" />
- <Setter Property="Foreground" Value="{DynamicResource Foreground-Default}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#e6e6e6" />
- <Setter Property="BorderBrush" Value="#adadad" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="tbtn-primary"
- BasedOn="{StaticResource ToggleButtonBaseStyle}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="Background" Value="{DynamicResource Background-Primary1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Primary1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#3071a9" />
- <Setter Property="BorderBrush" Value="#285e8e" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="tbtn-success"
- BasedOn="{StaticResource ToggleButtonBaseStyle}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="Background" Value="{DynamicResource Background-Success1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Success1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#449d44" />
- <Setter Property="BorderBrush" Value="#398439" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="tbtn-info"
- BasedOn="{StaticResource ToggleButtonBaseStyle}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="Background" Value="{DynamicResource Background-Info1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Info1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#31b0d5" />
- <Setter Property="BorderBrush" Value="#269abc" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="tbtn-warning"
- BasedOn="{StaticResource ToggleButtonBaseStyle}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="Background" Value="{DynamicResource Background-Warning1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Warning1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#ec971f" />
- <Setter Property="BorderBrush" Value="#d58512" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="tbtn-danger"
- BasedOn="{StaticResource ToggleButtonBaseStyle}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="Background" Value="{DynamicResource Background-Danger1}" />
- <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush-Danger1}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="#c9302c" />
- <Setter Property="BorderBrush" Value="#ac2925" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="ToggleButtonStyle"
- BasedOn="{StaticResource tbtn-info}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="HorizontalAlignment" Value="Right" />
- <Setter Property="Margin" Value="0,0,0,0" />
- <Style.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Content" Value="已启用" />
- </Trigger>
- <Trigger Property="IsChecked" Value="False">
- <Setter Property="Content" Value="已禁用" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="ToggleButtonStyle2"
- BasedOn="{StaticResource tbtn-info}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="HorizontalAlignment" Value="Right" />
- <Setter Property="Margin" Value="0,0,0,0" />
- <Style.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Content" Value="是" />
- </Trigger>
- <Trigger Property="IsChecked" Value="False">
- <Setter Property="Content" Value="否" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="ToggleButtonStyle3"
- BasedOn="{StaticResource tbtn-info}"
- TargetType="{x:Type ToggleButton}">
- <Setter Property="HorizontalAlignment" Value="Right" />
- <Setter Property="Margin" Value="0,0,0,0" />
- <Style.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Content" Value="停止测试" />
- </Trigger>
- <Trigger Property="IsChecked" Value="False">
- <Setter Property="Content" Value="开始测试" />
- </Trigger>
- </Style.Triggers>
- </Style>
- </ResourceDictionary>
|