<mde:MaterialWindow
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
                    xmlns:s="https://github.com/canton7/Stylet"
                    xmlns:screens="clr-namespace:Artemis.UI.Screens"
                    xmlns:mde="clr-namespace:MaterialDesignExtensions.Controls;assembly=MaterialDesignExtensions"
                    xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
                    xmlns:Shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" x:Class="Artemis.UI.Screens.RootView"
                    mc:Ignorable="d"
                    FadeContentIfInactive="False"
                    Icon="/Resources/Images/Logo/bow.ico"
                    Title="{Binding WindowTitle}"
                    TitleBarIcon="{svgc:SvgImage Source=/Resources/Images/Logo/bow-white.svg}"
                    Foreground="{DynamicResource MaterialDesignBody}"
                    Background="{DynamicResource MaterialDesignPaper}"
                    FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
                    UseLayoutRounding="True"
                    Deactivated="{s:Action WindowDeactivated}"
                    Activated="{s:Action WindowActivated}"
                    StateChanged="{s:Action WindowStateChanged}"
                    KeyDown="{s:Action WindowKeyDown}"
                    KeyUp="{s:Action WindowKeyUp}"
                    MouseDown="{s:Action WindowMouseDown}"
                    MouseUp="{s:Action WindowMouseUp}"
                    d:DesignHeight="640" d:DesignWidth="1200"
                    d:DataContext="{d:DesignInstance {x:Type screens:RootViewModel}}">
    <mde:MaterialWindow.Resources>
        <Shared:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>
    </mde:MaterialWindow.Resources>
    <materialDesign:DialogHost IsTabStop="False" Focusable="False" Identifier="RootDialog" DialogTheme="Inherit" SnackbarMessageQueue="{Binding MainMessageQueue}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="{Binding SidebarWidth.Value, Mode=TwoWay}" MinWidth="175" MaxWidth="400" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Border Grid.Column="0" ClipToBounds="True" Background="{DynamicResource MaterialDesignToolBarBackground}">
                <ContentControl s:View.Model="{Binding SidebarViewModel}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" IsTabStop="False" />
            </Border>

            <GridSplitter Grid.Column="0" Width="8" Margin="0 0 -4 0" Background="Transparent" />

            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <materialDesign:ColorZone Grid.Row="0" 
                                          Mode="PrimaryMid" 
                                          DockPanel.Dock="Top" 
                                          Panel.ZIndex="1" 
                                          Height="48" 
                                          Visibility="{Binding SidebarViewModel.SelectedScreen.HeaderViewModel, Converter={StaticResource NullToVisibilityConverter}}" >
                    <ContentControl s:View.Model="{Binding SidebarViewModel.SelectedScreen.HeaderViewModel}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" IsTabStop="False" />
                </materialDesign:ColorZone>

                <ContentControl Grid.Row="1"
                                s:View.Model="{Binding SidebarViewModel.SelectedScreen}"
                                VerticalContentAlignment="Stretch"
                                HorizontalContentAlignment="Stretch"
                                IsTabStop="False" />

                <Border Grid.Row="1" Visibility="{Binding SidebarViewModel.ActivatingProfile, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay, Delay=2000}">
                    <Border.Background>
                        <SolidColorBrush Color="{Binding Path=Color, Source={StaticResource MaterialDesignToolBarBackground}}" Opacity="0.5"></SolidColorBrush>
                    </Border.Background>
                    <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                        <ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" IsIndeterminate="True" Width="50" Height="50" Margin="20"/>
                        <TextBlock TextAlignment="Center"  Style="{StaticResource MaterialDesignHeadline5TextBlock}">
                            Activating profile...
                        </TextBlock>
                    </StackPanel>
                </Border>

                <materialDesign:Snackbar Grid.Row="0"
                                         Grid.RowSpan="2"
                                         x:Name="MainSnackbar"
                                         MessageQueue="{Binding MainMessageQueue}"
                                         materialDesign:SnackbarMessage.InlineActionButtonMaxHeight="80"
                                         materialDesign:SnackbarMessage.ContentMaxHeight="200" />
            </Grid>
        </Grid>
    </materialDesign:DialogHost>
</mde:MaterialWindow>