<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:d="http://schemas.microsoft.com/expression/blend/2008"
                    mc:Ignorable="d">

    <Style TargetType="{x:Type MainWindow}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type MainWindow}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            d:DesignWidth="1280"
                            d:DesignHeight="960">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Grid.Resources>
                                <Storyboard x:Key="VisibilityOn">
                                    <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin"
                                                                      Storyboard.TargetName="PART_Notifications">
                                        <SplineThicknessKeyFrame KeyTime="00:00:00"
                                                Value="-260,0,0,0"/>
                                        <SplineThicknessKeyFrame KeyTime="0:0:0.10"
                                                Value="0,0,0,0"/>
                                    </ThicknessAnimationUsingKeyFrames>
                                </Storyboard>
                                <Storyboard x:Key="VisibilityOff">
                                    <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin"
                                                                      Storyboard.TargetName="PART_Notifications">
                                        <SplineThicknessKeyFrame KeyTime="00:00:00"
                                                Value="0,0,0,0"/>
                                        <SplineThicknessKeyFrame KeyTime="0:0:0.10"
                                                Value="-260,0,0,0"/>
                                    </ThicknessAnimationUsingKeyFrames>
                                </Storyboard>
                            </Grid.Resources>

                            <DockPanel>
                                <Sidebar x:Name="PART_Sidebar"
                                        Panel.ZIndex="999"
                                         DockPanel.Dock="{Settings SidebarPosition}"/>
                                <ContentControl Name="PART_ContentView"
                                                DockPanel.Dock="Top"/>
                            </DockPanel>

                            <ContentControl x:Name="Melcosoft_FooterDownloadBar"
                                            HorizontalAlignment="Stretch"
                                            VerticalAlignment="Bottom"
                                            Panel.ZIndex="5000"/>

                            <NotificationPanel x:Name="PART_Notifications"
                                               WindowChrome.IsHitTestVisibleInChrome="True"
                                               Width="260"
                                               Grid.Row="0"
                                    Grid.Column="0"
                                    Grid.RowSpan="2"
                                               HorizontalAlignment="Left"
                                    VerticalAlignment="Stretch"
                                               AnimatedVisibility.Visibility="{Settings NotificationPanelVisible}"
                                               AnimatedVisibility.Visible="{StaticResource VisibilityOn}"
                                               AnimatedVisibility.Collapsed="{StaticResource VisibilityOff}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
