2025-07-31 20:12:01 +08:00
|
|
|
<ResourceDictionary
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-01-02 17:30:30 +08:00
|
|
|
xmlns:controls="clr-namespace:VariaStudio.Controls"
|
|
|
|
|
xmlns:converters="clr-namespace:VariaStudio.Converters"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
2025-07-31 20:12:01 +08:00
|
|
|
<ResourceDictionary.MergedDictionaries>
|
2026-01-02 17:30:30 +08:00
|
|
|
<ResourceDictionary Source="/VariaStudio;component/Themes/Animations.xaml" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
|
|
|
|
|
<Style TargetType="{x:Type controls:Badge}">
|
|
|
|
|
<Setter Property="Foreground" Value="White" />
|
2025-09-08 19:49:09 +08:00
|
|
|
<Setter Property="FontSize" Value="10" />
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="FontWeight" Value="Normal" />
|
2025-09-08 19:49:09 +08:00
|
|
|
<Setter Property="BadgeHeight" Value="16" />
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ErrorBrush}" />
|
2025-07-31 20:12:01 +08:00
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:Badge}">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<!-- Content -->
|
|
|
|
|
<ContentPresenter
|
|
|
|
|
Content="{TemplateBinding Content}"
|
|
|
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
|
|
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
|
|
|
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
|
2026-01-02 17:30:30 +08:00
|
|
|
Grid.ColumnSpan="2"
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
Margin="{TemplateBinding Padding}"
|
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
x:Name="Content" />
|
2025-07-31 20:12:01 +08:00
|
|
|
<!-- Effect -->
|
|
|
|
|
<Ellipse
|
2025-10-10 11:19:58 +08:00
|
|
|
Grid.Column="0"
|
2025-08-12 23:08:54 +08:00
|
|
|
Height="6.5"
|
2025-07-31 20:12:01 +08:00
|
|
|
Opacity="0"
|
|
|
|
|
RenderTransformOrigin="0.5,0.5"
|
2025-08-12 23:08:54 +08:00
|
|
|
Stroke="{DynamicResource PrimaryNormalBrush}"
|
2025-07-31 20:12:01 +08:00
|
|
|
StrokeThickness="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
UseLayoutRounding="True"
|
|
|
|
|
Width="6.5"
|
|
|
|
|
x:Name="Effect">
|
2025-07-31 20:12:01 +08:00
|
|
|
<Ellipse.RenderTransform>
|
|
|
|
|
<ScaleTransform x:Name="EffectTransform" />
|
|
|
|
|
</Ellipse.RenderTransform>
|
|
|
|
|
</Ellipse>
|
|
|
|
|
<!-- Dot -->
|
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
CornerRadius="{Binding Height, RelativeSource={RelativeSource Self}, Converter={x:Static converters:DivideByTwoConverter.Instance}}"
|
2025-10-10 11:19:58 +08:00
|
|
|
Grid.Column="0"
|
2025-07-31 20:12:01 +08:00
|
|
|
Grid.ColumnSpan="2"
|
|
|
|
|
Height="{TemplateBinding BadgeHeight}"
|
2025-12-23 21:35:54 +08:00
|
|
|
HorizontalAlignment="Right"
|
2026-01-02 17:30:30 +08:00
|
|
|
MinWidth="{TemplateBinding BadgeHeight}"
|
|
|
|
|
UseLayoutRounding="True"
|
2025-07-31 20:12:01 +08:00
|
|
|
VerticalAlignment="Top"
|
2026-01-02 17:30:30 +08:00
|
|
|
x:Name="Dot">
|
2025-07-31 20:12:01 +08:00
|
|
|
<ContentPresenter
|
2025-12-23 21:35:54 +08:00
|
|
|
HorizontalAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
Margin="4,0"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
x:Name="PART_Count" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="Dot" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Visibility" TargetName="PART_Count" Value="Collapsed" />
|
|
|
|
|
<Setter Property="Width" TargetName="Dot" Value="6" />
|
|
|
|
|
<Setter Property="Height" TargetName="Dot" Value="6" />
|
|
|
|
|
<Setter Property="MinWidth" TargetName="Dot" Value="0" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Status" Value="Success">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource SuccessBrush}" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Status" Value="Processing">
|
|
|
|
|
<Trigger.EnterActions>
|
|
|
|
|
<BeginStoryboard>
|
|
|
|
|
<Storyboard>
|
|
|
|
|
<DoubleAnimation
|
2026-01-02 17:30:30 +08:00
|
|
|
Duration="0:0:1.2"
|
2025-07-31 20:12:01 +08:00
|
|
|
EasingFunction="{StaticResource EaseInOut}"
|
2026-01-02 17:30:30 +08:00
|
|
|
From="0.5"
|
2025-07-31 20:12:01 +08:00
|
|
|
RepeatBehavior="Forever"
|
|
|
|
|
Storyboard.TargetName="Effect"
|
|
|
|
|
Storyboard.TargetProperty="(UIElement.Opacity)"
|
2026-01-02 17:30:30 +08:00
|
|
|
To="0" />
|
2025-07-31 20:12:01 +08:00
|
|
|
<DoubleAnimation
|
2026-01-02 17:30:30 +08:00
|
|
|
Duration="0:0:1.2"
|
2025-07-31 20:12:01 +08:00
|
|
|
EasingFunction="{StaticResource EaseInOut}"
|
2026-01-02 17:30:30 +08:00
|
|
|
From="0.8"
|
2025-07-31 20:12:01 +08:00
|
|
|
RepeatBehavior="Forever"
|
|
|
|
|
Storyboard.TargetName="EffectTransform"
|
|
|
|
|
Storyboard.TargetProperty="ScaleX"
|
2026-01-02 17:30:30 +08:00
|
|
|
To="2.4" />
|
2025-07-31 20:12:01 +08:00
|
|
|
<DoubleAnimation
|
2026-01-02 17:30:30 +08:00
|
|
|
Duration="0:0:1.2"
|
2025-07-31 20:12:01 +08:00
|
|
|
EasingFunction="{StaticResource EaseInOut}"
|
2026-01-02 17:30:30 +08:00
|
|
|
From="0.8"
|
2025-07-31 20:12:01 +08:00
|
|
|
RepeatBehavior="Forever"
|
|
|
|
|
Storyboard.TargetName="EffectTransform"
|
|
|
|
|
Storyboard.TargetProperty="ScaleY"
|
2026-01-02 17:30:30 +08:00
|
|
|
To="2.4" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</Storyboard>
|
|
|
|
|
</BeginStoryboard>
|
|
|
|
|
</Trigger.EnterActions>
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource PrimaryNormalBrush}" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Status" Value="Default">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Status" Value="Error">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource ErrorBrush}" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Status" Value="Warning">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource WarningBrush}" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="Count" Value="0" />
|
|
|
|
|
<Condition Property="ShowZero" Value="False" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Visibility" TargetName="Dot" Value="Collapsed" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</MultiTrigger>
|
2025-08-20 12:10:35 +08:00
|
|
|
<DataTrigger Binding="{Binding Status, RelativeSource={RelativeSource Self}, Converter={x:Static converters:NullOrEmptyConverter.Instance}}" Value="False">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Visibility" TargetName="PART_Count" Value="Collapsed" />
|
|
|
|
|
<Setter Property="Width" TargetName="Dot" Value="8" />
|
|
|
|
|
<Setter Property="Height" TargetName="Dot" Value="8" />
|
|
|
|
|
<Setter Property="Visibility" TargetName="Dot" Value="Visible" />
|
|
|
|
|
<Setter Property="MinWidth" TargetName="Dot" Value="0" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</DataTrigger>
|
|
|
|
|
<!-- Stateful and no content -->
|
|
|
|
|
<MultiDataTrigger>
|
|
|
|
|
<MultiDataTrigger.Conditions>
|
2025-08-20 12:10:35 +08:00
|
|
|
<Condition Binding="{Binding Content, RelativeSource={RelativeSource Self}, Converter={x:Static converters:NullOrEmptyConverter.Instance}}" Value="True" />
|
|
|
|
|
<Condition Binding="{Binding Status, RelativeSource={RelativeSource Self}, Converter={x:Static converters:NullOrEmptyConverter.Instance}}" Value="False" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</MultiDataTrigger.Conditions>
|
2025-08-12 23:08:54 +08:00
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="VerticalAlignment" TargetName="Dot" Value="Center" />
|
|
|
|
|
<Setter Property="HorizontalAlignment" TargetName="Dot" Value="Left" />
|
|
|
|
|
<Setter Property="Grid.ColumnSpan" TargetName="Dot" Value="1" />
|
2025-07-31 20:12:01 +08:00
|
|
|
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="VerticalAlignment" TargetName="Content" Value="Center" />
|
|
|
|
|
<Setter Property="HorizontalAlignment" TargetName="Content" Value="Left" />
|
|
|
|
|
<Setter Property="Margin" TargetName="Content" Value="8,0,0,0" />
|
|
|
|
|
<Setter Property="Grid.ColumnSpan" TargetName="Content" Value="1" />
|
|
|
|
|
<Setter Property="Grid.Column" TargetName="Content" Value="1" />
|
|
|
|
|
<Setter Property="Content" TargetName="Content" Value="{Binding Text, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
2025-07-31 20:12:01 +08:00
|
|
|
</MultiDataTrigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
</ResourceDictionary>
|