Merge pull request #694 from irihitech/iconbutton

enhance IconButton styles and add new button examples
This commit is contained in:
Dong Bin
2025-06-24 23:15:19 +08:00
committed by GitHub
2 changed files with 188 additions and 111 deletions

View File

@@ -109,16 +109,19 @@
Value="{Binding SelectedPosition}" /> Value="{Binding SelectedPosition}" />
</StackPanel> </StackPanel>
<u:IconButton <u:IconButton
HorizontalAlignment="Left"
IsLoading="{Binding IsLoading2}" IsLoading="{Binding IsLoading2}"
IconPlacement="{Binding SelectedPosition}" IconPlacement="{Binding SelectedPosition}"
Icon="{StaticResource SemiIconCamera}" Icon="{StaticResource SemiIconCamera}"
Content="Hello Camera" /> Content="Hello Camera" />
<u:IconButton <u:IconButton
HorizontalAlignment="Left"
IsLoading="{Binding IsLoading2}" IsLoading="{Binding IsLoading2}"
IconPlacement="{Binding SelectedPosition}" IconPlacement="{Binding SelectedPosition}"
Icon="🐼" Icon="🐼"
Content="Hello Panda" /> Content="Hello Panda" />
<u:IconButton <u:IconButton
HorizontalAlignment="Left"
IsLoading="{Binding IsLoading2}" IsLoading="{Binding IsLoading2}"
IconPlacement="{Binding SelectedPosition}" IconPlacement="{Binding SelectedPosition}"
Content="Hello Panda"> Content="Hello Panda">
@@ -130,6 +133,7 @@
</u:IconButton.Icon> </u:IconButton.Icon>
</u:IconButton> </u:IconButton>
<u:IconButton <u:IconButton
HorizontalAlignment="Left"
IsLoading="{Binding IsLoading2}" IsLoading="{Binding IsLoading2}"
IconPlacement="{Binding SelectedPosition}" IconPlacement="{Binding SelectedPosition}"
Theme="{StaticResource SolidIconButton}" Theme="{StaticResource SolidIconButton}"

View File

