You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
4.9 KiB
86 lines
4.9 KiB
<ResourceDictionary |
|
xmlns="https://github.com/avaloniaui" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls" |
|
xmlns:fluentIcons="clr-namespace:FluentIcons.FluentAvalonia;assembly=FluentIcons.FluentAvalonia" |
|
xmlns:ui="using:FluentAvalonia.UI.Controls"> |
|
|
|
<Design.PreviewWith> |
|
<StackPanel Margin="8" Spacing="6"> |
|
<controls:HyperlinkIconButton Content="Link"/> |
|
<controls:HyperlinkIconButton Content="Disabled" IsEnabled="False"/> |
|
<controls:HyperlinkIconButton Content="File" Icon="Open"/> |
|
</StackPanel> |
|
</Design.PreviewWith> |
|
|
|
<!-- ReSharper disable once Xaml.StaticResourceNotResolved --> |
|
<ControlTheme |
|
x:Key="{x:Type controls:HyperlinkIconButton}" |
|
TargetType="controls:HyperlinkIconButton"> |
|
|
|
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonBackground}" /> |
|
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForeground}" /> |
|
<Setter Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrush}" /> |
|
<Setter Property="BorderThickness" Value="{DynamicResource HyperlinkButtonBorderThemeThickness}" /> |
|
<Setter Property="Padding" Value="{DynamicResource ButtonPadding}" /> |
|
<Setter Property="HorizontalAlignment" Value="Left" /> |
|
<Setter Property="VerticalAlignment" Value="Center" /> |
|
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|
<Setter Property="Cursor" Value="Hand" /> |
|
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|
|
|
<Setter Property="Icon" Value="Link"/> |
|
|
|
<Setter Property="ContentTemplate"> |
|
<DataTemplate DataType="x:String"> |
|
<StackPanel Orientation="Horizontal"> |
|
<fluentIcons:SymbolIcon |
|
VerticalAlignment="Center" |
|
Margin="0,1,4,0" |
|
FontSize="15" |
|
Foreground="{DynamicResource HyperlinkButtonForeground}" |
|
Symbol="{Binding $parent[controls:HyperlinkIconButton].Icon}" /> |
|
<TextBlock |
|
Foreground="{DynamicResource HyperlinkButtonForeground}" Text="{Binding}" /> |
|
</StackPanel> |
|
</DataTemplate> |
|
</Setter> |
|
|
|
<!-- Override template to not set Underline TextDecoration --> |
|
<Setter Property="Template"> |
|
<ControlTemplate> |
|
<ContentPresenter Name="ContentPresenter" |
|
Background="{TemplateBinding Background}" |
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
Content="{TemplateBinding Content}" |
|
ContentTemplate="{TemplateBinding ContentTemplate}" |
|
Padding="{TemplateBinding Padding}" |
|
CornerRadius="{TemplateBinding CornerRadius}" |
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|
Foreground="{TemplateBinding Foreground}"> |
|
</ContentPresenter> |
|
</ControlTemplate> |
|
</Setter> |
|
|
|
<Style Selector="^:pointerover /template/ ContentPresenter#ContentPresenter"> |
|
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundPointerOver}" /> |
|
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonBackgroundPointerOver}" /> |
|
<Setter Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrushPointerOver}" /> |
|
</Style> |
|
<Style Selector="^:pressed /template/ ContentPresenter#ContentPresenter"> |
|
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundPressed}" /> |
|
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonBackgroundPressed}" /> |
|
<Setter Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrushPressed}" /> |
|
</Style> |
|
<Style Selector="^:disabled /template/ ContentPresenter#ContentPresenter"> |
|
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundDisabled}" /> |
|
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonBackgroundDisabled}" /> |
|
<Setter Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrushDisabled}" /> |
|
</Style> |
|
|
|
</ControlTheme> |
|
|
|
</ResourceDictionary>
|
|
|