misc: simplify OnPlatform use case.

This commit is contained in:
Zhang Dian
2025-04-15 22:26:53 +08:00
parent cee8aac2d2
commit 00345f5d34
2 changed files with 6 additions and 33 deletions

View File

@@ -15,8 +15,8 @@
x:DataType="viewModels:MainWindowViewModel"
WindowStartupLocation="CenterScreen"
Icon="/Assets/Ursa.ico"
IsFullScreenButtonVisible="{OnPlatform True, macOS=False}"
IsManagedResizerVisible="{OnPlatform False, Linux=True}"
IsFullScreenButtonVisible="{OnPlatform {x:True}, macOS={x:False}}"
IsManagedResizerVisible="{OnPlatform {x:False}, Linux={x:True}}"
mc:Ignorable="d">
<u:UrsaWindow.RightContent>
<views:TitleBarRightContent />

View File

@@ -11,39 +11,12 @@
<Setter Property="ExtendClientAreaTitleBarHeightHint" Value="-1" />
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
<Setter Property="u:OverlayDialogHost.IsModalStatusScope" Value="True" />
<Setter Property="IsMinimizeButtonVisible">
<OnPlatform>
<On Options="Default, Windows, Linux">
<x:Boolean>True</x:Boolean>
</On>
<On Options="macOS">
<x:Boolean>False</x:Boolean>
</On>
</OnPlatform>
</Setter>
<Setter Property="IsRestoreButtonVisible">
<OnPlatform>
<On Options="Default, Windows, Linux">
<x:Boolean>True</x:Boolean>
</On>
<On Options="macOS">
<x:Boolean>False</x:Boolean>
</On>
</OnPlatform>
</Setter>
<Setter Property="IsCloseButtonVisible">
<OnPlatform>
<On Options="Default, Windows, Linux">
<x:Boolean>True</x:Boolean>
</On>
<On Options="macOS">
<x:Boolean>False</x:Boolean>
</On>
</OnPlatform>
</Setter>
<Setter Property="IsMinimizeButtonVisible" Value="{OnPlatform {x:True},macOS={x:False}}" />
<Setter Property="IsRestoreButtonVisible" Value="{OnPlatform {x:True},macOS={x:False}}" />
<Setter Property="IsCloseButtonVisible" Value="{OnPlatform {x:True},macOS={x:False}}"/>
<Setter Property="SystemDecorations">
<OnPlatform>
<On Options="Default, Windows, macOS">
<On Options="Default">
<SystemDecorations>Full</SystemDecorations>
</On>
<On Options="Linux">