feat: add simple locale switch.

This commit is contained in:
Dong Bin
2025-01-03 15:19:32 +08:00
parent ad4bead1bd
commit 609dfbb5f0
3 changed files with 78 additions and 3 deletions

View File

@@ -46,6 +46,21 @@
<Setter Property="Theme" Value="{DynamicResource InnerPathIcon}" />
</Style>
</StackPanel.Styles>
<Button>
<PathIcon Data="{StaticResource SemiIconLanguage}" />
<Button.Flyout>
<MenuFlyout Placement="Bottom" ItemsSource="{Binding LocaleItems}" />
</Button.Flyout>
<Button.Styles>
<Style Selector="MenuItem" x:DataType="views:MenuItemViewModel">
<Setter Property="Header" Value="{Binding Header}" />
<Setter Property="ItemsSource" Value="{Binding Items}" />
<Setter Property="Command" Value="{Binding Command}" />
<Setter Property="CommandParameter" Value="{Binding CommandParameter}" />
</Style>
</Button.Styles>
</Button>
<Button Command="{Binding OpenUrlCommand}" CommandParameter="{Binding DocumentationUrl}">
<PathIcon Data="{StaticResource SemiIconGlobe}" />
@@ -60,7 +75,7 @@
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}"
Command="{Binding ToggleThemeCommand}"
OnContent="{StaticResource SemiIconMoon}"
OffContent="{StaticResource SemiIconSun}" />
OffContent="{StaticResource SemiIconSun}"/>
<Button>
<PathIcon Data="{StaticResource SemiIconMenu}" />