首次提交:添加src文件夹代码
This commit is contained in:
31
Cowain.Bake.Common/Styles/ToggleButtonStyle.xaml
Normal file
31
Cowain.Bake.Common/Styles/ToggleButtonStyle.xaml
Normal file
@@ -0,0 +1,31 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style x:Key="ToggleButtonStyle" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Width" Value="45"></Setter>
|
||||
<Setter Property="Height" Value="20"></Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<!--定义视觉树-->
|
||||
<Border x:Name="border" BorderThickness="1.5" CornerRadius="9" BorderBrush="#aaa" Background="#2790ff">
|
||||
<Grid x:Name="togglebutton" HorizontalAlignment="Right" >
|
||||
<Border Width="17" Height="17" CornerRadius="9" Background="White"/>
|
||||
</Grid>
|
||||
<!--阴影设置-->
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Color="Gray" BlurRadius="5" ShadowDepth="0" Opacity="0.5" />
|
||||
</Border.Effect>
|
||||
</Border>
|
||||
<!--定义触发器-->
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="false">
|
||||
<Setter TargetName="border" Property="Background" Value="#ccc"/>
|
||||
<Setter TargetName="togglebutton" Property="HorizontalAlignment" Value="Left"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user