ux: remove rounded corner when window is maximized using TemplateBinding (#378)

This commit is contained in:
leo 2024-08-20 20:59:57 +08:00
parent 66b28621d1
commit f4f5ae7430
No known key found for this signature in database

View file

@ -47,6 +47,7 @@
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
<Setter Property="SystemDecorations" Value="None"/> <Setter Property="SystemDecorations" Value="None"/>
<Setter Property="Padding" Value="12"/> <Setter Property="Padding" Value="12"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
@ -120,9 +121,9 @@
Background="{DynamicResource Brush.Window}" Background="{DynamicResource Brush.Window}"
BorderBrush="{DynamicResource Brush.WindowBorder}" BorderBrush="{DynamicResource Brush.WindowBorder}"
BorderThickness="1" BorderThickness="1"
CornerRadius="8"> CornerRadius="{TemplateBinding CornerRadius}">
<VisualLayerManager> <VisualLayerManager>
<Border CornerRadius="8" ClipToBounds="True"> <Border CornerRadius="{TemplateBinding CornerRadius}" ClipToBounds="True">
<ContentPresenter Name="PART_ContentPresenter" <ContentPresenter Name="PART_ContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
@ -139,11 +140,11 @@
<Style Selector="Window.custom_window_frame[WindowState=Maximized]"> <Style Selector="Window.custom_window_frame[WindowState=Maximized]">
<Setter Property="Padding" Value="0"/> <Setter Property="Padding" Value="0"/>
<Setter Property="CornerRadius" Value="0"/>
</Style> </Style>
<Style Selector="Window.custom_window_frame[WindowState=Maximized] /template/ Border#PART_ContentRoot"> <Style Selector="Window.custom_window_frame[WindowState=Maximized] /template/ Border#PART_ContentRoot">
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
<Setter Property="CornerRadius" Value="0"/>
</Style> </Style>
<Style Selector="Window.custom_window_frame[WindowState=Maximized] /template/ Border.resize_border"> <Style Selector="Window.custom_window_frame[WindowState=Maximized] /template/ Border.resize_border">