@@ -1,45 +1,59 @@
<ResourceDictionary <ResourceDictionary
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters" xmlns:u="https://irihi.tech/ursa"
xmlns:u="https://irihi.tech/ursa"> xmlns:converters="clr-namespace:Ursa.Themes.Semi.Converters">
<Design.PreviewWith> <Design.PreviewWith>
<StackPanel Margin="20"> <StackPanel Margin="20" Width="400">
<u:IconButton Icon="{StaticResource SemiIconGithubLogo}" /> <u:IconButton Icon="{StaticResource SemiIconCamera}"
<u:IconButton Content="Button" Foreground="Black" />
Theme="{StaticResource SolidIconButton}" <u:IconButton Icon="{StaticResource SemiIconCamera}"
Icon="{StaticResource SemiIconGithubLogo}" Classes="Primary" Content="Button" Foreground="Black" />
Classes="Warning" <u:IconButton Icon="{StaticResource SemiIconCamera}"
Content="GitHub" /> Classes="Secondary" Content="Button" />
<u:IconButton Icon="{StaticResource SemiIconCamera}"
IsEnabled="False" Classes="Tertiary" Content="Button" />
<u:IconButton Icon="{StaticResource SemiIconCamera}"
Theme="{DynamicResource SolidIconButton}" Classes="Success" Content="Button" />
<u:IconButton Icon="{StaticResource SemiIconCamera}"
Theme="{DynamicResource OutlineIconButton}" Classes="Warning" Content="Button" />
<u:IconButton Icon="{StaticResource SemiIconCamera}"
Theme="{DynamicResource BorderlessIconButton}" Classes="Danger" Content="Button" />
<Button Content="Button" Foreground="Black" />
<Button Classes="Primary" Content="Button" Foreground="Black" />
<Button Classes="Secondary" Content="Button" />
<Button IsEnabled="False" Classes="Tertiary" Content="Button" />
<Button Theme="{DynamicResource SolidButton}" Classes="Success" Content="Button" />
<Button Theme="{DynamicResource OutlineButton}" Classes="Warning" Content="Button" />
<Button Theme="{DynamicResource BorderlessButton}" Classes="Danger" Content="Button" />
</StackPanel> </StackPanel>
</Design.PreviewWith> </Design.PreviewWith>
<converters:BooleansToOpacityConverter x:Key="OpacityConverter" /> <converters:BooleansToOpacityConverter x:Key="OpacityConverter" />
<ControlTheme x:Key="{x:Type u:IconButton}" TargetType="u:IconButton"> <ControlTheme x:Key="{x:Type u:IconButton}" TargetType="u:IconButton">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" /> <Setter Property="Padding" Value="{DynamicResource ButtonDefaultPadding}" />
<Setter Property="RenderTransform" Value="none" /> <Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" />
<Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource ButtonCornerRadius}" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="FontSize" Value="{DynamicResource ButtonDefaultFontSize}" />
<Setter Property="MinHeight" Value="{DynamicResource ButtonDefaultHeight}" /> <Setter Property="FontWeight" Value="{DynamicResource ButtonDefaultFontWeight}" />
<Setter Property="RenderTransform" Value="none" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="Cursor" Value="Hand" /> <Setter Property="Cursor" Value="Hand" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="u:IconButton"> <ControlTemplate TargetType="u:IconButton">
<Border <Border
Name="PART_Background"
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}">
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}"
UseLayoutRounding="False">
<ReversibleStackPanel <ReversibleStackPanel
Name="{x:Static u:IconButton.PART_RootPanel}" Name="{x:Static u:IconButton.PART_RootPanel}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
@@ -60,6 +74,7 @@
Content="{TemplateBinding Icon}" Content="{TemplateBinding Icon}"
ContentTemplate="{TemplateBinding IconTemplate}" ContentTemplate="{TemplateBinding IconTemplate}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Foreground="{Binding #PART_ContentPresenter.Foreground}"
Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=!IsLoading, Converter={StaticResource OpacityConverter}}"> Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=!IsLoading, Converter={StaticResource OpacityConverter}}">
<ContentPresenter.DataTemplates> <ContentPresenter.DataTemplates>
<DataTemplate DataType="Geometry"> <DataTemplate DataType="Geometry">
@@ -71,54 +86,76 @@
</ContentPresenter> </ContentPresenter>
<u:LoadingIcon <u:LoadingIcon
Classes="Small" Classes="Small"
Foreground="{TemplateBinding Foreground}" Foreground="{Binding #PART_ContentPresenter.Foreground}"
IsLoading="{TemplateBinding IsLoading}" IsLoading="{TemplateBinding IsLoading}"
IsVisible="{TemplateBinding IsLoading}" /> IsVisible="{TemplateBinding IsLoading}" />
</Panel> </Panel>
<ContentPresenter <ContentPresenter
Name="PART_ContentPresenter" Name="PART_ContentPresenter"
HorizontalAlignment="Center" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.FontWeight="{TemplateBinding FontWeight}"
IsVisible="{TemplateBinding Content, Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{TemplateBinding Content, Converter={x:Static ObjectConverters.IsNotNull}}"
Content="{TemplateBinding Content}" /> Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
UseLayoutRounding="False" />
</ReversibleStackPanel> </ReversibleStackPanel>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^.Primary"> <Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{TemplateBinding Background}" />
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" />
</Style>
<Style Selector="^.Primary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultPrimaryForeground}" />
</Style> </Style>
<Style Selector="^.Secondary"> <Style Selector="^.Secondary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSecondaryForeground}" />
</Style> </Style>
<Style Selector="^.Tertiary"> <Style Selector="^.Tertiary /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
</Style> </Style>
<Style Selector="^.Success"> <Style Selector="^.Success /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSuccessForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultSuccessForeground}" />
</Style> </Style>
<Style Selector="^.Warning"> <Style Selector="^.Warning /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultWarningForeground}" />
</Style> </Style>
<Style Selector="^.Danger"> <Style Selector="^.Danger /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDangerForeground}" />
</Style> </Style>
<Style Selector="^:pointerover"> <Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultPressedBorderBrush}" />
</Style> </Style>
<Style Selector="^:disabled"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
<Style Selector="^:disabled /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" />
</Style>
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
</Style>
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
</Style>
<Style Selector="^:right /template/ ReversibleStackPanel#PART_RootPanel"> <Style Selector="^:right /template/ ReversibleStackPanel#PART_RootPanel">
<Setter Property="Orientation" Value="Horizontal" /> <Setter Property="Orientation" Value="Horizontal" />
@@ -140,16 +177,6 @@
<Setter Property="ReverseOrder" Value="True" /> <Setter Property="ReverseOrder" Value="True" />
</Style> </Style>
<Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource ButtonLargeHeight}" />
<Setter Property="Padding" Value="{DynamicResource ButtonLargePadding}" />
</Style>
<Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource ButtonSmallHeight}" />
<Setter Property="Padding" Value="{DynamicResource ButtonSmallPadding}" />
</Style>
<Style Selector="^:empty-content"> <Style Selector="^:empty-content">
<Setter Property="MinWidth" Value="{Binding $self.MinHeight}" /> <Setter Property="MinWidth" Value="{Binding $self.MinHeight}" />
<Setter Property="Padding" Value="0" /> <Setter Property="Padding" Value="0" />
@@ -160,115 +187,140 @@
x:Key="SolidIconButton" x:Key="SolidIconButton"
BasedOn="{StaticResource {x:Type u:IconButton}}" BasedOn="{StaticResource {x:Type u:IconButton}}"
TargetType="u:IconButton"> TargetType="u:IconButton">
<Setter Property="FocusAdorner">
<FocusAdornerTemplate>
<Border Theme="{DynamicResource AdornerLayerBorder}"
Classes="Solid" />
</FocusAdornerTemplate>
</Setter>
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^:pointerover"> <Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidPrimaryPressedForeground}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style> </Style>
<Style Selector="^.Primary"> <Style Selector="^.Primary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
<Style Selector="^:pointerover"> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidPrimaryPressedForeground}" />
</Style>
<Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidPrimaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidPrimaryPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Secondary"> <Style Selector="^.Secondary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryBorderBrush}" />
<Style Selector="^:pointerover"> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSecondaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSecondaryPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Tertiary"> <Style Selector="^.Tertiary">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryBorderBrush}" />
<Style Selector="^:pointerover"> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidTertiaryPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidTertiaryPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Success"> <Style Selector="^.Success">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessBorderBrush}" />
<Style Selector="^:pointerover"> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidSuccessPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidSuccessPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Warning"> <Style Selector="^.Warning">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidWarningBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningBorderBrush}" />
<Style Selector="^:pointerover"> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidWarningPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidWarningPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Danger"> <Style Selector="^.Danger">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidForeground}" />
</Style>
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerBorderBrush}" />
<Style Selector="^:pointerover"> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPointeroverBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonSolidDangerPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDangerPressedBorderBrush}" />
</Style> </Style>
</Style> </Style>
<Style Selector="^:disabled"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultDisabledBorderBrush}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonSolidDisabledForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
</ControlTheme> <Style Selector="^:disabled /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonSolidDisabledBackground}" />
<ControlTheme <Setter Property="BorderBrush" Value="{DynamicResource ButtonSolidDisabledBorderBrush}" />
x:Key="BorderlessIconButton"
BasedOn="{StaticResource {x:Type u:IconButton}}"
TargetType="u:IconButton">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Style Selector="^:disabled">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
@@ -276,29 +328,50 @@
x:Key="OutlineIconButton" x:Key="OutlineIconButton"
BasedOn="{StaticResource {x:Type u:IconButton}}" BasedOn="{StaticResource {x:Type u:IconButton}}"
TargetType="u:IconButton"> TargetType="u:IconButton">
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Style Selector="^:pointerover"> </Style>
<Style Selector="^:pointerover /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonOutlinePointeroverBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style> </Style>
<Style Selector="^:pressed"> <Style Selector="^:pressed /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" /> <Setter Property="Background" Value="{DynamicResource ButtonOutlinePressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style> </Style>
<Style Selector="^.Success"> <Style Selector="^.Success /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineSuccessBorderBrush}" />
</Style> </Style>
<Style Selector="^.Warning"> <Style Selector="^.Warning /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineWarningBorderBrush}" />
</Style> </Style>
<Style Selector="^.Danger"> <Style Selector="^.Danger /template/ Border#PART_Background">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineDangerBorderBrush}" />
</Style> </Style>
<Style Selector="^:disabled"> <Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style> </Style>
<Style Selector="^:disabled /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonOutlineBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonOutlineBorderBrush}" />
</Style>
</ControlTheme>
<ControlTheme
x:Key="BorderlessIconButton"
BasedOn="{StaticResource {x:Type u:IconButton}}"
TargetType="u:IconButton">
<Style Selector="^ /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
</Style>
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultDisabledForeground}" />
</Style>
<Style Selector="^:disabled /template/ Border#PART_Background">
<Setter Property="Background" Value="{DynamicResource ButtonBorderlessBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderlessBorderBrush}" />
</Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>