Files
Shrlalgo.RvKits/WPFluent/Controls/Window/Window.xaml

73 lines
3.6 KiB
XML

<!--
This Source Code Form is subject to the terms of the MIT License.
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
All Rights Reserved.
-->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFluent.Controls">
<!--
SingleBorderWindow preserves the animations and scaling properly.
By default, the navigation buttons will be hidden by the background.
If we use Mica, we hide them manually.
-->
<Style x:Key="DefaultWindowStyle" TargetType="{x:Type Window}">
<Setter Property="Background" Value="{DynamicResource WindowBackground}" />
<Setter Property="Foreground" Value="{DynamicResource WindowForeground}" />
<Setter Property="Height" Value="600" />
<Setter Property="MinHeight" Value="320" />
<Setter Property="Width" Value="1100" />
<Setter Property="MinWidth" Value="460" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="WindowStyle" Value="SingleBorderWindow" />
<Setter Property="AllowsTransparency" Value="False" />
<Setter Property="ResizeMode" Value="CanResize" />
<!-- The Display option casues a large aliasing effect -->
<!-- <Setter Property="TextOptions.TextFormattingMode" Value="Ideal" /> -->
<!-- I don't know if this is always the case, but ClearType blurs the fonts a bit for me -->
<!--<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />-->
<Setter Property="RenderOptions.BitmapScalingMode" Value="Linear" />
<!-- Aliased breaks rounded control elements such as buttons -->
<Setter Property="RenderOptions.EdgeMode" Value="Unspecified" />
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<AdornerDecorator>
<controls:ClientAreaBorder
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter x:Name="ContentPresenter" />
</controls:ClientAreaBorder>
</AdornerDecorator>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="WindowState" Value="Normal">
<Setter Property="ResizeMode" Value="CanResize" />
</Trigger>
<Trigger Property="WindowState" Value="Maximized">
<Setter Property="ResizeMode" Value="NoResize" />
<Setter Property="Topmost" Value="False" />
</Trigger>
</Style.Triggers>
</Style>
<Style BasedOn="{StaticResource DefaultWindowStyle}" TargetType="{x:Type Window}" />
</ResourceDictionary>