Files
ShrlAlgoToolkit/WPFluent/Controls/Badge/Badge.xaml

76 lines
4.5 KiB
XML

<!--
This Source Code Form is subject to the terms of the MIT License.
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
All Rights Reserved.
-->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFluent.Controls">
<Style TargetType="{x:Type controls:Badge}">
<Setter Property="Foreground" Value="{DynamicResource BadgeForeground}" />
<Setter Property="Background" Value="{DynamicResource BadgeBackground}" />
<!--<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentBrush}" />-->
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Padding" Value="4" />
<Setter Property="Focusable" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Badge}">
<Border
x:Name="Border"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="4">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Appearance" Value="Primary">
<Setter Property="Foreground" Value="{DynamicResource BadgeForeground}" />
</Trigger>
<Trigger Property="Appearance" Value="Transparent">
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter TargetName="Border" Property="Background" Value="Transparent" />
</Trigger>
<Trigger Property="Appearance" Value="Secondary">
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
</Trigger>
<Trigger Property="Appearance" Value="Info">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource PaletteLightBlueBrush}" />
</Trigger>
<Trigger Property="Appearance" Value="Caution">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource PaletteOrangeBrush}" />
</Trigger>
<Trigger Property="Appearance" Value="Danger">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource PaletteRedBrush}" />
</Trigger>
<Trigger Property="Appearance" Value="Success">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource PaletteGreenBrush}" />
</Trigger>
<Trigger Property="Appearance" Value="Dark">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ControlStrongFillColorDarkBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorLightPrimaryBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
</Trigger>
<Trigger Property="Appearance" Value="Light">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ControlStrongFillColorLightBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDarkPrimaryBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>