|
@@ -0,0 +1,103 @@
|
|
|
+<ResourceDictionary
|
|
|
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
+ xmlns:cnvt="clr-namespace:Waaagh.Converters"
|
|
|
+ xmlns:custom="clr-namespace:Waaagh.CustomControl"
|
|
|
+ xmlns:helper="clr-namespace:Waaagh.Helpers">
|
|
|
+
|
|
|
+ <Style x:Key="TitleButtonStyle" TargetType="Button">
|
|
|
+ <Setter Property="Margin" Value="1"/>
|
|
|
+ <Setter Property="BorderThickness" Value="0"/>
|
|
|
+ <Setter Property="Width" Value="28"/>
|
|
|
+ <Setter Property="Height" Value="28"/>
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <TextBlock x:Key="TestContent" Text="Test"/>
|
|
|
+ <TextBlock x:Key="TestContent2" Text="Testsds"/>
|
|
|
+
|
|
|
+ <Style TargetType="{x:Type custom:WaaaghWindow}">
|
|
|
+
|
|
|
+ <Setter Property="WindowChrome.WindowChrome">
|
|
|
+ <Setter.Value>
|
|
|
+ <WindowChrome CaptionHeight="32" ResizeBorderThickness="5" UseAeroCaptionButtons="False"/>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+
|
|
|
+ <Setter Property="Width" Value="450"/>
|
|
|
+ <Setter Property="Height" Value="800"/>
|
|
|
+ <Setter Property="Background" Value="AliceBlue"/>
|
|
|
+
|
|
|
+ <Setter Property="Template">
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate TargetType="{x:Type custom:WaaaghWindow}">
|
|
|
+ <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
|
|
|
+ <Border x:Name="LayoutRoot" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
|
|
+ <DockPanel>
|
|
|
+ <Border DockPanel.Dock="Top" Height="28">
|
|
|
+ <DockPanel LastChildFill="True" Background="Beige">
|
|
|
+
|
|
|
+
|
|
|
+ <!--#region TitleButton-->
|
|
|
+ <Grid DockPanel.Dock="Right">
|
|
|
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" WindowChrome.IsHitTestVisibleInChrome="True"
|
|
|
+ Visibility="{TemplateBinding TitleBarButtons, Converter={cnvt:DefaultContentVisibilityConverter}}">
|
|
|
+ <Button Style="{StaticResource TitleButtonStyle}" Command="{x:Static SystemCommands.MinimizeWindowCommand}" Content="-"/>
|
|
|
+ <Button Style="{StaticResource TitleButtonStyle}" Command="{x:Static SystemCommands.MaximizeWindowCommand}" Content="{StaticResource TestContent}"
|
|
|
+ Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=WindowState, Converter={cnvt:IsCollapsedConverter}, ConverterParameter={x:Static WindowState.Maximized}}"/>
|
|
|
+ <Button Style="{StaticResource TitleButtonStyle}" Command="{x:Static SystemCommands.RestoreWindowCommand}" Content="{StaticResource TestContent2}"
|
|
|
+ Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=WindowState, Converter={cnvt:IsCollapsedConverter}, ConverterParameter={x:Static WindowState.Normal}}"/>
|
|
|
+ <Button Style="{StaticResource TitleButtonStyle}" Command="{x:Static SystemCommands.CloseWindowCommand}" Content="X"/>
|
|
|
+ </StackPanel>
|
|
|
+ <ItemsControl ItemsSource="{TemplateBinding TitleBarButtons}" HorizontalAlignment="Right" VerticalAlignment="Center">
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" WindowChrome.IsHitTestVisibleInChrome="True"/>
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
+
|
|
|
+ <ItemsControl.ItemContainerStyle>
|
|
|
+ <Style TargetType="Button" BasedOn="{StaticResource TitleButtonStyle}"/>
|
|
|
+ </ItemsControl.ItemContainerStyle>
|
|
|
+ </ItemsControl>
|
|
|
+ </Grid>
|
|
|
+ <!--#endregion-->
|
|
|
+
|
|
|
+ <!--#region TitleContent-->
|
|
|
+ <Border DockPanel.Dock="Left">
|
|
|
+ <Grid>
|
|
|
+ <StackPanel Orientation="Horizontal" Visibility="{TemplateBinding TitleBarContent, Converter={cnvt:DefaultContentVisibilityConverter}}">
|
|
|
+ <Image Source="{TemplateBinding Icon}"/>
|
|
|
+ <TextBlock Text="{TemplateBinding Title}" VerticalAlignment="Center"/>
|
|
|
+ </StackPanel>
|
|
|
+ <ContentPresenter ContentSource="TitleBarContent"/>
|
|
|
+ </Grid>
|
|
|
+ </Border>
|
|
|
+ <!--#endregion-->
|
|
|
+
|
|
|
+ </DockPanel>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <Border Background="{TemplateBinding Background}">
|
|
|
+ <AdornerDecorator>
|
|
|
+ <ContentPresenter/>
|
|
|
+ </AdornerDecorator>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ </DockPanel>
|
|
|
+ </Border>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <Trigger Property="WindowState" Value="Maximized">
|
|
|
+ <Setter TargetName="LayoutRoot" Property="Margin" Value="{x:Static helper:WindowHelper.ChromeThickness}"/>
|
|
|
+ </Trigger>
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
+
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+ </Style>
|
|
|
+</ResourceDictionary>
|