mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-11-29 18:38:30 +08:00
modify button, toggle button style
This commit is contained in:
parent
07762e3616
commit
a68b0213a6
@ -5,11 +5,24 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public class StatusSwitchElement
|
||||
{
|
||||
/// <summary>
|
||||
/// 选中时展示的元素
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty CheckedElementProperty = DependencyProperty.RegisterAttached(
|
||||
"CheckedElement", typeof(object), typeof(StatusSwitchElement), new PropertyMetadata(default(object)));
|
||||
|
||||
public static void SetCheckedElement(DependencyObject element, object value) => element.SetValue(CheckedElementProperty, value);
|
||||
|
||||
public static object GetCheckedElement(DependencyObject element) => element.GetValue(CheckedElementProperty);
|
||||
|
||||
/// <summary>
|
||||
/// 是否隐藏元素
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty HiddenElementProperty = DependencyProperty.RegisterAttached(
|
||||
"HiddenElement", typeof(bool), typeof(StatusSwitchElement), new PropertyMetadata(default(bool)));
|
||||
|
||||
public static void SetHiddenElement(DependencyObject element, bool value) => element.SetValue(HiddenElementProperty, value);
|
||||
|
||||
public static bool GetHiddenElement(DependencyObject element) => (bool) element.GetValue(HiddenElementProperty);
|
||||
}
|
||||
}
|
@ -28,12 +28,12 @@
|
||||
<Grid ClipToBounds="True">
|
||||
<ListBox HorizontalAlignment="Left" Name="ListBoxMain" BorderThickness="0" ItemsSource="{Binding ItemsSource,ElementName=UserControlMain}" Style="{StaticResource StackPanelListBox}"></ListBox>
|
||||
<Grid Name="GridTop" Opacity="0">
|
||||
<Button Click="ButtonPrev_OnClick" Name="ButtonPrev" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0" Style="{StaticResource ButtonOpacityStyle}">
|
||||
<Button Click="ButtonPrev_OnClick" Name="ButtonPrev" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0" Style="{StaticResource ButtonCustom}">
|
||||
<Border Width="50" Height="100" Background="#44000000" CornerRadius="2">
|
||||
<Path Margin="16" Fill="White" Style="{StaticResource LeftPathStyle}"></Path>
|
||||
</Border>
|
||||
</Button>
|
||||
<Button Click="ButtonNext_OnClick" Name="ButtonNext" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,30,0" Style="{StaticResource ButtonOpacityStyle}">
|
||||
<Button Click="ButtonNext_OnClick" Name="ButtonNext" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,30,0" Style="{StaticResource ButtonCustom}">
|
||||
<Border Width="50" Height="100" Background="#44000000" CornerRadius="2">
|
||||
<Path Margin="16" Fill="White" Style="{StaticResource RightPathStyle}"></Path>
|
||||
</Border>
|
||||
|
@ -219,7 +219,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
var button = new Button
|
||||
{
|
||||
Style = TryFindResource("ButtonOpacityStyle") as Style,
|
||||
Style = TryFindResource("ButtonCustom") as Style,
|
||||
Content = new Border
|
||||
{
|
||||
Width = 10,
|
||||
|
@ -303,7 +303,7 @@ namespace HandyControl.Controls
|
||||
var button = new Button
|
||||
{
|
||||
Margin = new Thickness(0, 0, 12, 12),
|
||||
Style = FindResource("ButtonOpacityStyle") as Style,
|
||||
Style = FindResource("ButtonCustom") as Style,
|
||||
Content = new Border
|
||||
{
|
||||
Background = brush,
|
||||
|
@ -45,14 +45,14 @@
|
||||
<TextBlock Text="{Binding Message,ElementName=UserControlThis}" Style="{StaticResource TextBlockDefault}" HorizontalAlignment="Left" TextWrapping="Wrap"></TextBlock>
|
||||
<TextBlock Text="{Binding Time,ElementName=UserControlThis,StringFormat=yyyy/MM/dd HH:mm:ss}" Style="{StaticResource TextBlockDefault}" Foreground="{StaticResource SecondaryTextBrush}" HorizontalAlignment="Left" Margin="0,4,0,0"></TextBlock>
|
||||
</StackPanel>
|
||||
<Button Grid.Row="0" Visibility="Collapsed" Margin="11,0" Name="ButtonClose" Click="ButtonClose_OnClick" Grid.Column="2" Background="Transparent" Style="{StaticResource ButtonOpacityStyle}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="18" Height="18">
|
||||
<Button Grid.Row="0" Visibility="Collapsed" Margin="11,0" Name="ButtonClose" Click="ButtonClose_OnClick" Grid.Column="2" Background="Transparent" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="18" Height="18">
|
||||
<Path Data="{StaticResource ErrorGeometry}" Stretch="Uniform" Fill="{StaticResource SecondaryTextBrush}"></Path>
|
||||
</Button>
|
||||
<StackPanel Name="PanelMore" IsEnabled="False" Visibility="Collapsed" Orientation="Horizontal" Grid.Row="1" Grid.ColumnSpan="3" Height="28" Grid.Column="0">
|
||||
<Button Click="ButtonCancel_OnClick" Style="{StaticResource ButtonOpacityStyle}" Width="160">
|
||||
<Button Click="ButtonCancel_OnClick" Style="{StaticResource ButtonCustom}" Width="160">
|
||||
<TextBlock Text="取消" HorizontalAlignment="Center" Foreground="{StaticResource DangerBrush}"></TextBlock>
|
||||
</Button>
|
||||
<Button Click="ButtonOk_OnClick" Style="{StaticResource ButtonOpacityStyle}" Width="160">
|
||||
<Button Click="ButtonOk_OnClick" Style="{StaticResource ButtonCustom}" Width="160">
|
||||
<TextBlock Text="确定" HorizontalAlignment="Center" Foreground="{StaticResource PrimaryBrush}"></TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
@ -56,9 +56,9 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding PlaceHolder,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" HorizontalAlignment="Left" Padding="10,0" FontSize="14" Visibility="{Binding Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource String2VisibilityConverter}}" VerticalAlignment="Center" Foreground="{DynamicResource ThirdlyTextBrush}"/>
|
||||
<TextBox Grid.Column="0" MouseWheel="MyTextBox_OnMouseWheel" HorizontalContentAlignment="{Binding HorizontalTextAlignment,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" TextChanged="InputBox_OnTextChanged" MouseLeave="InputBox_OnMouseLeave" MouseEnter="InputBox_OnMouseEnter" GotFocus="InputBox_OnGotFocus" LostFocus="InputBox_OnLostFocus" Name="MyTextBox" Margin="4,0" BorderThickness="0" VerticalContentAlignment="Center" Padding="{Binding TextPadding,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" Text="{Binding Value,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},UpdateSourceTrigger=PropertyChanged}" Background="{x:Null}"></TextBox>
|
||||
<Button Padding="7" Visibility="{Binding Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource String2VisibilityReConverter}}" Focusable="True" Grid.Column="1" Name="ButtonClear" Click="ButtonClear_OnClick" Foreground="{DynamicResource ThirdlyTextBrush}" controls:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Style="{StaticResource ButtonIconTransparent}" Width="36" HorizontalAlignment="Right"></Button>
|
||||
<Button Visibility="{Binding ShowUpDownButton,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource Boolean2VisibilityConverter}}" Padding="7,7,7,3" Focusable="True" Grid.Column="2" Click="ButtonUp_OnClick" Foreground="{DynamicResource ThirdlyTextBrush}" controls:IconElement.Geometry="{StaticResource UpGeometry}" Style="{StaticResource ButtonIconTransparent}" Width="36" HorizontalAlignment="Right" VerticalAlignment="Top" Height="17"></Button>
|
||||
<Button Visibility="{Binding ShowUpDownButton,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource Boolean2VisibilityConverter}}" Padding="7,3,7,7" Focusable="True" Grid.Column="2" Click="ButtonDown_OnClick" Foreground="{DynamicResource ThirdlyTextBrush}" controls:IconElement.Geometry="{StaticResource DownGeometry}" Style="{StaticResource ButtonIconTransparent}" Width="36" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="17"></Button>
|
||||
<Button Padding="7" Visibility="{Binding Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource String2VisibilityReConverter}}" Focusable="True" Grid.Column="1" Name="ButtonClear" Click="ButtonClear_OnClick" Foreground="{DynamicResource ThirdlyTextBrush}" controls:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Style="{StaticResource ButtonIcon}" Width="36" HorizontalAlignment="Right"></Button>
|
||||
<Button Visibility="{Binding ShowUpDownButton,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource Boolean2VisibilityConverter}}" Padding="7,7,7,3" Focusable="True" Grid.Column="2" Click="ButtonUp_OnClick" Foreground="{DynamicResource ThirdlyTextBrush}" controls:IconElement.Geometry="{StaticResource UpGeometry}" Style="{StaticResource ButtonIcon}" Width="36" HorizontalAlignment="Right" VerticalAlignment="Top" Height="17"></Button>
|
||||
<Button Visibility="{Binding ShowUpDownButton,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource Boolean2VisibilityConverter}}" Padding="7,3,7,7" Focusable="True" Grid.Column="2" Click="ButtonDown_OnClick" Foreground="{DynamicResource ThirdlyTextBrush}" controls:IconElement.Geometry="{StaticResource DownGeometry}" Style="{StaticResource ButtonIcon}" Width="36" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="17"></Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
@ -54,7 +54,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding PlaceHolder,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" HorizontalAlignment="Left" Padding="10,0" FontSize="14" Visibility="{Binding Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource String2VisibilityConverter}}" VerticalAlignment="Center" Foreground="{DynamicResource ThirdlyTextBrush}"/>
|
||||
<TextBox MaxLines="1" MaxLength="{Binding MaxLength,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" HorizontalContentAlignment="{Binding HorizontalTextAlignment,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" Grid.Column="0" TextChanged="InputBox_OnTextChanged" MouseLeave="InputBox_OnMouseLeave" MouseEnter="InputBox_OnMouseEnter" GotFocus="InputBox_OnGotFocus" LostFocus="InputBox_OnLostFocus" Name="MyTextBox" Margin="4,0" BorderThickness="0" VerticalContentAlignment="Center" Padding="{Binding TextPadding,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}}" Text="{Binding Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},UpdateSourceTrigger=PropertyChanged}" Background="{x:Null}"></TextBox>
|
||||
<Button Padding="7" Visibility="{Binding Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource String2VisibilityReConverter}}" Focusable="True" Grid.Column="1" Name="ButtonClear" Click="ButtonClear_OnClick" Foreground="{DynamicResource ThirdlyTextBrush}" controls:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Style="{StaticResource ButtonIconTransparent}" Width="36" HorizontalAlignment="Right"></Button>
|
||||
<Button Padding="7" Visibility="{Binding Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Converter={StaticResource String2VisibilityReConverter}}" Focusable="True" Grid.Column="1" Name="ButtonClear" Click="ButtonClear_OnClick" Foreground="{DynamicResource ThirdlyTextBrush}" controls:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Style="{StaticResource ButtonIcon}" Width="36" HorizontalAlignment="Right"></Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--向左切换-->
|
||||
<Button Name="LeftButton" Click="ButtonPrev_OnClick" Margin="5,0" VerticalAlignment="Center" Background="{x:Null}" Style="{StaticResource ButtonOpacityStyle}">
|
||||
<Button Name="LeftButton" Click="ButtonPrev_OnClick" Margin="5,0" VerticalAlignment="Center" Background="{x:Null}" Style="{StaticResource ButtonCustom}">
|
||||
<Border CornerRadius="2" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Width="30" Height="30" Background="White">
|
||||
<Path Margin="10" Fill="{StaticResource PrimaryTextBrush}" Style="{StaticResource LeftPathStyle}"></Path>
|
||||
</Border>
|
||||
@ -31,7 +31,7 @@
|
||||
<RadioButton Name="LastButton" Tag="10" Style="{StaticResource PaginationButtonStyle}"></RadioButton>
|
||||
</StackPanel>
|
||||
<!--向右切换-->
|
||||
<Button Grid.Column="2" Name="RightButton" Click="ButtonNext_OnClick" Margin="5,0" VerticalAlignment="Center" Background="{x:Null}" Style="{StaticResource ButtonOpacityStyle}">
|
||||
<Button Grid.Column="2" Name="RightButton" Click="ButtonNext_OnClick" Margin="5,0" VerticalAlignment="Center" Background="{x:Null}" Style="{StaticResource ButtonCustom}">
|
||||
<Border BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" CornerRadius="2" Width="30" Height="30" Background="White">
|
||||
<Path Margin="10" Fill="{StaticResource PrimaryTextBrush}" Style="{StaticResource RightPathStyle}" RenderTransformOrigin="0.5,0.5"></Path>
|
||||
</Border>
|
||||
|
@ -44,22 +44,22 @@
|
||||
</Border>
|
||||
<Border UseLayoutRounding="True" Name="BorderBottom" Opacity="0" CornerRadius="4,4,0,0" Grid.Row="1" HorizontalAlignment="Center" Background="#44000000">
|
||||
<StackPanel Margin="30,10" VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<Button Click="ButtonSave_OnClick" Margin="6,0" Style="{StaticResource ButtonIconTransparent}" controls:IconElement.Geometry="{StaticResource SaveGeometry}" Padding="3"></Button>
|
||||
<Button Click="ButtonWindowsOpen_OnClick" Margin="6,0" Style="{StaticResource ButtonIconTransparent}" controls:IconElement.Geometry="{StaticResource WindowsGeometry}" Padding="3"></Button>
|
||||
<Button Click="ButtonSave_OnClick" Margin="6,0" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource SaveGeometry}" Padding="3"></Button>
|
||||
<Button Click="ButtonWindowsOpen_OnClick" Margin="6,0" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource WindowsGeometry}" Padding="3"></Button>
|
||||
|
||||
<Border Margin="10,2" Style="{StaticResource BorderHorizontallySplitter}"></Border>
|
||||
|
||||
<Button Click="ButtonReduce_OnClick" Margin="6,0" Style="{StaticResource ButtonIconTransparent}" controls:IconElement.Geometry="{StaticResource ReduceGeometry}" Padding="3"></Button>
|
||||
<Button Click="ButtonReduce_OnClick" Margin="6,0" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource ReduceGeometry}" Padding="3"></Button>
|
||||
<TextBlock Margin="6,0" Text="{Binding ScaleStr,ElementName=UserControlMain}" Style="{StaticResource TextBlockSubTitle}" Foreground="{DynamicResource TextIconBrush}"></TextBlock>
|
||||
<Button Click="ButtonEnlarge_OnClick" Margin="6,0" Style="{StaticResource ButtonIconTransparent}" controls:IconElement.Geometry="{StaticResource EnlargeGeometry}" Padding="3"></Button>
|
||||
<Button Background="Transparent" Click="ButtonActual_OnClick" Margin="6,0" Style="{StaticResource ButtonOpacityStyle}" Foreground="White">
|
||||
<Button Click="ButtonEnlarge_OnClick" Margin="6,0" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource EnlargeGeometry}" Padding="3"></Button>
|
||||
<Button Background="Transparent" Click="ButtonActual_OnClick" Margin="6,0" Style="{StaticResource ButtonCustom}" Foreground="White">
|
||||
<Border BorderThickness="1" BorderBrush="White" Padding="2">
|
||||
<TextBlock Text="1:1"></TextBlock>
|
||||
</Border>
|
||||
</Button>
|
||||
<Border Margin="10,2" Style="{StaticResource BorderHorizontallySplitter}"></Border>
|
||||
<Button Click="ButtonRotateLeft_OnClick" Margin="6,0" Style="{StaticResource ButtonIconTransparent}" controls:IconElement.Geometry="{StaticResource RotateLeftGeometry}" Padding="3"></Button>
|
||||
<Button Click="ButtonRotateRight_OnClick" Margin="6,0" Style="{StaticResource ButtonIconTransparent}" controls:IconElement.Geometry="{StaticResource RotateLeftGeometry}" Padding="3" RenderTransformOrigin="0.5,0.5">
|
||||
<Button Click="ButtonRotateLeft_OnClick" Margin="6,0" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource RotateLeftGeometry}" Padding="3"></Button>
|
||||
<Button Click="ButtonRotateRight_OnClick" Margin="6,0" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource RotateLeftGeometry}" Padding="3" RenderTransformOrigin="0.5,0.5">
|
||||
<Button.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleY="1" ScaleX="-1"/>
|
||||
@ -75,7 +75,7 @@
|
||||
<TextBlock Text="{Binding ImgPath,ElementName=UserControlMain}" Foreground="White" Margin="10,0,0,0"></TextBlock>
|
||||
<TextBlock Text="{Binding ImgSize,ElementName=UserControlMain,Converter={StaticResource Long2FileSizeConverter}}" Foreground="White" Margin="30,0,0,0"></TextBlock>
|
||||
</StackPanel>
|
||||
<Button WindowChrome.IsHitTestVisibleInChrome="True" Click="ButtonClose_OnClick" Background="Red" Grid.Row="0" Padding="14" controls:IconElement.Geometry="{StaticResource DeleteGeometry}" Style="{StaticResource ButtonIconTransparent}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="40" Height="40"></Button>
|
||||
<Button WindowChrome.IsHitTestVisibleInChrome="True" Click="ButtonClose_OnClick" Background="Red" Grid.Row="0" Padding="14" controls:IconElement.Geometry="{StaticResource DeleteGeometry}" Style="{StaticResource ButtonIcon}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="40" Height="40"></Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</controls:WindowBorderless>
|
@ -36,7 +36,7 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="TitleBlock" Background="Transparent" MouseLeftButtonDown="TitleBlock_OnMouseLeftButtonDown" Padding="10,6" FontSize="14" Foreground="White" Text="{Binding Title,ElementName=MyWindow}" VerticalAlignment="Center" TextWrapping="Wrap" TextTrimming="WordEllipsis"/>
|
||||
<Button Foreground="White" Grid.Column="1" controls:BackgroundSwitchElement.MouseHoverBackground="Red" controls:BackgroundSwitchElement.MouseDownBackground="Red" Click="CloseButton_OnClick" IsCancel="True" Name="CloseButton" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Height="28" Style="{StaticResource ButtonOpacityStyle}" Width="44" controls:IconElement.Geometry="{StaticResource CloseGeometry}" Padding="9">
|
||||
<Button Foreground="White" Grid.Column="1" controls:BackgroundSwitchElement.MouseHoverBackground="Red" controls:BackgroundSwitchElement.MouseDownBackground="Red" Click="CloseButton_OnClick" IsCancel="True" Name="CloseButton" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Height="28" Style="{StaticResource ButtonCustom}" Width="44" controls:IconElement.Geometry="{StaticResource CloseGeometry}" Padding="9">
|
||||
<Path Fill="{Binding ElementName=CloseButton,Path=Foreground}" Style="{StaticResource ClosePathStyle}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
@ -44,12 +44,12 @@
|
||||
<StackPanel>
|
||||
<TextBlock Text="" MinHeight="110" Name="MyTextBlock" TextAlignment="Center" FontSize="16" Padding="32" Foreground="#252525" MaxWidth="300" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Background="White"/>
|
||||
<StackPanel Name="MyStackPanel" Margin="0,0,0,32" Orientation="Horizontal" Background="White" HorizontalAlignment="Center">
|
||||
<Button Name="ButtonCancle" Visibility="{Binding ShowCancel,ElementName=MyWindow,Converter={StaticResource Boolean2VisibilityConverter}}" Click="ButtonCancle_OnClick" Margin="0,0,16,0" Background="Transparent" Style="{StaticResource ButtonOpacityStyle}">
|
||||
<Button Name="ButtonCancle" Visibility="{Binding ShowCancel,ElementName=MyWindow,Converter={StaticResource Boolean2VisibilityConverter}}" Click="ButtonCancle_OnClick" Margin="0,0,16,0" Background="Transparent" Style="{StaticResource ButtonCustom}">
|
||||
<Border BorderThickness="1" BorderBrush="{DynamicResource PrimaryBrush}" MinWidth="80" Height="30" CornerRadius="4" Background="White">
|
||||
<TextBlock FontSize="16" Text="{x:Static langs:Lang.Cancel}" Foreground="{DynamicResource PrimaryBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
|
||||
</Border>
|
||||
</Button>
|
||||
<Button IsDefault="True" Click="ButtonOk_OnClick" Background="Transparent" Style="{DynamicResource ButtonOpacityStyle}">
|
||||
<Button IsDefault="True" Click="ButtonOk_OnClick" Background="Transparent" Style="{DynamicResource ButtonCustom}">
|
||||
<Border MinWidth="80" Height="30" CornerRadius="4" Background="{DynamicResource PrimaryBrush}">
|
||||
<TextBlock FontSize="16" Text="{x:Static langs:Lang.Confirm}" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
|
||||
</Border>
|
||||
|
@ -287,10 +287,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\Base\ToggleButtonSwitchBaseStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\Border.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
@ -10,5 +10,5 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("1.2.2.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.2.0")]
|
||||
[assembly: AssemblyVersion("1.2.2.1")]
|
||||
[assembly: AssemblyFileVersion("1.2.2.1")]
|
||||
|
@ -7,34 +7,6 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="ButtonBaseStyle" BasedOn="{StaticResource ButtonBaseBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DarkMaskBrush}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Grid>
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"></Border>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Opacity" Value=".9"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Opacity" Value=".6"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value=".2"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ButtonIconBaseStyle" BasedOn="{StaticResource ButtonBaseBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DarkMaskBrush}"/>
|
||||
<Setter Property="controls:IconElement.Angle" Value="0"/>
|
||||
@ -44,17 +16,27 @@
|
||||
<Grid>
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"></Border>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentControl HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
||||
<Path Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}" RenderTransformOrigin="0.5,0.5">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
|
||||
<Path x:Name="PathMain" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}" RenderTransformOrigin="0.5,0.5">
|
||||
<Path.RenderTransform>
|
||||
<TransformGroup>
|
||||
<RotateTransform Angle="{Binding Path=(controls:IconElement.Angle),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</TransformGroup>
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
</ContentControl>
|
||||
<ContentPresenter x:Name="ContentPresenterMain" VerticalAlignment="Center" Margin="6,0,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Content" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ContentPresenterMain"/>
|
||||
</Trigger>
|
||||
<Trigger Property="controls:IconElement.Geometry" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="PathMain"/>
|
||||
<Setter Property="Margin" Value="0" TargetName="ContentPresenterMain"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
@ -14,8 +14,20 @@
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Grid>
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"></Border>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<!--<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Border>-->
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
|
||||
<Path x:Name="PathMain" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}" RenderTransformOrigin="0.5,0.5">
|
||||
<Path.RenderTransform>
|
||||
<TransformGroup>
|
||||
<RotateTransform Angle="{Binding Path=(controls:IconElement.Angle),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</TransformGroup>
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
<ContentPresenter x:Name="ContentPresenterMain" VerticalAlignment="Center" Margin="6,0,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Visibility="Collapsed" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="BorderChecked" BorderThickness="4" BorderBrush="{TemplateBinding BorderBrush}"></Border>
|
||||
</Grid>
|
||||
@ -23,6 +35,195 @@
|
||||
<Trigger Property="IsChecked" Value="true">
|
||||
<Setter TargetName="BorderChecked" Property="Visibility" Value="Visible"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Content" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ContentPresenterMain"/>
|
||||
</Trigger>
|
||||
<Trigger Property="controls:IconElement.Geometry" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="PathMain"/>
|
||||
<Setter Property="Margin" Value="0" TargetName="ContentPresenterMain"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Opacity" Value=".9"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Opacity" Value=".6"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value=".2"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!--引用自https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit-->
|
||||
<Style x:Key="ToggleButtonSwitchBaseStyle" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="0 1 0 0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<ControlTemplate.Resources>
|
||||
<SineEase x:Key="RippleEasingFunction" EasingMode="EaseInOut"/>
|
||||
<Storyboard x:Key="ShowRipple">
|
||||
<DoubleAnimation Storyboard.TargetName="RippleThumb" Storyboard.TargetProperty="Opacity"
|
||||
EasingFunction="{StaticResource RippleEasingFunction}"
|
||||
To="0.26" Duration="0"/>
|
||||
<DoubleAnimation Storyboard.TargetName="RippleThumb" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
|
||||
EasingFunction="{StaticResource RippleEasingFunction}"
|
||||
From="1" To="2.5" Duration="0:0:0.2"/>
|
||||
<DoubleAnimation Storyboard.TargetName="RippleThumb" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
|
||||
EasingFunction="{StaticResource RippleEasingFunction}"
|
||||
From="1" To="2.5" Duration="0:0:0.2"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="HideRipple">
|
||||
<DoubleAnimation Storyboard.TargetName="RippleThumb" Storyboard.TargetProperty="Opacity"
|
||||
EasingFunction="{StaticResource RippleEasingFunction}"
|
||||
To="0" Duration="0:0:0.3"/>
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Viewbox Width="34">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CheckStates">
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition From="*" To="Checked">
|
||||
<Storyboard>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ThumbHolder">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="23.5">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<QuadraticEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
<VisualTransition From="Checked" To="Unchecked">
|
||||
<Storyboard>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ThumbHolder">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="23.5"/>
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<QuadraticEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
</VisualStateGroup.Transitions>
|
||||
<VisualState x:Name="Checked">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ThumbHolder"
|
||||
Duration="0" To="23.5" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unchecked">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ThumbHolder"
|
||||
Duration="0" To="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Rectangle x:Name="Track" Fill="Black" HorizontalAlignment="Left" Height="15" Margin="4.211,5,4.211,0" Stroke="{x:Null}" VerticalAlignment="Top" Width="40" RadiusY="7.5" RadiusX="7.5" Opacity="0.26"/>
|
||||
|
||||
<Grid x:Name="ThumbHolder"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<Ellipse x:Name="RippleThumb"
|
||||
Fill="{DynamicResource PrimaryBrush}"
|
||||
Height="25" Width="25"
|
||||
IsHitTestVisible="False"
|
||||
Opacity="0.26"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Ellipse.RenderTransform>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1"/>
|
||||
</Ellipse.RenderTransform>
|
||||
</Ellipse>
|
||||
<AdornerDecorator>
|
||||
<Ellipse x:Name="Thumb"
|
||||
Fill="#FFFAFAFA" Stroke="{x:Null}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Width="25" Height="25"
|
||||
Margin="0,0,0,0"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Effect="{DynamicResource EffectShadow1}">
|
||||
</Ellipse>
|
||||
</AdornerDecorator>
|
||||
<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
x:Name="ContentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
FlowDirection="LeftToRight"/>
|
||||
<Grid.RenderTransform>
|
||||
<TranslateTransform X="0" Y="0"/>
|
||||
</Grid.RenderTransform>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="Thumb" Property="Fill" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Background}" />
|
||||
<Setter TargetName="Track" Property="Fill" Value="{DynamicResource PrimaryBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource SecondaryTextBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="False">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Button.IsDefaulted" Value="true"/>
|
||||
<Trigger Property="IsMouseOver" Value="true"/>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource ShowRipple}"/>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource HideRipple}"/>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" Value=".2" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToggleButtonIconBaseStyle" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}"/>
|
||||
<Setter Property="Width" Value="{DynamicResource DefaultControlHeight}"/>
|
||||
<Setter Property="Height" Value="{DynamicResource DefaultControlHeight}"/>
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="controls:IconSwitchElement.Geometry" Value="{x:Null}"/>
|
||||
<Setter Property="controls:IconSwitchElement.GeometrySelected" Value="{x:Null}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DarkMaskBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Grid>
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"></Border>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentControl HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
||||
<Path x:Name="PathIcon" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconSwitchElement.Geometry}"></Path>
|
||||
</ContentControl>
|
||||
</Border>
|
||||
<Border Visibility="Collapsed" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="BorderChecked" BorderThickness="4" BorderBrush="{TemplateBinding BorderBrush}"></Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="PathIcon" Property="Data" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(controls:IconSwitchElement.GeometrySelected)}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
@ -1,186 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<!--引用自https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit-->
|
||||
<Style x:Key="ToggleButtonSwitchBaseStyle" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="0 1 0 0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<ControlTemplate.Resources>
|
||||
<SineEase x:Key="RippleEasingFunction" EasingMode="EaseInOut"/>
|
||||
<Storyboard x:Key="ShowRipple">
|
||||
<DoubleAnimation Storyboard.TargetName="RippleThumb" Storyboard.TargetProperty="Opacity"
|
||||
EasingFunction="{StaticResource RippleEasingFunction}"
|
||||
To="0.26" Duration="0"/>
|
||||
<DoubleAnimation Storyboard.TargetName="RippleThumb" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
|
||||
EasingFunction="{StaticResource RippleEasingFunction}"
|
||||
From="1" To="2.5" Duration="0:0:0.2"/>
|
||||
<DoubleAnimation Storyboard.TargetName="RippleThumb" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
|
||||
EasingFunction="{StaticResource RippleEasingFunction}"
|
||||
From="1" To="2.5" Duration="0:0:0.2"/>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="HideRipple">
|
||||
<DoubleAnimation Storyboard.TargetName="RippleThumb" Storyboard.TargetProperty="Opacity"
|
||||
EasingFunction="{StaticResource RippleEasingFunction}"
|
||||
To="0" Duration="0:0:0.3"/>
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Viewbox Width="34">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CheckStates">
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition From="*" To="Checked">
|
||||
<Storyboard>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ThumbHolder">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="23.5">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<QuadraticEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
<VisualTransition From="Checked" To="Unchecked">
|
||||
<Storyboard>
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ThumbHolder">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="23.5"/>
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0">
|
||||
<EasingDoubleKeyFrame.EasingFunction>
|
||||
<QuadraticEase EasingMode="EaseOut"/>
|
||||
</EasingDoubleKeyFrame.EasingFunction>
|
||||
</EasingDoubleKeyFrame>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualTransition>
|
||||
</VisualStateGroup.Transitions>
|
||||
<VisualState x:Name="Checked">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ThumbHolder"
|
||||
Duration="0" To="23.5" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unchecked">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ThumbHolder"
|
||||
Duration="0" To="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Rectangle x:Name="Track" Fill="Black" HorizontalAlignment="Left" Height="15" Margin="4.211,5,4.211,0" Stroke="{x:Null}" VerticalAlignment="Top" Width="40" RadiusY="7.5" RadiusX="7.5" Opacity="0.26"/>
|
||||
|
||||
<Grid x:Name="ThumbHolder"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<Ellipse x:Name="RippleThumb"
|
||||
Fill="{DynamicResource LightPrimaryBrush}"
|
||||
Height="25" Width="25"
|
||||
IsHitTestVisible="False"
|
||||
Opacity="0.26"
|
||||
Margin="0"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Ellipse.RenderTransform>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1"/>
|
||||
</Ellipse.RenderTransform>
|
||||
</Ellipse>
|
||||
<AdornerDecorator>
|
||||
<Ellipse x:Name="Thumb"
|
||||
Fill="#FFFAFAFA" Stroke="{x:Null}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Width="25" Height="25"
|
||||
Margin="0,0,0,0"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Effect="{DynamicResource EffectShadow1}">
|
||||
</Ellipse>
|
||||
</AdornerDecorator>
|
||||
<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
x:Name="ContentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
FlowDirection="LeftToRight"/>
|
||||
<Grid.RenderTransform>
|
||||
<TranslateTransform X="0" Y="0"/>
|
||||
</Grid.RenderTransform>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="Thumb" Property="Fill" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Background}" />
|
||||
<Setter TargetName="Track" Property="Fill" Value="{DynamicResource LightPrimaryBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource SecondaryTextBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="False">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Button.IsDefaulted" Value="true"/>
|
||||
<Trigger Property="IsMouseOver" Value="true"/>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource ShowRipple}"/>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource HideRipple}"/>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" Value=".2" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToggleButtonIconBaseStyle" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}"/>
|
||||
<Setter Property="Width" Value="{DynamicResource DefaultControlHeight}"/>
|
||||
<Setter Property="Height" Value="{DynamicResource DefaultControlHeight}"/>
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="controls:IconSwitchElement.Geometry" Value="{x:Null}"/>
|
||||
<Setter Property="controls:IconSwitchElement.GeometrySelected" Value="{x:Null}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DarkMaskBrush}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Grid>
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"></Border>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentControl HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
||||
<Path x:Name="PathIcon" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconSwitchElement.Geometry}"></Path>
|
||||
</ContentControl>
|
||||
</Border>
|
||||
<Border Visibility="Collapsed" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="BorderChecked" BorderThickness="4" BorderBrush="{TemplateBinding BorderBrush}"></Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="PathIcon" Property="Data" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(controls:IconSwitchElement.GeometrySelected)}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Opacity" Value=".9"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Opacity" Value=".6"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value=".2"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
@ -3,20 +3,28 @@
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Base/ButtonBaseStyle.xaml"/>
|
||||
<ResourceDictionary Source="Base/ButtonBaseStyle.xaml"></ResourceDictionary>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!--Button-->
|
||||
<Style BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource DefaultBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource BorderBrush}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="ButtonPrimary" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Style>
|
||||
<Style x:Key="ButtonSuccess" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DarkSuccessBrush}"/>
|
||||
</Style>
|
||||
<Style x:Key="ButtonInfo" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
|
||||
@ -28,8 +36,7 @@
|
||||
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
|
||||
</Style>
|
||||
|
||||
<!--ButtonIcon-->
|
||||
<Style x:Key="ButtonIconTransparent" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Style x:Key="ButtonIcon" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
@ -50,29 +57,8 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="ButtonIconDefault" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource DefaultBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
</Style>
|
||||
<Style x:Key="ButtonIconPrimary" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
||||
</Style>
|
||||
<Style x:Key="ButtonIconSuccess" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DarkSuccessBrush}"/>
|
||||
</Style>
|
||||
<Style x:Key="ButtonIconInfo" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
|
||||
</Style>
|
||||
<Style x:Key="ButtonIconWarning" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
|
||||
</Style>
|
||||
<Style x:Key="ButtonIconDanger" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ButtonOpacityStyle" TargetType="{x:Type Button}">
|
||||
<Style x:Key="ButtonCustom" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="{x:Null}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<ToggleButton Padding="10,0,0,0" Foreground="{TemplateBinding Foreground}" Grid.ColumnSpan="2" HorizontalContentAlignment="Stretch" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Width="{TemplateBinding Width}" Height="{TemplateBinding MinHeight}" Style="{StaticResource ToggleButtonOpacityStyle}">
|
||||
<ToggleButton Padding="10,0,0,0" Foreground="{TemplateBinding Foreground}" Grid.ColumnSpan="2" HorizontalContentAlignment="Stretch" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Width="{TemplateBinding Width}" Height="{TemplateBinding MinHeight}" Style="{StaticResource ToggleButtonCustom}">
|
||||
<ToggleButton.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Window.xaml"/>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
<!--<ResourceDictionary Source="ToggleButton.xaml"/>-->
|
||||
<ResourceDictionary Source="ToggleButton.xaml"/>
|
||||
<ResourceDictionary Source="TextBlock.xaml"/>
|
||||
<!--<ResourceDictionary Source="CheckBox.xaml"/>-->
|
||||
<!--<ResourceDictionary Source="RadioButton.xaml"/>-->
|
||||
|
@ -54,7 +54,7 @@
|
||||
</LinearGradientBrush>
|
||||
</ContentPresenter.OpacityMask>
|
||||
</ContentPresenter>
|
||||
<Button Grid.Column="1" x:Name="PART_CloseButton" Visibility="{Binding ShowCloseButton,RelativeSource={RelativeSource FindAncestor,AncestorType=controls:TabControl},Converter={StaticResource Boolean2VisibilityConverter}}" Background="Transparent" Style="{StaticResource ButtonOpacityStyle}" Width="28">
|
||||
<Button Grid.Column="1" x:Name="PART_CloseButton" Visibility="{Binding ShowCloseButton,RelativeSource={RelativeSource FindAncestor,AncestorType=controls:TabControl},Converter={StaticResource Boolean2VisibilityConverter}}" Background="Transparent" Style="{StaticResource ButtonCustom}" Width="28">
|
||||
<Path Fill="{DynamicResource PrimaryTextBrush}" Width="8" Height="8" Style="{StaticResource ClosePathStyle}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
@ -4,13 +4,21 @@
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Base/ToggleButtonBaseStyle.xaml"/>
|
||||
<ResourceDictionary Source="Base/ToggleButtonSwitchBaseStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!--普通-->
|
||||
<Style BasedOn="{StaticResource ToggleButtonBaseStyle}" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Background" Value="{DynamicResource DefaultBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource BorderBrush}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToggleButtonPrimary" BasedOn="{StaticResource ToggleButtonBaseStyle}" TargetType="{x:Type ToggleButton}">
|
||||
@ -37,6 +45,15 @@
|
||||
<Style x:Key="ToggleButtonIcon" BasedOn="{StaticResource ToggleButtonIconBaseStyle}" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Background" Value="{DynamicResource DefaultBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource BorderBrush}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ToggleButtonIconPrimary" BasedOn="{StaticResource ToggleButtonIconBaseStyle}" TargetType="{x:Type ToggleButton}">
|
||||
@ -85,7 +102,7 @@
|
||||
<Style x:Key="ToggleButtonSwitch" BasedOn="{StaticResource ToggleButtonSwitchBaseStyle}" TargetType="{x:Type ToggleButton}"></Style>
|
||||
|
||||
<!--自定义-->
|
||||
<Style x:Key="ToggleButtonOpacityStyle" TargetType="{x:Type ToggleButton}">
|
||||
<Style x:Key="ToggleButtonCustom" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
@ -100,7 +117,7 @@
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Border x:Name="Chrome" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
<ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
<ContentPresenter Name="UnCheckedElement" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
<ContentPresenter Name="CheckedElement" Visibility="Collapsed" Content="{Binding Path=(controls:StatusSwitchElement.CheckedElement),RelativeSource={RelativeSource TemplatedParent}}"></ContentPresenter>
|
||||
</Grid>
|
||||
</Border>
|
||||
@ -114,6 +131,13 @@
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible" TargetName="CheckedElement"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="controls:StatusSwitchElement.HiddenElement" Value="True"/>
|
||||
<Condition Property="IsChecked" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="UnCheckedElement"/>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value=".2"/>
|
||||
</Trigger>
|
||||
|
@ -44,10 +44,10 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="28" Style="{StaticResource ButtonIconTransparent}" Width="44" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" Padding="17,0"></Button>
|
||||
<Button Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="28" Style="{StaticResource ButtonIconTransparent}" Width="44" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" Padding="17,0"></Button>
|
||||
<Button Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="28" Style="{StaticResource ButtonIconTransparent}" Width="44" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" Padding="17,0"></Button>
|
||||
<Button Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="28" Style="{StaticResource ButtonIconTransparent}" Width="44" controls:IconElement.Geometry="{StaticResource CloseGeometry}" Padding="9"></Button>
|
||||
<Button Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" Padding="17,0"></Button>
|
||||
<Button Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" Padding="17,0"></Button>
|
||||
<Button Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" Padding="17,0"></Button>
|
||||
<Button Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource CloseGeometry}" Padding="9"></Button>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
@ -12,5 +12,5 @@ using System.Windows;
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||
[assembly: AssemblyVersion("1.2.2.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.2.0")]
|
||||
[assembly: AssemblyVersion("1.2.2.1")]
|
||||
[assembly: AssemblyFileVersion("1.2.2.1")]
|
||||
|
18
HandyControlDemo/Properties/Langs/Lang.Designer.cs
generated
18
HandyControlDemo/Properties/Langs/Lang.Designer.cs
generated
@ -96,6 +96,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 日历 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Calendar {
|
||||
get {
|
||||
return ResourceManager.GetString("Calendar", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 轮播 的本地化字符串。
|
||||
/// </summary>
|
||||
@ -114,6 +123,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 时钟 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Clock {
|
||||
get {
|
||||
return ResourceManager.GetString("Clock", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 颜色拾取器 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -237,4 +237,10 @@
|
||||
<data name="Complete" xml:space="preserve">
|
||||
<value>Complete</value>
|
||||
</data>
|
||||
<data name="Clock" xml:space="preserve">
|
||||
<value>Clock</value>
|
||||
</data>
|
||||
<data name="Calendar" xml:space="preserve">
|
||||
<value>Calendar</value>
|
||||
</data>
|
||||
</root>
|
@ -217,4 +217,10 @@
|
||||
<data name="Complete" xml:space="preserve">
|
||||
<value>完成</value>
|
||||
</data>
|
||||
<data name="Clock" xml:space="preserve">
|
||||
<value>时钟</value>
|
||||
</data>
|
||||
<data name="Calendar" xml:space="preserve">
|
||||
<value>日历</value>
|
||||
</data>
|
||||
</root>
|
@ -3,7 +3,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl"
|
||||
Orientation="Horizontal">
|
||||
<Button WindowChrome.IsHitTestVisibleInChrome="True" Width="28" Height="28" Style="{StaticResource ButtonOpacityStyle}">
|
||||
<Button WindowChrome.IsHitTestVisibleInChrome="True" Width="28" Height="28" Style="{StaticResource ButtonCustom}">
|
||||
<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="Click">
|
||||
<interactivity:InvokeCommandAction Command="{x:Static SystemCommands.ShowSystemMenuCommand}" />
|
||||
|
@ -15,63 +15,71 @@
|
||||
<StackPanel>
|
||||
<Button Content="{x:Static langs:Lang.Primary}" Margin="5" Style="{StaticResource ButtonPrimary}"></Button>
|
||||
<Button IsEnabled="False" Content="{x:Static langs:Lang.Primary}" Margin="5" Style="{StaticResource ButtonPrimary}"></Button>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ButtonPrimary"></TextBlock>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ButtonPrimary"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ButtonSuccess}"></Button>
|
||||
<Button IsEnabled="False" Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ButtonSuccess}"></Button>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ButtonSuccess"></TextBlock>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ButtonSuccess"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ButtonInfo}"></Button>
|
||||
<Button IsEnabled="False" Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ButtonInfo}"></Button>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ButtonInfo"></TextBlock>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ButtonInfo"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ButtonWarning}"></Button>
|
||||
<Button IsEnabled="False" Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ButtonWarning}"></Button>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ButtonWarning"></TextBlock>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ButtonWarning"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ButtonDanger}"></Button>
|
||||
<Button IsEnabled="False" Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ButtonDanger}"></Button>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ButtonDanger"></TextBlock>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ButtonDanger"></TextBlock>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemWidth="160" ItemHeight="130">
|
||||
<StackPanel>
|
||||
<Button Width="50" Padding="16,8" Margin="5" Style="{StaticResource ButtonIconDefault}" controls:IconElement.Angle="45" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"></Button>
|
||||
<Button Width="50" Padding="16,8" IsEnabled="False" Margin="5" Style="{StaticResource ButtonIconDefault}" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"></Button>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonIconPrimary(DeleteGeometry)"></TextBlock>
|
||||
<Button Width="50" Padding="16,8" Margin="5" controls:IconElement.Angle="45" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"></Button>
|
||||
<Button Width="50" Padding="16,8" IsEnabled="False" Margin="5" controls:IconElement.Angle="45" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"></Button>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="Default(DeleteGeometry)Rotate 45°"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Width="50" Margin="5" Style="{StaticResource ButtonIconPrimary}" controls:IconElement.Geometry="{StaticResource ClockGeometry}"></Button>
|
||||
<Button Width="50" IsEnabled="False" Margin="5" Style="{StaticResource ButtonIconPrimary}" controls:IconElement.Geometry="{StaticResource ClockGeometry}"></Button>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonIconPrimary(ClockGeometry)"></TextBlock>
|
||||
<Button Content="{x:Static langs:Lang.Clock}" Margin="5" Style="{StaticResource ButtonPrimary}" controls:IconElement.Geometry="{StaticResource ClockGeometry}"></Button>
|
||||
<Button Content="{x:Static langs:Lang.Clock}" IsEnabled="False" Margin="5" Style="{StaticResource ButtonPrimary}" controls:IconElement.Geometry="{StaticResource ClockGeometry}"></Button>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonPrimary(ClockGeometry)"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Width="50" Margin="5" Style="{StaticResource ButtonIconSuccess}" controls:IconElement.Geometry="{StaticResource CalendarGeometry}"></Button>
|
||||
<Button Width="50" IsEnabled="False" Margin="5" Style="{StaticResource ButtonIconSuccess}" controls:IconElement.Geometry="{StaticResource CalendarGeometry}"></Button>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonIconPrimary(CalendarGeometry)"></TextBlock>
|
||||
<Button Content="{x:Static langs:Lang.Calendar}" Margin="5" Style="{StaticResource ButtonSuccess}" controls:IconElement.Geometry="{StaticResource CalendarGeometry}"></Button>
|
||||
<Button Content="{x:Static langs:Lang.Calendar}" IsEnabled="False" Margin="5" Style="{StaticResource ButtonSuccess}" controls:IconElement.Geometry="{StaticResource CalendarGeometry}"></Button>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonSuccess(CalendarGeometry)"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Width="50" Padding="16,8" Margin="5" Style="{StaticResource ButtonIconInfo}" controls:IconElement.Geometry="{StaticResource DownGeometry}"></Button>
|
||||
<Button Width="50" Padding="16,8" IsEnabled="False" Margin="5" Style="{StaticResource ButtonIconInfo}" controls:IconElement.Geometry="{StaticResource DownGeometry}"></Button>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonIconPrimary(DownGeometry)"></TextBlock>
|
||||
<Button Width="50" Padding="16,8" Margin="5" Style="{StaticResource ButtonInfo}" controls:IconElement.Geometry="{StaticResource DownGeometry}"></Button>
|
||||
<Button Width="50" Padding="16,8" IsEnabled="False" Margin="5" Style="{StaticResource ButtonInfo}" controls:IconElement.Geometry="{StaticResource DownGeometry}"></Button>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonInfo(DownGeometry)"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Width="50" Margin="5" Style="{StaticResource ButtonIconWarning}" controls:IconElement.Geometry="{StaticResource LeftGeometry}"></Button>
|
||||
<Button Width="50" IsEnabled="False" Margin="5" Style="{StaticResource ButtonIconWarning}" controls:IconElement.Geometry="{StaticResource LeftGeometry}"></Button>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonIconPrimary(LeftGeometry)"></TextBlock>
|
||||
<Button Width="50" Margin="5" Style="{StaticResource ButtonWarning}" controls:IconElement.Geometry="{StaticResource LeftGeometry}"></Button>
|
||||
<Button Width="50" IsEnabled="False" Margin="5" Style="{StaticResource ButtonWarning}" controls:IconElement.Geometry="{StaticResource LeftGeometry}"></Button>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonWarning(LeftGeometry)"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Width="50" Padding="16,8" Margin="5" Style="{StaticResource ButtonIconDanger}" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"></Button>
|
||||
<Button Width="50" Padding="16,8" IsEnabled="False" Margin="5" Style="{StaticResource ButtonIconDanger}" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"></Button>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonIconPrimary(DeleteGeometry)"></TextBlock>
|
||||
<Button Width="50" Padding="16,8" Margin="5" Style="{StaticResource ButtonDanger}" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"></Button>
|
||||
<Button Width="50" Padding="16,8" IsEnabled="False" Margin="5" Style="{StaticResource ButtonDanger}" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"></Button>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonDanger(DeleteGeometry)"></TextBlock>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
<WrapPanel ItemWidth="160" ItemHeight="130">
|
||||
<StackPanel>
|
||||
<Button Margin="5" Height="28" Padding="10,0" Background="#24292e" Foreground="White" Content="{x:Static langs:Lang.ButtonOpacity}" Style="{StaticResource ButtonCustom}" controls:BackgroundSwitchElement.MouseHoverBackground="Red" controls:BackgroundSwitchElement.MouseDownBackground="PaleVioletRed"></Button>
|
||||
<Button Margin="5" Height="28" IsEnabled="False" Padding="10,0" Background="#24292e" Foreground="White" Content="{x:Static langs:Lang.ButtonOpacity}" Style="{StaticResource ButtonCustom}" controls:BackgroundSwitchElement.MouseHoverBackground="Red" controls:BackgroundSwitchElement.MouseDownBackground="PaleVioletRed"></Button>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonCustom"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Button Margin="5" Height="28" Padding="10,0" Background="#24292e" Foreground="White" Content="{x:Static langs:Lang.ButtonOpacity}" Style="{StaticResource ButtonOpacityStyle}" controls:BackgroundSwitchElement.MouseHoverBackground="Red" controls:BackgroundSwitchElement.MouseDownBackground="PaleVioletRed"></Button>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonOpacityStyle"></TextBlock>
|
||||
<Button Width="50" Padding="16,8" Margin="5" Style="{StaticResource ButtonIcon}" Foreground="{StaticResource PrimaryTextBrush}" controls:IconElement.Geometry="{StaticResource UpDownGeometry}"></Button>
|
||||
<Button Width="50" Padding="16,8" IsEnabled="False" Margin="5" Style="{StaticResource ButtonIcon}" Foreground="{StaticResource PrimaryTextBrush}" controls:IconElement.Geometry="{StaticResource UpDownGeometry}"></Button>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ButtonIcon(UpDownGeometry)"></TextBlock>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
|
@ -8,73 +8,96 @@
|
||||
<controls:ScrollViewer IsEnableInertia="True">
|
||||
<WrapPanel Margin="32" ItemWidth="160" ItemHeight="130">
|
||||
<StackPanel>
|
||||
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Default}" Margin="5"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Default}" Margin="5"></ToggleButton>
|
||||
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Default}" Margin="5"/>
|
||||
<ToggleButton IsEnabled="False" IsChecked="True" Content="{x:Static langs:Lang.Default}" Margin="5"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Primary}" Margin="5" Style="{StaticResource ToggleButtonPrimary}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Primary}" Margin="5" Style="{StaticResource ToggleButtonPrimary}"></ToggleButton>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonPrimary"></TextBlock>
|
||||
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Primary}" Margin="5" controls:IconElement.Geometry="{StaticResource ClockGeometry}" Style="{StaticResource ToggleButtonPrimary}"/>
|
||||
<ToggleButton IsEnabled="False" IsChecked="True" Content="{x:Static langs:Lang.Primary}" Margin="5" Style="{StaticResource ToggleButtonPrimary}"/>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonPrimary"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ToggleButtonSuccess}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ToggleButtonSuccess}"></ToggleButton>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSuccess"></TextBlock>
|
||||
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Success}" Margin="5" controls:IconElement.Geometry="{StaticResource CalendarGeometry}" Style="{StaticResource ToggleButtonSuccess}"/>
|
||||
<ToggleButton IsEnabled="False" IsChecked="True" Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ToggleButtonSuccess}"/>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSuccess"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ToggleButtonInfo}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ToggleButtonInfo}"></ToggleButton>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonInfo"></TextBlock>
|
||||
<ToggleButton Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ToggleButtonInfo}"/>
|
||||
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ToggleButtonInfo}"/>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonInfo"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ToggleButtonWarning}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ToggleButtonWarning}"></ToggleButton>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonWarning"></TextBlock>
|
||||
<ToggleButton Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ToggleButtonWarning}"/>
|
||||
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ToggleButtonWarning}"/>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonWarning"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ToggleButtonDanger}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ToggleButtonDanger}"></ToggleButton>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonDanger"></TextBlock>
|
||||
<ToggleButton Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ToggleButtonDanger}"/>
|
||||
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ToggleButtonDanger}"/>
|
||||
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonDanger"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIcon}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIcon}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"></TextBlock>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIcon}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIcon}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIcon"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconPrimary}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconPrimary}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"></TextBlock>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconPrimary}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconPrimary}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconPrimary"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconSuccess}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconSuccess}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"></TextBlock>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconSuccess}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconSuccess}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconSuccess"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconInfo}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconInfo}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"></TextBlock>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconInfo}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconInfo}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconInfo"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconWarning}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconWarning}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"></TextBlock>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconWarning}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconWarning}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconWarning"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconDanger}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconDanger}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"></TextBlock>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconDanger}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconDanger}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconDanger"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"></ToggleButton>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"></TextBlock>
|
||||
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
|
||||
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Height="30" IsChecked="True" Margin="5" Style="{StaticResource ToggleButtonSwitch}"></ToggleButton>
|
||||
<ToggleButton Height="30" Margin="5" IsEnabled="False" Style="{StaticResource ToggleButtonSwitch}"></ToggleButton>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSwitch"></TextBlock>
|
||||
<ToggleButton IsChecked="True" Style="{StaticResource ToggleButtonCustom}" controls:StatusSwitchElement.HiddenElement="True">
|
||||
<controls:StatusSwitchElement.CheckedElement>
|
||||
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
|
||||
<Ellipse Width="20" Height="20" Fill="{StaticResource PrimaryBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
|
||||
</Border>
|
||||
</controls:StatusSwitchElement.CheckedElement>
|
||||
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
|
||||
<Ellipse Width="20" Height="20" Fill="{StaticResource BorderBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
|
||||
</Border>
|
||||
</ToggleButton>
|
||||
<ToggleButton IsEnabled="False" IsChecked="True" Style="{StaticResource ToggleButtonCustom}" controls:StatusSwitchElement.HiddenElement="True">
|
||||
<controls:StatusSwitchElement.CheckedElement>
|
||||
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
|
||||
<Ellipse Width="20" Height="20" Fill="{StaticResource PrimaryBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
|
||||
</Border>
|
||||
</controls:StatusSwitchElement.CheckedElement>
|
||||
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
|
||||
<Ellipse Width="20" Height="20" Fill="{StaticResource BorderBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
|
||||
</Border>
|
||||
</ToggleButton>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonCustom"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton Height="30" IsChecked="True" Margin="5" Style="{StaticResource ToggleButtonSwitch}"/>
|
||||
<ToggleButton IsEnabled="False" Height="30" IsChecked="True" Margin="5" Style="{StaticResource ToggleButtonSwitch}"/>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSwitch"/>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</controls:ScrollViewer>
|
||||
|
Loading…
Reference in New Issue
Block a user