<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:bpa="clr-namespace:BPA.UIControl">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/ScrollViewer.xaml" />
        <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/Menu.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--  HamburgerMenuItem  -->
    <Style x:Key="RubyerHamburgerMenuItem" TargetType="{x:Type bpa:HamburgerMenuItem}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Padding" Value="{Binding Path=(bpa:ItemsControlHelper.ItemPadding), RelativeSource={RelativeSource AncestorType=TabControl}}" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="ToolTipService.Placement" Value="Right" />
        <Setter Property="ToolTipService.PlacementTarget" Value="{Binding RelativeSource={RelativeSource Self}}" />
        <Setter Property="ToolTipService.VerticalOffset" Value="3" />
        <Setter Property="ToolTipService.InitialShowDelay" Value="300" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type bpa:HamburgerMenuItem}">
                    <Grid x:Name="root">
                        <Grid Margin="{Binding Path=(bpa:ItemsControlHelper.ItemMargin), RelativeSource={RelativeSource AncestorType=TabControl}}">
                            <bpa:ControlMask Background="{Binding Path=(bpa:ControlHelper.FocusedBrush), RelativeSource={RelativeSource AncestorType=ItemsControl}}"
                                             CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource AncestorType=ItemsControl}}"
                                             IsActive="{TemplateBinding IsSelected}"
                                             MaskOpacity="{Binding Path=(bpa:ControlHelper.MaskOpacity), RelativeSource={RelativeSource AncestorType=ItemsControl}}"
                                             ParentElement="{Binding ElementName=root}" />

                            <bpa:Transition x:Name="littleBar"
                                            HorizontalAlignment="Left"
                                            IsShow="{TemplateBinding IsSelected}"
                                            Type="ZoomY"
                                            Visibility="{Binding IsShowLittleBar, RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}, Converter={StaticResource BooleanToVisibleConverter}}">
                                <Rectangle Width="3"
                                           Height="{Binding ActualHeight, ElementName=header}"
                                           Fill="{Binding Path=(bpa:ControlHelper.SelectedBrush), RelativeSource={RelativeSource AncestorType=ItemsControl}}" />
                            </bpa:Transition>
                        </Grid>

                        <Border x:Name="Bd" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="iconClolumn" Width="{Binding CollapsedWidth, RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}, Converter={StaticResource DoubleToGridLengthConverter}}" />
                                    <ColumnDefinition x:Name="headerColumn" Width="*" />
                                </Grid.ColumnDefinitions>

                                <bpa:Icon x:Name="icon"
                                          Focusable="False"
                                          IsHitTestVisible="False"
                                          Type="{TemplateBinding IconType}"
                                          Visibility="Collapsed" />

                                <ContentPresenter x:Name="iconContent"
                                                  Width="{Binding ActualHeight, ElementName=header}"
                                                  Height="{Binding ActualHeight, ElementName=header}"
                                                  HorizontalAlignment="Center"
                                                  VerticalAlignment="Center"
                                                  Content="{TemplateBinding Icon}"
                                                  ContentSource="Icon"
                                                  Focusable="False"
                                                  IsHitTestVisible="False" />

                                <ContentPresenter x:Name="header"
                                                  Grid.Column="1"
                                                  Margin="{TemplateBinding Padding}"
                                                  HorizontalAlignment="Left"
                                                  VerticalAlignment="Center"
                                                  Content="{TemplateBinding Header}"
                                                  ContentSource="Header"
                                                  Focusable="False"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Grid>
                        </Border>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="root" Property="Opacity" Value="{DynamicResource UnenableOpcity}" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Foreground" Value="{Binding Path=(bpa:ControlHelper.FocusedForegroundBrush), RelativeSource={RelativeSource AncestorType=ItemsControl}}" />
                        </Trigger>
                        <DataTrigger Binding="{Binding IconType, RelativeSource={RelativeSource Mode=Self}, Converter={StaticResource NotNullConverter}}" Value="True">
                            <Setter TargetName="icon" Property="Visibility" Value="Visible" />
                            <Setter TargetName="iconContent" Property="Visibility" Value="Collapsed" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsExpanded, RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}" Value="False">
                            <Setter Property="ToolTip" Value="{Binding Header, RelativeSource={RelativeSource Self}, Converter={StaticResource CloneConverter}}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}" Value="Right">
                            <Setter TargetName="littleBar" Property="HorizontalAlignment" Value="Right" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  HamburgerMenuOptionsItem  -->
    <Style x:Key="RubyerHamburgerMenuOptionsItem" TargetType="{x:Type bpa:HamburgerMenuOptionsItem}">
        <Setter Property="Height" Value="Auto" />
        <Setter Property="Cursor" Value="Arrow" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
        <Setter Property="ToolTip" Value="{Binding Header, RelativeSource={RelativeSource Self}, Converter={StaticResource CloneConverter}}" />
        <Setter Property="ToolTipService.Placement" Value="Right" />
        <Setter Property="ToolTipService.PlacementTarget" Value="{Binding RelativeSource={RelativeSource Self}}" />
        <Setter Property="ToolTipService.VerticalOffset" Value="3" />
        <Setter Property="ToolTipService.InitialShowDelay" Value="300" />
        <Setter Property="ToolTipService.IsEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type bpa:HamburgerMenuOptionsItem}">
                    <Grid x:Name="root" Background="{TemplateBinding Background}">
                        <bpa:ControlMask Margin="{Binding Path=(bpa:ItemsControlHelper.ItemMargin), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}"
                                         Background="{Binding Path=(bpa:ControlHelper.FocusedBrush), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}"
                                         CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}"
                                         IsActive="{TemplateBinding IsPressed}"
                                         MaskOpacity="{Binding Path=(bpa:ControlHelper.MaskOpacity), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}" />

                        <Border x:Name="Bd" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="iconClolumn" Width="{Binding CollapsedWidth, RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}, Converter={StaticResource DoubleToGridLengthConverter}}" />
                                    <ColumnDefinition x:Name="headerColumn" Width="*" />
                                </Grid.ColumnDefinitions>

                                <bpa:Icon x:Name="icon"
                                          Focusable="False"
                                          IsHitTestVisible="False"
                                          Type="{TemplateBinding IconType}"
                                          Visibility="Collapsed" />

                                <ContentPresenter x:Name="iconContent"
                                                  Width="{Binding ActualHeight, ElementName=header}"
                                                  Height="{Binding ActualHeight, ElementName=header}"
                                                  HorizontalAlignment="Center"
                                                  VerticalAlignment="Center"
                                                  Content="{TemplateBinding Icon}"
                                                  ContentSource="Icon"
                                                  Focusable="False"
                                                  IsHitTestVisible="False" />

                                <bpa:Icon x:Name="checkIcon"
                                          Width="{Binding ActualHeight, ElementName=header}"
                                          Height="{Binding ActualHeight, ElementName=header}"
                                          HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Focusable="False"
                                          Type="CheckFill"
                                          Visibility="Hidden" />

                                <DockPanel Grid.Column="1" Margin="{Binding Path=(bpa:ItemsControlHelper.ItemPadding), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}">
                                    <bpa:Icon x:Name="moreIcon"
                                              Margin="20 0 0 0"
                                              HorizontalAlignment="Center"
                                              VerticalAlignment="Center"
                                              DockPanel.Dock="Right"
                                              Type="ArrowRightSLine"
                                              Visibility="Hidden" />
                                    <ContentPresenter x:Name="header"
                                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                      ContentSource="Header"
                                                      RecognizesAccessKey="True"
                                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                </DockPanel>

                                <Popup x:Name="Popup"
                                       AllowsTransparency="True"
                                       Focusable="False"
                                       IsOpen="{TemplateBinding IsSubmenuOpen}"
                                       Placement="Right"
                                       PopupAnimation="Fade">
                                    <Grid>
                                        <Border Margin="5"
                                                Padding="5"
                                                Background="{Binding PaneBackground, RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}"
                                                CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}"
                                                Effect="{DynamicResource AllDirectionEffect}" />
                                        <Border x:Name="SubmenuBorder"
                                                Margin="5"
                                                Padding="5"
                                                Background="{Binding PaneBackground, RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}"
                                                BorderBrush="{TemplateBinding BorderBrush}"
                                                BorderThickness="{TemplateBinding BorderThickness}"
                                                CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}"
                                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                            <ScrollViewer Style="{StaticResource MenuScrollViewer}" CanContentScroll="True">
                                                <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                                            </ScrollViewer>
                                        </Border>
                                    </Grid>
                                </Popup>
                            </Grid>
                        </Border>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="root" Property="Opacity" Value="{DynamicResource UnenableOpcity}" />
                        </Trigger>
                        <DataTrigger Binding="{Binding IconType, RelativeSource={RelativeSource Mode=Self}, Converter={StaticResource NotNullConverter}}" Value="True">
                            <Setter TargetName="icon" Property="Visibility" Value="Visible" />
                            <Setter TargetName="iconContent" Property="Visibility" Value="Collapsed" />
                        </DataTrigger>
                        <Trigger Property="Role" Value="SubmenuItem">
                            <Setter TargetName="iconClolumn" Property="Width" Value="{Binding Path=(bpa:MenuHelper.IconWidth), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}" />
                        </Trigger>
                        <Trigger Property="Role" Value="SubmenuHeader">
                            <Setter TargetName="moreIcon" Property="Visibility" Value="Visible" />
                            <Setter TargetName="iconClolumn" Property="Width" Value="{Binding Path=(bpa:MenuHelper.IconWidth), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Role" Value="SubmenuItem" />
                                <Condition Property="IsChecked" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="checkIcon" Property="Visibility" Value="Visible" />
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Role" Value="SubmenuItem" />
                                <Condition Property="IsCheckable" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="icon" Property="Visibility" Value="Hidden" />
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Role, RelativeSource={RelativeSource Self}}" Value="TopLevelHeader" />
                    <Condition Binding="{Binding IsExpanded, FallbackValue=True, RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}" Value="False" />
                </MultiDataTrigger.Conditions>
                <Setter Property="ToolTipService.IsEnabled" Value="True" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Role, RelativeSource={RelativeSource Self}}" Value="TopLevelItem" />
                    <Condition Binding="{Binding IsExpanded, FallbackValue=True, RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}" Value="False" />
                </MultiDataTrigger.Conditions>
                <Setter Property="ToolTipService.IsEnabled" Value="True" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="RubyerHamburgerMenuOptions"
           BasedOn="{StaticResource RubyerMenu}"
           TargetType="bpa:HamburgerMenuOptions">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type bpa:HamburgerMenuOptions}">
                    <Border x:Name="border"
                            Background="Transparent"
                            CornerRadius="{DynamicResource AllControlCornerRadius}">
                        <StackPanel ClipToBounds="True" IsItemsHost="True" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  HamburgerMenu  -->
    <Style x:Key="RubyerHamburgerMenu" TargetType="{x:Type bpa:HamburgerMenu}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{DynamicResource Border}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
        <Setter Property="PaneBackground" Value="{DynamicResource DefaultBackground}" />
        <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.PanningMode" Value="Both" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource RubyerHamburgerMenuItem}" />
        <Setter Property="bpa:ControlHelper.SelectedBrush" Value="{DynamicResource Primary}" />
        <Setter Property="bpa:ControlHelper.FocusedBrush" Value="{DynamicResource Mask}" />
        <Setter Property="bpa:ControlHelper.FocusedForegroundBrush" Value="{DynamicResource DefaultForeground}" />
        <Setter Property="bpa:ControlHelper.CornerRadius" Value="{DynamicResource AllControlCornerRadius}" />
        <Setter Property="bpa:ControlHelper.MaskOpacity" Value="0.6" />
        <Setter Property="bpa:ItemsControlHelper.ItemMargin" Value="2 1" />
        <Setter Property="bpa:ItemsControlHelper.ItemPadding" Value="5 8" />
        <Setter Property="bpa:HeaderHelper.Background" Value="Transparent" />
        <Setter Property="bpa:HeaderHelper.Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource Self}}" />
        <Setter Property="bpa:HeaderHelper.FontSize" Value="{Binding FontSize, RelativeSource={RelativeSource Self}}" />
        <Setter Property="bpa:HeaderHelper.FontWeight" Value="Normal" />
        <Setter Property="bpa:HeaderHelper.HorizontalAlignment" Value="Left" />
        <Setter Property="bpa:HeaderHelper.Padding" Value="0 10" />
        <Setter Property="bpa:HeaderHelper.Margin" Value="0 0 0 0" />
        <Setter Property="CollapsedWidth" Value="40" />
        <Setter Property="ExpandedWidth" Value="200" />
        <Setter Property="IsExpanded" Value="True" />
        <Setter Property="IsShowHamburgerButton" Value="True" />
        <Setter Property="IsShowLittleBar" Value="True" />
        <Setter Property="OptionsItemContainerStyle" Value="{StaticResource RubyerHamburgerMenuOptionsItem}" />
        <Setter Property="TabStripPlacement" Value="Left" />
        <Setter Property="TransitionType" Value="Fade" />
        <Setter Property="TransitionDuration" Value="0:0:0.5" />
        <Setter Property="bpa:MenuHelper.IconWidth" Value="{Binding CollapsedWidth, RelativeSource={RelativeSource Self}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type bpa:HamburgerMenu}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{TemplateBinding CornerRadius}">
                        <Grid x:Name="root">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="menuColumn" Width="Auto" />
                                <ColumnDefinition x:Name="contentColumn" Width="*" />
                            </Grid.ColumnDefinitions>

                            <Border x:Name="menu"
                                    Background="{TemplateBinding PaneBackground}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding PaneBorderThickness}"
                                    CornerRadius="{TemplateBinding PaneBorderCornerRadius}"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <bpa:Transition CollapsedSize="{TemplateBinding CollapsedWidth}"
                                                IsFade="False"
                                                IsShow="{TemplateBinding IsExpanded}"
                                                Type="CollapseLeft">
                                    <Grid Width="{TemplateBinding ExpandedWidth}">
                                        <Grid.RowDefinitions>
                                            <RowDefinition x:Name="menuRow" Height="Auto" />
                                            <RowDefinition x:Name="paneHeaderRow"
                                                           Height="Auto"
                                                           MinHeight="10" />
                                            <RowDefinition x:Name="itemsRow" Height="*" />
                                            <RowDefinition x:Name="optionsRow" Height="Auto" />
                                            <RowDefinition x:Name="paneFooterRow"
                                                           Height="Auto"
                                                           MinHeight="10" />
                                        </Grid.RowDefinitions>

                                        <Border x:Name="headerBorder"
                                                Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=bpa:Transition}}"
                                                Margin="{Binding Path=(bpa:HeaderHelper.Margin), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                HorizontalAlignment="Left"
                                                Background="{Binding Path=(bpa:HeaderHelper.Background), RelativeSource={RelativeSource Mode=TemplatedParent}}">
                                            <Button x:Name="PART_HamburgerButton"
                                                    Style="{StaticResource TextButton}"
                                                    Height="Auto"
                                                    Padding="{Binding Path=(bpa:HeaderHelper.Padding), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                    HorizontalContentAlignment="{Binding Path=(bpa:HeaderHelper.HorizontalAlignment), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                    bpa:ControlHelper.CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                    bpa:ControlHelper.FocusedBrush="{Binding Path=(bpa:ControlHelper.FocusedBrush), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                    bpa:ControlHelper.MaskOpacity="{Binding Path=(bpa:ControlHelper.MaskOpacity), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                    Foreground="{Binding Path=(bpa:HeaderHelper.Foreground), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                    ToolTipService.InitialShowDelay="100"
                                                    ToolTipService.Placement="Right"
                                                    ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource Self}}"
                                                    ToolTipService.VerticalOffset="5">
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="{TemplateBinding CollapsedWidth, Converter={StaticResource DoubleToGridLengthConverter}}" />
                                                        <ColumnDefinition Width="*" />
                                                    </Grid.ColumnDefinitions>

                                                    <bpa:Icon Width="{Binding ActualHeight, ElementName=header}"
                                                              Height="{Binding ActualHeight, ElementName=header}"
                                                              HorizontalAlignment="Center"
                                                              VerticalAlignment="Center"
                                                              Type="MenuLine" />

                                                    <TextBlock x:Name="header"
                                                               Grid.Column="1"
                                                               VerticalAlignment="Center"
                                                               FontSize="{Binding Path=(bpa:HeaderHelper.FontSize), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                               FontWeight="{Binding Path=(bpa:HeaderHelper.FontWeight), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                                               Text="{TemplateBinding Header}" />
                                                </Grid>
                                            </Button>
                                        </Border>

                                        <ContentPresenter Grid.Row="1"
                                                          ContentSource="PaneHeader"
                                                          Focusable="False"
                                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />

                                        <Border x:Name="Bd"
                                                Grid.Row="2"
                                                Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=bpa:Transition}}"
                                                HorizontalAlignment="Left"
                                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                            <ScrollViewer x:Name="itemsScroll"
                                                          Style="{StaticResource OnlyArrowScrollViewer}"
                                                          bpa:ControlHelper.CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}"
                                                          bpa:ControlHelper.FocusedBrush="{Binding Path=(bpa:ControlHelper.FocusedBrush), RelativeSource={RelativeSource AncestorType=bpa:HamburgerMenu}}"
                                                          bpa:ScrollViewerHelper.HorizontalDelta="150"
                                                          bpa:ScrollViewerHelper.VerticalDelta="75"
                                                          HorizontalScrollBarVisibility="Disabled"
                                                          VerticalScrollBarVisibility="Auto">
                                                <TabPanel Panel.ZIndex="1"
                                                          IsItemsHost="True"
                                                          KeyboardNavigation.TabIndex="1" />
                                            </ScrollViewer>
                                        </Border>

                                        <bpa:HamburgerMenuOptions x:Name="PART_OptionsItemsControl"
                                                                  Style="{StaticResource RubyerHamburgerMenuOptions}"
                                                                  Grid.Row="3"
                                                                  Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=bpa:Transition}}"
                                                                  ItemContainerStyle="{TemplateBinding OptionsItemContainerStyle}"
                                                                  ItemTemplate="{TemplateBinding OptionsItemTemplate}"
                                                                  ItemTemplateSelector="{TemplateBinding OptionsItemTemplateSelector}"
                                                                  ItemsSource="{TemplateBinding OptionsItemsSource}"
                                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />

                                        <ContentPresenter Grid.Row="4"
                                                          ContentSource="PaneFooter"
                                                          Focusable="False"
                                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                    </Grid>
                                </bpa:Transition>
                            </Border>

                            <Border x:Name="contentPanel"
                                    Grid.Column="1"
                                    KeyboardNavigation.DirectionalNavigation="Contained"
                                    KeyboardNavigation.TabIndex="2"
                                    KeyboardNavigation.TabNavigation="Local">
                                <bpa:Transition x:Name="PART_ContentTransition"
                                                Type="{TemplateBinding TransitionType}"
                                                Duration="{TemplateBinding TransitionDuration}">
                                    <ContentPresenter x:Name="PART_SelectedContentHost"
                                                      Margin="{TemplateBinding Padding}"
                                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                      ContentSource="SelectedContent"
                                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                </bpa:Transition>
                            </Border>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="root" Property="Opacity" Value="{DynamicResource UnenableOpcity}" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsGrouping" Value="True" />
                                <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
                            </MultiTrigger.Conditions>
                            <Setter Property="ScrollViewer.CanContentScroll" Value="False" />
                        </MultiTrigger>
                        <Trigger Property="IsShowHamburgerButton" Value="False">
                            <Setter TargetName="PART_HamburgerButton" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="IsExpanded" Value="False">
                            <Setter TargetName="PART_HamburgerButton" Property="ToolTip" Value="{Binding Header, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Right">
                            <Setter TargetName="menuColumn" Property="Width" Value="*" />
                            <Setter TargetName="contentColumn" Property="Width" Value="Auto" />
                            <Setter TargetName="menu" Property="Grid.Column" Value="1" />
                            <Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
                        </Trigger>
                        <Trigger SourceName="itemsScroll" Property="ComputedVerticalScrollBarVisibility" Value="Visible">
                            <Setter TargetName="headerBorder" Property="Margin" Value="0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>