Files
HandyControl/src/Avalonia/HandyControl_Avalonia/Themes/Styles/HyperlinkButton.axaml
T

216 lines
9.2 KiB
XML

<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:ClassModifier="internal"
xmlns:hc="clr-namespace:HandyControl.Controls">
<ControlTheme x:Key="HyperlinkButtonBaseStyle"
TargetType="HyperlinkButton">
<Setter Property="Cursor"
Value="Hand" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="Foreground"
Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderBrush"
Value="Transparent" />
<Setter Property="BorderThickness"
Value="0" />
<Setter Property="Height"
Value="{StaticResource DefaultControlHeight}" />
<Setter Property="Padding"
Value="{StaticResource DefaultControlPadding}" />
<Setter Property="HorizontalAlignment"
Value="Center" />
<Setter Property="VerticalAlignment"
Value="Center" />
<Setter Property="HorizontalContentAlignment"
Value="Center" />
<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="TextBlock.TextDecorations"
Value="Underline" />
<Setter Property="hc:BorderElement.CornerRadius"
Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="CornerRadius"
Value="{Binding $self.(hc:BorderElement.CornerRadius)}" />
<Setter Property="Template">
<ControlTemplate>
<ContentPresenter x:Name="PART_ContentPresenter"
Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Padding="{TemplateBinding Padding}"
RecognizesAccessKey="True"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Opacity"
Value="0.9" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Opacity"
Value="0.6" />
</Style>
<Style Selector="^:disabled">
<Setter Property="Opacity"
Value="0.4" />
</Style>
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonDefault"
BasedOn="{StaticResource HyperlinkButtonBaseStyle}"
TargetType="HyperlinkButton" />
<ControlTheme x:Key="HyperlinkButtonDefault.Small"
BasedOn="{StaticResource HyperlinkButtonBaseStyle}"
TargetType="HyperlinkButton">
<Setter Property="Height"
Value="20" />
<Setter Property="Padding"
Value="6,1" />
<Setter Property="hc:IconElement.Height"
Value="12" />
</ControlTheme>
<ControlTheme x:Key="{x:Type HyperlinkButton}"
BasedOn="{StaticResource HyperlinkButtonBaseStyle}"
TargetType="HyperlinkButton" />
<ControlTheme x:Key="HyperlinkButtonGhost"
BasedOn="{StaticResource HyperlinkButtonBaseStyle}"
TargetType="HyperlinkButton">
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
Value="{DynamicResource PrimaryTextBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Background"
Value="{Binding $self.(hc:BackgroundSwitchElement.MouseHoverBackground)}" />
<Setter Property="Foreground"
Value="{Binding $self.(hc:BackgroundSwitchElement.MouseHoverForeground)}" />
</Style>
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhost.Small"
BasedOn="{StaticResource HyperlinkButtonGhost}"
TargetType="HyperlinkButton">
<Setter Property="Height"
Value="20" />
<Setter Property="Padding"
Value="6,1" />
<Setter Property="hc:IconElement.Height"
Value="12" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostPrimary"
BasedOn="{StaticResource HyperlinkButtonGhost}"
TargetType="HyperlinkButton">
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
Value="{DynamicResource PrimaryBrush}" />
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
Value="{DynamicResource TextIconBrush}" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostPrimary.Small"
BasedOn="{StaticResource HyperlinkButtonGhostPrimary}"
TargetType="HyperlinkButton">
<Setter Property="Height"
Value="20" />
<Setter Property="Padding"
Value="6,1" />
<Setter Property="hc:IconElement.Height"
Value="12" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostSuccess"
BasedOn="{StaticResource HyperlinkButtonGhost}"
TargetType="HyperlinkButton">
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
Value="{DynamicResource SuccessBrush}" />
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
Value="{DynamicResource TextIconBrush}" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostSuccess.Small"
BasedOn="{StaticResource HyperlinkButtonGhostSuccess}"
TargetType="HyperlinkButton">
<Setter Property="Height"
Value="20" />
<Setter Property="Padding"
Value="6,1" />
<Setter Property="hc:IconElement.Height"
Value="12" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostInfo"
BasedOn="{StaticResource HyperlinkButtonGhost}"
TargetType="HyperlinkButton">
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
Value="{DynamicResource InfoBrush}" />
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
Value="{DynamicResource TextIconBrush}" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostInfo.Small"
BasedOn="{StaticResource HyperlinkButtonGhostInfo}"
TargetType="HyperlinkButton">
<Setter Property="Height"
Value="20" />
<Setter Property="Padding"
Value="6,1" />
<Setter Property="hc:IconElement.Height"
Value="12" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostWarning"
BasedOn="{StaticResource HyperlinkButtonGhost}"
TargetType="HyperlinkButton">
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
Value="{DynamicResource WarningBrush}" />
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
Value="{DynamicResource TextIconBrush}" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostWarning.Small"
BasedOn="{StaticResource HyperlinkButtonGhostWarning}"
TargetType="HyperlinkButton">
<Setter Property="Height"
Value="20" />
<Setter Property="Padding"
Value="6,1" />
<Setter Property="hc:IconElement.Height"
Value="12" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostDanger"
BasedOn="{StaticResource HyperlinkButtonGhost}"
TargetType="HyperlinkButton">
<Setter Property="hc:BackgroundSwitchElement.MouseHoverBackground"
Value="{DynamicResource DangerBrush}" />
<Setter Property="hc:BackgroundSwitchElement.MouseHoverForeground"
Value="{DynamicResource TextIconBrush}" />
</ControlTheme>
<ControlTheme x:Key="HyperlinkButtonGhostDanger.Small"
BasedOn="{StaticResource HyperlinkButtonGhostDanger}"
TargetType="HyperlinkButton">
<Setter Property="Height"
Value="20" />
<Setter Property="Padding"
Value="6,1" />
<Setter Property="hc:IconElement.Height"
Value="12" />
</ControlTheme>
</ResourceDictionary>