Files
effector.plugin.lib/Effector.Plugin.Lib/Themes/Generic.xaml
T
Emmanuele Sassi 139b805055 - primo commit
2025-02-07 12:32:14 +01:00

57 lines
2.7 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:Effector.Plugin.Lib">
<local:CaptionHeightConverter x:Key="CaptionHeightConverter"/>
<Style TargetType="{x:Type local:EgtWindow}" BasedOn="{StaticResource {x:Type Window}}">
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome CaptionHeight="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type local:EgtWindow}}}"
GlassFrameThickness="0"
CornerRadius="0"
ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}"/>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<Border BorderThickness="0"
BorderBrush="LightGray"
Background="{TemplateBinding Background}">
<ContentPresenter Grid.Row="1"
Content="{TemplateBinding Content}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="WindowState" Value="Maximized">
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome CaptionHeight="{Binding TitleBarHeight, RelativeSource={RelativeSource AncestorType={x:Type local:EgtWindow}}, Converter={StaticResource CaptionHeightConverter}}"
GlassFrameThickness="0"
CornerRadius="0"
ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}"/>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<!--bordo necessario per evitare la parte che esce dallo schermo-->
<Border BorderThickness="7"
BorderBrush="LightGray"
Background="{TemplateBinding Background}">
<ContentPresenter Grid.Row="1"
Content="{TemplateBinding Content}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>