A macOS-style dock, widget bar and desktop widgets for Windows (WPF, .NET 10)
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="MenuItem">
<Setter Property="Foreground" Value="{DynamicResource TextPrimary}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="FontFamily" Value="{StaticResource InterfaceFont}" />
<Setter Property="FontSize" Value="{StaticResource TextSizeBody}" />
<Setter Property="Padding" Value="{StaticResource MenuRowPadding}" />
<Setter Property="MinHeight" Value="34" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="HeaderTemplate">
<Setter.Value><DataTemplate><TextBlock Text="{Binding}" MaxWidth="{StaticResource MenuLabelWidth}" TextTrimming="CharacterEllipsis" /></DataTemplate></Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Grid>
<Border x:Name="ItemSurface" Background="{TemplateBinding Background}"
CornerRadius="7" Padding="{TemplateBinding Padding}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="26" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="22" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="IconHost" Content="{TemplateBinding Icon}"
TextElement.Foreground="{DynamicResource TextSecondary}"
Width="16" Height="16"
VerticalAlignment="Center" HorizontalAlignment="Center" />
<ContentPresenter Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True"
VerticalAlignment="Center" />
<Path x:Name="Checkmark" Grid.Column="2"
Data="{StaticResource IconCheck}"
Stroke="{DynamicResource TextPrimary}"
StrokeThickness="1.8"
StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
Width="12" Height="12" Stretch="Uniform" SnapsToDevicePixels="True"
VerticalAlignment="Center" HorizontalAlignment="Right" Visibility="Collapsed" />
<Path x:Name="SubmenuArrow" Grid.Column="2"
Data="{StaticResource IconChevronRight}"
Stroke="{DynamicResource TextSecondary}"
StrokeThickness="1.6"
StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round"
Width="10" Height="10" Stretch="Uniform" SnapsToDevicePixels="True"
VerticalAlignment="Center" HorizontalAlignment="Right" Visibility="Collapsed" />
</Grid>
</Border>
<Popup x:Name="PART_Popup" AllowsTransparency="True" Focusable="False"
Placement="Right" PopupAnimation="None"
IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}">
<Border Background="{DynamicResource MenuMaterial}" BorderBrush="{DynamicResource MenuStroke}"
BorderThickness="1" CornerRadius="{StaticResource PopupRadius}" Padding="5">
<!-- Long submenus (81 provinces) scroll instead of running off screen. -->
<ScrollViewer MaxHeight="440" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Focusable="False">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
</ScrollViewer>
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasItems" Value="True">
<Setter TargetName="SubmenuArrow" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="ItemSurface" Property="Background" Value="{DynamicResource SurfaceHover}" />
<Setter TargetName="IconHost" Property="TextElement.Foreground" Value="{DynamicResource TextPrimary}" />
<Setter TargetName="SubmenuArrow" Property="Stroke" Value="{DynamicResource TextPrimary}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Checkmark" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ItemSurface" Property="Opacity" Value="0.42" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MenuSectionHeading" TargetType="MenuItem">
<Setter Property="IsEnabled" Value="False" />
<Setter Property="Focusable" Value="False" />
<Setter Property="Foreground" Value="{DynamicResource TextSecondary}" />
<Setter Property="FontFamily" Value="{StaticResource InterfaceFont}" />
<Setter Property="FontSize" Value="{StaticResource TextSizeCaption}" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Padding" Value="10,5" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Border Padding="{TemplateBinding Padding}">
<ContentPresenter ContentSource="Header" RecognizesAccessKey="True" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
<Setter Property="Margin" Value="{StaticResource MenuDividerInset}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Separator">
<Border Height="1" Background="{DynamicResource MenuDivider}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Separator" BasedOn="{StaticResource {x:Static MenuItem.SeparatorStyleKey}}" />
<Style TargetType="ContextMenu">
<Setter Property="StaysOpen" Value="False" />
<Setter Property="Background" Value="{DynamicResource MenuMaterial}" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimary}" />
<Setter Property="BorderBrush" Value="{DynamicResource MenuStroke}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Padding" Value="5" />
<Setter Property="MinWidth" Value="244" />
<Setter Property="MaxWidth" Value="380" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContextMenu">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource PopupRadius}"
Padding="{TemplateBinding Padding}">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"
CanContentScroll="True" Focusable="False">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DestructiveMenuItem" TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="Foreground" Value="{DynamicResource DangerText}" />
</Style>
</ResourceDictionary>