<UserControl x:Class="Memenim.Framework.Navigation.NavigationController"
             d:DataContext="{d:DesignInstance local:NavigationController}"
             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:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:widgets="clr-namespace:Memenim.Framework.Widgets"
             xmlns:local="clr-namespace:Memenim.Framework.Navigation"
             mc:Ignorable="d"
             d:DesignWidth="800" d:DesignHeight="450">

    <UserControl.Resources>
        <SolidColorBrush x:Key="OverlayButton.Static.Background"
                         Color="#E54D4D4D"/>
        <SolidColorBrush x:Key="OverlayButton.MouseOver.Background"
                         Color="#C8AAAAAA"/>
        <SolidColorBrush x:Key="OverlayButton.Pressed.Background"
                         Color="#E54D4D4D"/>
        <SolidColorBrush x:Key="OverlayButton.Disabled.Background"
                         Color="#FFF4F4F4"/>
        <SolidColorBrush x:Key="OverlayButton.Disabled.Foreground"
                         Color="#FF838383"/>

        <Style x:Key="OverlayButton"
               TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="PART_Border"
                                Background="{DynamicResource OverlayButton.Static.Background}"
                                SnapsToDevicePixels="true"
                                BorderThickness="0">
                            <ContentPresenter x:Name="PART_ContentPresenter"
                                              Focusable="False"
                                              RecognizesAccessKey="True"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Margin="{TemplateBinding Padding}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsDefaulted"
                                     Value="true">
                                <Setter TargetName="PART_Border"
                                        Property="Background"
                                        Value="{StaticResource {x:Static SystemColors.HighlightBrushKey}}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver"
                                     Value="true">
                                <Setter TargetName="PART_Border"
                                        Property="Background"
                                        Value="{StaticResource OverlayButton.MouseOver.Background}"/>
                            </Trigger>
                            <Trigger Property="IsPressed"
                                     Value="true">
                                <Setter TargetName="PART_Border"
                                        Property="Background"
                                        Value="{StaticResource OverlayButton.Pressed.Background}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled"
                                     Value="false">
                                <Setter TargetName="PART_Border"
                                        Property="Background"
                                        Value="{StaticResource OverlayButton.Disabled.Background}"/>
                                <Setter TargetName="PART_ContentPresenter"
                                        Property="Control.Foreground"
                                        Value="{StaticResource OverlayButton.Disabled.Foreground}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid>
        <controls:SplitView x:Name="RootLayout"
                            DisplayMode="Inline"
                            MinimumOpenPaneLength="40"
                            MaximumOpenPaneLength="40"
                            CompactPaneLength="40">
            <controls:SplitView.Pane>
                <Grid MinWidth="40"
                      Width="40"
                      HorizontalAlignment="Left">
                    <widgets:NavigationBar x:Name="NavBar"/>
                </Grid>
            </controls:SplitView.Pane>

            <Grid>
                <controls:TransitioningContentControl x:Name="PageContent"/>
                <Grid x:Name="OverlayLayout">
                    <Button Style="{StaticResource OverlayButton}"
                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                            Click="OverlayBackground_Click"/>
                    <controls:TransitioningContentControl x:Name="OverlayContent"
                                                          Margin="50"/>
                </Grid>
            </Grid>
        </controls:SplitView>
    </Grid>
</UserControl>
