mirror of
https://github.com/DarthAffe/Arge.git
synced 2022-11-28 19:26:16 +00:00
(I'm not quite happy with everything so far, but it seems like I'm to stupid to understand how to correctly use routing with the layout I want)
122 lines
7.4 KiB
XML
122 lines
7.4 KiB
XML
<resources:CachedResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:resources="clr-namespace:Arge.Resources"
|
|
xmlns:buttons="clr-namespace:Arge.Controls.Buttons"
|
|
xmlns:window="clr-namespace:Arge.Controls.Window">
|
|
|
|
<resources:CachedResourceDictionary.MergedDictionaries>
|
|
<resources:CachedResourceDictionary Source="/Arge;component/Styles/ImageButton.xaml" />
|
|
<resources:CachedResourceDictionary Source="/Arge;component/Converter/Converter.xaml" />
|
|
</resources:CachedResourceDictionary.MergedDictionaries>
|
|
|
|
<Style x:Key="StyleImageButtonWindow"
|
|
BasedOn="{StaticResource StyleImageButtonWithOpacity}"
|
|
TargetType="{x:Type buttons:ImageButton}">
|
|
<Setter Property="Padding" Value="4" />
|
|
<Setter Property="Margin" Value="4" />
|
|
<Setter Property="VerticalAlignment" Value="Top" />
|
|
<Setter Property="Width" Value="24" />
|
|
<Setter Property="Height" Value="24" />
|
|
</Style>
|
|
|
|
<Style x:Key="StyleBlurredDecorationWindow"
|
|
TargetType="{x:Type window:BlurredDecorationWindow}">
|
|
<Setter Property="WindowStyle" Value="None" />
|
|
<Setter Property="ResizeMode" Value="CanResize" />
|
|
<Setter Property="AllowsTransparency" Value="True" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
|
<Setter Property="BorderThickness" Value="1,0,1,1" />
|
|
<Setter Property="DecorationHeight" Value="80" />
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BrushWindowBorder}" />
|
|
<Setter Property="Background" Value="{DynamicResource BrushWindowBackground}" />
|
|
<Setter Property="BackgroundImage" Value="{Binding Source={x:Static resources:ImageSources.Instance}, Path=WindowBackground}" />
|
|
<Setter Property="MinWidth" Value="256" />
|
|
<Setter Property="MinHeight" Value="144" />
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
<Setter Property="WindowChrome.WindowChrome">
|
|
<Setter.Value>
|
|
<WindowChrome CaptionHeight="0" ResizeBorderThickness="5" />
|
|
</Setter.Value>
|
|
</Setter>
|
|
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type window:BlurredDecorationWindow}">
|
|
<Grid Background="{TemplateBinding Background}">
|
|
<Grid Margin="-12,-12,-12,0">
|
|
<Viewbox HorizontalAlignment="Center" Stretch="UniformToFill">
|
|
<Image Source="{TemplateBinding BackgroundImage}" />
|
|
</Viewbox>
|
|
|
|
<Border Name="BlurImage">
|
|
<Border.OpacityMask>
|
|
<VisualBrush TileMode="None" Stretch="None" AlignmentX="Center" AlignmentY="Center">
|
|
<VisualBrush.Visual>
|
|
<Grid Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=Border}}"
|
|
Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=Border}}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="12" />
|
|
<RowDefinition Height="92" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Rectangle Fill="Black" Grid.Row="0" Grid.RowSpan="2" />
|
|
<Rectangle Fill="Transparent" Grid.Row="2" />
|
|
</Grid>
|
|
</VisualBrush.Visual>
|
|
</VisualBrush>
|
|
</Border.OpacityMask>
|
|
|
|
<Border.Effect>
|
|
<BlurEffect Radius="30" />
|
|
</Border.Effect>
|
|
|
|
<Viewbox HorizontalAlignment="Center" Stretch="UniformToFill">
|
|
<Image Source="{TemplateBinding BackgroundImage}" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
|
</Viewbox>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<Border BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}">
|
|
<DockPanel LastChildFill="True">
|
|
<Border x:Name="PART_Decoration"
|
|
DockPanel.Dock="Top"
|
|
HorizontalAlignment="Stretch"
|
|
Height="{TemplateBinding DecorationHeight}"
|
|
Background="{TemplateBinding BorderBrush}">
|
|
<DockPanel HorizontalAlignment="Stretch" Margin="4" LastChildFill="False">
|
|
<buttons:ImageButton x:Name="PART_CloseButton"
|
|
DockPanel.Dock="Right"
|
|
Style="{StaticResource StyleImageButtonWindow}"
|
|
Image="{Binding Source={x:Static resources:ImageSources.Instance}, Path=WindowClose}"
|
|
ToolTip="Close" />
|
|
|
|
<buttons:ImageButton x:Name="PART_MinimizeButton"
|
|
DockPanel.Dock="Right"
|
|
Style="{StaticResource StyleImageButtonWindow}"
|
|
Image="{Binding Source={x:Static resources:ImageSources.Instance}, Path=WindowMinimize}"
|
|
ToolTip="Minimize" />
|
|
|
|
<buttons:ImageButton x:Name="PART_IconButton"
|
|
DockPanel.Dock="Left"
|
|
VerticalAlignment="Center"
|
|
Margin="8"
|
|
Style="{StaticResource StyleImageButtonWithOpacity}"
|
|
Image="{TemplateBinding Icon}"
|
|
ToolTip="http://arge.be" />
|
|
</DockPanel>
|
|
</Border>
|
|
|
|
<ContentPresenter x:Name="PART_Content" />
|
|
</DockPanel>
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
</resources:CachedResourceDictionary>
|
|
|