2025-02-10 20:53:40 +08:00
|
|
|
<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">
|
|
|
|
|
|
|
|
|
|
<CornerRadius x:Key="ValueInfoBadgeStyleCornerRadius">8</CornerRadius>
|
|
|
|
|
<Thickness x:Key="IconBadgeMargin">2</Thickness>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="DotInfoBadgeStyle" TargetType="{x:Type controls:InfoBadge}">
|
2025-07-11 09:20:23 +08:00
|
|
|
<!--<Setter Property="Background" Value="{DynamicResource AccentFillColorDefaultBrush}" />-->
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}"/>
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="Focusable" Value="False" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="FontWeight" Value="Normal" />
|
|
|
|
|
<Setter Property="Width" Value="6"/>
|
|
|
|
|
<Setter Property="Height" Value="6"/>
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
|
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:InfoBadge}">
|
|
|
|
|
<Grid x:Name="InfoBadgeRoot">
|
|
|
|
|
<Border
|
|
|
|
|
x:Name="ContentBorder"
|
2025-07-11 09:20:23 +08:00
|
|
|
Width="{TemplateBinding Width}"
|
|
|
|
|
Height="{TemplateBinding Height}"
|
2025-02-10 20:53:40 +08:00
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderThickness="0"
|
|
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
|
|
|
Opacity="{TemplateBinding Opacity}" />
|
|
|
|
|
</Grid>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="Severity" Value="Attention">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorAttentionBackgroundBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Severity" Value="Success">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorSuccessBackgroundBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Severity" Value="Caution">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorCautionBackgroundBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Severity" Value="Critical">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorCriticalBackgroundBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="IconInfoBadgeStyle" TargetType="{x:Type controls:InfoBadge}">
|
2025-07-11 09:20:23 +08:00
|
|
|
<!--<Setter Property="Background">
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter.Value>
|
|
|
|
|
<SolidColorBrush Color="{DynamicResource InfoBadgeInformationSeverityBackgroundBrush}" />
|
|
|
|
|
</Setter.Value>
|
2025-07-11 09:20:23 +08:00
|
|
|
</Setter>-->
|
2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
<Setter Property="Focusable" Value="False" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="FontWeight" Value="Normal" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
|
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:InfoBadge}">
|
|
|
|
|
<Grid x:Name="InfoBadgeRoot">
|
|
|
|
|
<Border
|
|
|
|
|
x:Name="ContentBorder"
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderThickness="0"
|
|
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
|
|
|
Opacity="{TemplateBinding Opacity}">
|
|
|
|
|
<ContentPresenter
|
|
|
|
|
x:Name="ControlIcon"
|
|
|
|
|
Margin="10"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Content="{TemplateBinding Icon}"
|
|
|
|
|
Focusable="False"
|
|
|
|
|
TextElement.FontSize="{TemplateBinding FontSize}"
|
2025-07-11 09:20:23 +08:00
|
|
|
TextElement.Foreground="{DynamicResource TextFillColorInverseBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="Severity" Value="Attention">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorAttentionBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Severity" Value="Success">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorSuccessBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Severity" Value="Caution">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorCautionBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Severity" Value="Critical">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorCriticalBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="ValueInfoBadgeStyle" TargetType="{x:Type controls:InfoBadge}">
|
2025-07-11 09:20:23 +08:00
|
|
|
<!--<Setter Property="Background">
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter.Value>
|
|
|
|
|
<SolidColorBrush Color="{DynamicResource InfoBadgeInformationSeverityBackgroundBrush}" />
|
|
|
|
|
</Setter.Value>
|
2025-07-11 09:20:23 +08:00
|
|
|
</Setter>-->
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="Focusable" Value="False" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="FontWeight" Value="Normal" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
|
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:InfoBadge}">
|
|
|
|
|
<Grid x:Name="InfoBadgeRoot">
|
|
|
|
|
<Border
|
|
|
|
|
x:Name="ContentBorder"
|
|
|
|
|
Width="{TemplateBinding Width}"
|
|
|
|
|
Height="{TemplateBinding Height}"
|
|
|
|
|
MinWidth="16"
|
|
|
|
|
MinHeight="16"
|
|
|
|
|
Margin="{StaticResource IconBadgeMargin}"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderThickness="0"
|
|
|
|
|
CornerRadius="{StaticResource ValueInfoBadgeStyleCornerRadius}"
|
2025-07-11 09:20:23 +08:00
|
|
|
Opacity="{TemplateBinding Opacity}"
|
|
|
|
|
Padding="3,0">
|
2025-02-10 20:53:40 +08:00
|
|
|
<TextBlock
|
|
|
|
|
x:Name="TextBlock"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Focusable="False"
|
|
|
|
|
FontSize="{TemplateBinding FontSize}"
|
2025-07-11 09:20:23 +08:00
|
|
|
Foreground="{DynamicResource TextFillColorInverseBrush}"
|
2025-02-10 20:53:40 +08:00
|
|
|
Text="{TemplateBinding Value}"
|
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
|
|
|
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="Severity" Value="Attention">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorAttentionBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Severity" Value="Success">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorSuccessBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Severity" Value="Caution">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorCautionBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Severity" Value="Critical">
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource SystemFillColorCriticalBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Trigger>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style BasedOn="{StaticResource ValueInfoBadgeStyle}" TargetType="{x:Type controls:InfoBadge}" />
|
|
|
|
|
|
2025-07-11 09:20:23 +08:00
|
|
|
</ResourceDictionary>
|