1+ <!-- source: https://github.com/amwx/FluentAvalonia/blob/master/src/FluentAvalonia/Styling/ControlThemes/BasicControls/HyperlinkButtonStyles.axaml (modified) -->
2+ <ResourceDictionary xmlns =" https://github.com/avaloniaui"
3+ xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
4+ xmlns : ui =" clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
5+ x : CompileBindings =" True" >
6+ <Design .PreviewWith>
7+ <Border Padding =" 50" >
8+ <StackPanel Spacing =" 10" >
9+ <HyperlinkButton Content =" Hello" />
10+ <HyperlinkButton Content =" Disabled" IsEnabled =" False" />
11+ </StackPanel >
12+ </Border >
13+ </Design .PreviewWith>
14+
15+
16+ <ControlTheme x : Key =" {x:Type HyperlinkButton}" TargetType =" HyperlinkButton" >
17+ <Setter Property =" Background" Value =" {DynamicResource HyperlinkButtonBackground}" />
18+ <Setter Property =" Foreground" Value =" {DynamicResource HyperlinkButtonForeground}" />
19+ <Setter Property =" BorderBrush" Value =" {DynamicResource HyperlinkButtonBorderBrush}" />
20+ <Setter Property =" BorderThickness" Value =" {DynamicResource HyperlinkButtonBorderThemeThickness}" />
21+ <Setter Property =" Padding" Value =" {DynamicResource ButtonPadding}" />
22+ <Setter Property =" HorizontalAlignment" Value =" Left" />
23+ <Setter Property =" VerticalAlignment" Value =" Center" />
24+ <Setter Property =" FontFamily" Value =" {DynamicResource ContentControlThemeFontFamily}" />
25+ <Setter Property =" FontSize" Value =" {DynamicResource ControlContentThemeFontSize}" />
26+ <Setter Property =" Cursor" Value =" Hand" />
27+ <Setter Property =" CornerRadius" Value =" {DynamicResource ControlCornerRadius}" />
28+ <Setter Property =" Template" >
29+ <ControlTemplate >
30+ <ContentPresenter Name =" ContentPresenter"
31+ Background =" {TemplateBinding Background}"
32+ BorderBrush =" {TemplateBinding BorderBrush}"
33+ BorderThickness =" {TemplateBinding BorderThickness}"
34+ Content =" {TemplateBinding Content}"
35+ ContentTemplate =" {TemplateBinding ContentTemplate}"
36+ Padding =" {TemplateBinding Padding}"
37+ CornerRadius =" {TemplateBinding CornerRadius}"
38+ HorizontalContentAlignment =" {TemplateBinding HorizontalContentAlignment}"
39+ VerticalContentAlignment =" {TemplateBinding VerticalContentAlignment}"
40+ Foreground =" {TemplateBinding Foreground}" >
41+ <ContentPresenter .Styles>
42+ <Style Selector =" TextBlock" >
43+ <Setter Property =" TextWrapping" Value =" Wrap" />
44+ </Style >
45+ </ContentPresenter .Styles>
46+ </ContentPresenter >
47+ </ControlTemplate >
48+ </Setter >
49+
50+ <Style Selector =" ^:pointerover /template/ ContentPresenter#ContentPresenter" >
51+ <Setter Property =" Foreground" Value =" {DynamicResource HyperlinkButtonForegroundPointerOver}" />
52+ <Setter Property =" Background" Value =" {DynamicResource HyperlinkButtonBackgroundPointerOver}" />
53+ <Setter Property =" BorderBrush" Value =" {DynamicResource HyperlinkButtonBorderBrushPointerOver}" />
54+ </Style >
55+ <Style Selector =" ^:pressed /template/ ContentPresenter#ContentPresenter" >
56+ <Setter Property =" Foreground" Value =" {DynamicResource HyperlinkButtonForegroundPressed}" />
57+ <Setter Property =" Background" Value =" {DynamicResource HyperlinkButtonBackgroundPressed}" />
58+ <Setter Property =" BorderBrush" Value =" {DynamicResource HyperlinkButtonBorderBrushPressed}" />
59+ </Style >
60+ <Style Selector =" ^:disabled /template/ ContentPresenter#ContentPresenter" >
61+ <Setter Property =" Foreground" Value =" {DynamicResource HyperlinkButtonForegroundDisabled}" />
62+ <Setter Property =" Background" Value =" {DynamicResource HyperlinkButtonBackgroundDisabled}" />
63+ <Setter Property =" BorderBrush" Value =" {DynamicResource HyperlinkButtonBorderBrushDisabled}" />
64+ </Style >
65+ </ControlTheme >
66+
67+ </ResourceDictionary >
0 commit comments