<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 MainPanel}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type MainPanel}">
                    <Border Height="50" BorderBrush="{DynamicResource PanelSeparatorBrush}"
                            Background="{TemplateBinding Background}"
                            d:DesignWidth="1280"
                            d:DataContext="{x:Static DesignMainViewModel.DesignIntance}">
                        <Border.Style>
                            <Style TargetType="Border">
                                <Setter Property="BorderThickness" Value="0,0,0,1" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Settings ShowPanelSeparators}" Value="False">
                                        <Setter Property="BorderThickness" Value="0" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                        <DockPanel Margin="0,3,110,3">
                            <Border x:Name="PART_ElemMainMenu" Background="Transparent"
                                    DockPanel.Dock="Left" Margin="5,0,0,0" Cursor="Hand"
                                    WindowChrome.IsHitTestVisibleInChrome="True">
                                <Image Source="{ThemeFile 'Images/applogo.png'}"
                                       Height="40" RenderOptions.BitmapScalingMode="Fant"
                                       Margin="10,0,5,0"/>
                            </Border>

                            <SearchBox x:Name="PART_TextMainSearch"
                                        Margin="5,6,0,6" DockPanel.Dock="Left"
                                        WindowChrome.IsHitTestVisibleInChrome="True"
                                        Width="300" />                      

                            <Border x:Name="PART_ElemViewMenu" Background="Transparent"
                                    DockPanel.Dock="Left" Margin="10,6,0,6" Width="35"
                                    WindowChrome.IsHitTestVisibleInChrome="True"
                                    Style="{DynamicResource HighlightBorder}">
                                <TextBlock Text="⋯" FontSize="26" 
                                           Foreground="{StaticResource TextBrush}"
                                           VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            </Border>

                            <CheckBox x:Name="PART_ToggleFilter"
                                      WindowChrome.IsHitTestVisibleInChrome="True"
                                      DockPanel.Dock="Left" Margin="10,6,0,6" MinWidth="35">
                                <CheckBox.Style>
                                    <Style TargetType="CheckBox">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Border Style="{DynamicResource HighlightBorder}"
                                                            Background="Transparent">
                                                        <StackPanel Orientation="Horizontal" Margin="6,0,6,0">
                                                            <TextBlock Text="&#xef29;"
                                                                       FontFamily="{StaticResource FontIcoFont}" FontSize="20"
                                                                       VerticalAlignment="Center" HorizontalAlignment="Center"
                                                                       Foreground="{TemplateBinding Foreground}"/>
                                                            <TextBlock Text="{StaticResource LOCFilterActiveLabel}"
                                                                       Style="{StaticResource BaseTextBlockStyle}"
                                                                       Margin="3,0,0,0" VerticalAlignment="Center"
                                                                       Name="TextFilter" />
                                                        </StackPanel>
                                                    </Border>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="Tag" Value="{StaticResource True}">
                                                            <Setter Property="Foreground" Value="{DynamicResource GlyphBrush}" />
                                                            <Setter Property="Visibility" Value="Visible" TargetName="TextFilter" />
                                                        </Trigger>
                                                        <Trigger Property="Tag" Value="{StaticResource False}">
                                                            <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                                                            <Setter Property="Visibility" Value="Collapsed" TargetName="TextFilter" />
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </CheckBox.Style>
                            </CheckBox>

                            <CheckBox x:Name="PART_ToggleNotifications"
                                      WindowChrome.IsHitTestVisibleInChrome="True"
                                      DockPanel.Dock="Left" Margin="10,6,0,6">
                                <CheckBox.Style>
                                    <Style TargetType="ToggleButton">
                                        <Setter Property="Foreground" Value="{DynamicResource GlyphBrush}" />
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Border Background="Transparent">
                                                        <Grid>
                                                            <TextBlock Text="&#xeea3;" FontFamily="{StaticResource FontIcoFont}" FontSize="24"
                                                                       Foreground="{TemplateBinding Foreground}"
                                                                       HorizontalAlignment="Center"/>
                                                            <Border CornerRadius="3" Width="15" Height="15"
                                                                    Margin="20,0,0,0"
                                                                    HorizontalAlignment="Right"
                                                                    VerticalAlignment="Bottom"
                                                                    Background="OrangeRed">
                                                                <TextBlock Text="{Api Notifications.Count}" FontSize="12"                                                               
                                                                           Foreground="{DynamicResource TextBrush}"
                                                                           HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                            </Border>
                                                        </Grid>
                                                    </Border>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Api Notifications.Count}" Value="0">
                                                <Setter Property="Visibility" Value="Collapsed"/>
                                            </DataTrigger>
                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                                            </Trigger>
                                        </Style.Triggers>
                                    </Style>
                                </CheckBox.Style>
                            </CheckBox>

                            <Button Name="PART_ButtonSteamFriends"
                                    Margin="15,6,5,6" DockPanel.Dock="Right"
                                    Background="Transparent"
                                    Padding="0" BorderThickness="0"
                                    WindowChrome.IsHitTestVisibleInChrome="True"
                                    ToolTip="{DynamicResource LOCSteamFriendsTooltip}">
                                <TextBlock Text="&#xecf9;" FontFamily="{StaticResource FontIcoFont}" FontSize="24"
                                           VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            </Button>

                            <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"
                                        HorizontalAlignment="Center" Margin="0,5,0,5">
                                <Grid MaxWidth="600" MinWidth="300">
                                    <ProgressBar Name="PART_ProgressGlobal" />
                                    <TextBlock Name="PART_TextProgressText"
                                               VerticalAlignment="Center" HorizontalAlignment="Center"
                                               Style="{DynamicResource BaseTextBlockStyle}" Margin="5,0,5,0" />
                                </Grid>

                                <Button Name="PART_ButtonProgressCancel"
                                        Content="{DynamicResource LOCCancelLabel}"
                                        WindowChrome.IsHitTestVisibleInChrome="True"
                                        Margin="5,0,0,0" />
                            </StackPanel>                    
                        </DockPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>