<commit_before>﻿<UserControl
    x:Class="Template10.Controls.HamburgerMenu"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Template10.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" x:Name="ThisPage"
    d:DesignHeight="400"
    d:DesignWidth="400">

    <UserControl.Resources>
        <ResourceDictionary>

            <!-- defaults -->
            <SolidColorBrush x:Name="HamburgerBackgroundBrush" Color="#FFD13438" />
            <SolidColorBrush x:Name="HamburgerForegroundBrush" Color="White" />
            <SolidColorBrush x:Name="NavButtonBackgroundBrush" Color="#FFD13438" />
            <SolidColorBrush x:Name="NavButtonForegroundBrush" Color="White" />
            <SolidColorBrush x:Name="NavAreaBackgroundBrush" Color="White" />
            <SolidColorBrush x:Name="SecondaryBorderBrush" Color="DimGray" />

            <Style TargetType="ToggleButton" x:Key="NavButtonStyle">
                <Setter Property="Height" Value="48"/>
                <Setter Property="MinWidth" Value="48"/>
                <Setter Property="UseSystemFocusVisuals" Value="True"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ToggleButton">
                            <Grid x:Name="RootGrid" Background="Transparent" Loaded="NavButton_Loaded"
                                  Width="{Binding PaneWidth, ElementName=ThisPage}">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal">
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="PointerOver">
                                            <VisualState.Setters>
                                                <Setter Target="HoverOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Pressed">
                                            <VisualState.Setters>
                                                <Setter Target="PressedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerDownThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled" />
                                        <VisualState x:Name="Checked">
                                            <VisualState.Setters>
                                                <Setter Target="CheckedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="CheckedPointerOver">
                                            <VisualState.Setters>
                                                <Setter Target="CheckedOverlay.Visibility" Value="Visible" />
                                                <Setter Target="HoverOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="CheckedPressed">
                                            <VisualState.Setters>
                                                <Setter Target="CheckedOverlay.Visibility" Value="Visible" />
                                                <Setter Target="PressedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerDownThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="CheckedDisabled">
                                            <VisualState.Setters>
                                                <Setter Target="CheckedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                        </VisualState>
                                        <VisualState x:Name="Indeterminate" />
                                        <VisualState x:Name="IndeterminatePointerOver" />
                                        <VisualState x:Name="IndeterminatePressed" />
                                        <VisualState x:Name="IndeterminateDisabled" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Grid x:Name="CheckedOverlay" Visibility="Collapsed">
                                    <Rectangle Fill="{Binding NavButtonBackground, ElementName=ThisPage, FallbackValue=Navy}" />
                                    <Rectangle Fill="Black" Opacity=".4" />
                                </Grid>
                                <Rectangle x:Name="PressedOverlay" Fill="White" Opacity=".2" Visibility="Collapsed" />
                                <Rectangle x:Name="HoverOverlay" Fill="White" Opacity=".1" Visibility="Collapsed" />
                                <ContentPresenter Background="Transparent" FontSize="16" 
                                        Foreground="{Binding NavButtonForeground, ElementName=ThisPage, FallbackValue=White}"
                                        VerticalAlignment="Stretch" HorizontalAlignment="Left"
                                        VerticalContentAlignment="Center" HorizontalContentAlignment="Left"
                                        x:Name="ContentPresenter" Content="{TemplateBinding Content}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="HamburgerButtonStyle" TargetType="Button">
                <Setter Property="Width" Value="48"/>
                <Setter Property="Height" Value="48"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="VerticalAlignment" Value="Top"/>
                <Setter Property="UseSystemFocusVisuals" Value="True"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Grid x:Name="RootGrid" Background="{Binding HamburgerBackground, ElementName=ThisPage, FallbackValue=Navy}">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal">
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="PointerOver">
                                            <VisualState.Setters>
                                                <Setter Target="HoverOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                        </VisualState>
                                        <VisualState x:Name="Pressed">
                                            <VisualState.Setters>
                                                <Setter Target="PressedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                        </VisualState>
                                        <VisualState x:Name="Disabled"/>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Rectangle x:Name="PressedOverlay" Fill="White" Opacity=".2" Visibility="Collapsed" />
                                <Rectangle x:Name="HoverOverlay" Fill="White" Opacity=".1" Visibility="Collapsed" />
                                <FontIcon x:Name="ContentPresenter" Glyph="&#xE700;" FontSize="20" 
                                          Foreground="{Binding HamburgerForeground, ElementName=ThisPage, FallbackValue=White}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <DataTemplate x:Name="NavButtonTemplate">
                <RadioButton Width="{Binding PaneWidth, ElementName=ThisPage, FallbackValue=220}" Height="48" 
                    CommandParameter="{Binding}" Tag="{Binding Content}"
                    Command="{Binding NavCommand, ElementName=ThisPage}" GroupName="Nav">
                    <RadioButton.Template>
                        <ControlTemplate>
                            <ToggleButton Style="{StaticResource NavButtonStyle}"
                                Command="{Binding Command, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                CommandParameter="{Binding CommandParameter, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                Width="{Binding Width, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                IsChecked="{Binding IsChecked, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                Content="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
                        </ControlTemplate>
                    </RadioButton.Template>
                </RadioButton>
            </DataTemplate>

        </ResourceDictionary>
    </UserControl.Resources>

    <Grid>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualState x:Name="VisualStateNarrow">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger x:Name="VisualStateNarrowTrigger" MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="ShellSplitView.DisplayMode" Value="Overlay" />
                        <Setter Target="ShellSplitView.IsPaneOpen" Value="False" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="VisualStateMedium">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger x:Name="VisualStateMediumTrigger" MinWindowWidth="521" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="ShellSplitView.DisplayMode" Value="CompactOverlay" />
                        <Setter Target="ShellSplitView.IsPaneOpen" Value="False" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="VisualStateWide">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger x:Name="VisualStateWideTrigger" MinWindowWidth="1024" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="ShellSplitView.DisplayMode" Value="Inline" />
                        <Setter Target="ShellSplitView.IsPaneOpen" Value="True" />
                        <Setter Target="PaneContent.Margin" Value="0,0,0,0" />
                        <Setter Target="HamburgerButton.Visibility" Value="Collapsed" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <SplitView x:Name="ShellSplitView"
                   PaneBackground="Transparent"
                   DisplayMode="Inline" 
                   OpenPaneLength="220"
                   CompactPaneLength="48">

            <SplitView.Pane>
                <Grid Background="{Binding NavAreaBackground, ElementName=ThisPage, FallbackValue='Blue'}" 
                      x:Name="PaneContent" Margin="0,48,0,0" Tapped="PaneContent_Tapped">

                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="0">

                        <ItemsControl ItemsSource="{Binding PrimaryButtons, ElementName=ThisPage}"
                            ItemTemplate="{StaticResource NavButtonTemplate}"><commit_msg>Handling SplitView.Panel.Tapped event differently.<commit_after>﻿<UserControl
    x:Class="Template10.Controls.HamburgerMenu"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Template10.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" x:Name="ThisPage"
    d:DesignHeight="400"
    d:DesignWidth="400">

    <UserControl.Resources>
        <ResourceDictionary>

            <!-- defaults -->
            <SolidColorBrush x:Name="HamburgerBackgroundBrush" Color="#FFD13438" />
            <SolidColorBrush x:Name="HamburgerForegroundBrush" Color="White" />
            <SolidColorBrush x:Name="NavButtonBackgroundBrush" Color="#FFD13438" />
            <SolidColorBrush x:Name="NavButtonForegroundBrush" Color="White" />
            <SolidColorBrush x:Name="NavAreaBackgroundBrush" Color="White" />
            <SolidColorBrush x:Name="SecondaryBorderBrush" Color="DimGray" />

            <Style TargetType="ToggleButton" x:Key="NavButtonStyle">
                <Setter Property="Height" Value="48"/>
                <Setter Property="MinWidth" Value="48"/>
                <Setter Property="UseSystemFocusVisuals" Value="True"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ToggleButton">
                            <Grid x:Name="RootGrid" Background="Transparent" Loaded="NavButton_Loaded"
                                  Width="{Binding PaneWidth, ElementName=ThisPage}">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal">
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="PointerOver">
                                            <VisualState.Setters>
                                                <Setter Target="HoverOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Pressed">
                                            <VisualState.Setters>
                                                <Setter Target="PressedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerDownThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled" />
                                        <VisualState x:Name="Checked">
                                            <VisualState.Setters>
                                                <Setter Target="CheckedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="CheckedPointerOver">
                                            <VisualState.Setters>
                                                <Setter Target="CheckedOverlay.Visibility" Value="Visible" />
                                                <Setter Target="HoverOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="CheckedPressed">
                                            <VisualState.Setters>
                                                <Setter Target="CheckedOverlay.Visibility" Value="Visible" />
                                                <Setter Target="PressedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                            <Storyboard>
                                                <PointerDownThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="CheckedDisabled">
                                            <VisualState.Setters>
                                                <Setter Target="CheckedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                        </VisualState>
                                        <VisualState x:Name="Indeterminate" />
                                        <VisualState x:Name="IndeterminatePointerOver" />
                                        <VisualState x:Name="IndeterminatePressed" />
                                        <VisualState x:Name="IndeterminateDisabled" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Grid x:Name="CheckedOverlay" Visibility="Collapsed">
                                    <Rectangle Fill="{Binding NavButtonBackground, ElementName=ThisPage, FallbackValue=Navy}" />
                                    <Rectangle Fill="Black" Opacity=".4" />
                                </Grid>
                                <Rectangle x:Name="PressedOverlay" Fill="White" Opacity=".2" Visibility="Collapsed" />
                                <Rectangle x:Name="HoverOverlay" Fill="White" Opacity=".1" Visibility="Collapsed" />
                                <ContentPresenter Background="Transparent" FontSize="16" 
                                        Foreground="{Binding NavButtonForeground, ElementName=ThisPage, FallbackValue=White}"
                                        VerticalAlignment="Stretch" HorizontalAlignment="Left"
                                        VerticalContentAlignment="Center" HorizontalContentAlignment="Left"
                                        x:Name="ContentPresenter" Content="{TemplateBinding Content}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="HamburgerButtonStyle" TargetType="Button">
                <Setter Property="Width" Value="48"/>
                <Setter Property="Height" Value="48"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="VerticalAlignment" Value="Top"/>
                <Setter Property="UseSystemFocusVisuals" Value="True"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Grid x:Name="RootGrid" Background="{Binding HamburgerBackground, ElementName=ThisPage, FallbackValue=Navy}">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal">
                                            <Storyboard>
                                                <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="PointerOver">
                                            <VisualState.Setters>
                                                <Setter Target="HoverOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                        </VisualState>
                                        <VisualState x:Name="Pressed">
                                            <VisualState.Setters>
                                                <Setter Target="PressedOverlay.Visibility" Value="Visible" />
                                            </VisualState.Setters>
                                        </VisualState>
                                        <VisualState x:Name="Disabled"/>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Rectangle x:Name="PressedOverlay" Fill="White" Opacity=".2" Visibility="Collapsed" />
                                <Rectangle x:Name="HoverOverlay" Fill="White" Opacity=".1" Visibility="Collapsed" />
                                <FontIcon x:Name="ContentPresenter" Glyph="&#xE700;" FontSize="20" 
                                          Foreground="{Binding HamburgerForeground, ElementName=ThisPage, FallbackValue=White}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <DataTemplate x:Name="NavButtonTemplate">
                <RadioButton Width="{Binding PaneWidth, ElementName=ThisPage, FallbackValue=220}" Height="48" 
                    CommandParameter="{Binding}" Tag="{Binding Content}"
                    Command="{Binding NavCommand, ElementName=ThisPage}" GroupName="Nav">
                    <RadioButton.Template>
                        <ControlTemplate>
                            <ToggleButton Style="{StaticResource NavButtonStyle}"
                                Command="{Binding Command, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                CommandParameter="{Binding CommandParameter, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                Width="{Binding Width, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                IsChecked="{Binding IsChecked, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                Content="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
                        </ControlTemplate>
                    </RadioButton.Template>
                </RadioButton>
            </DataTemplate>

        </ResourceDictionary>
    </UserControl.Resources>

    <Grid>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualState x:Name="VisualStateNarrow">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger x:Name="VisualStateNarrowTrigger" MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="ShellSplitView.DisplayMode" Value="Overlay" />
                        <Setter Target="ShellSplitView.IsPaneOpen" Value="False" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="VisualStateMedium">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger x:Name="VisualStateMediumTrigger" MinWindowWidth="521" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="ShellSplitView.DisplayMode" Value="CompactOverlay" />
                        <Setter Target="ShellSplitView.IsPaneOpen" Value="False" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="VisualStateWide">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger x:Name="VisualStateWideTrigger" MinWindowWidth="1024" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="ShellSplitView.DisplayMode" Value="CompactInline" />
                        <Setter Target="ShellSplitView.IsPaneOpen" Value="True" />
                        <Setter Target="PaneContent.Margin" Value="0,0,0,0" />
                        <Setter Target="HamburgerButton.Visibility" Value="Collapsed" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <SplitView x:Name="ShellSplitView"
                   PaneBackground="Transparent"
                   DisplayMode="Inline" 
                   OpenPaneLength="220"
                   CompactPaneLength="48">

            <SplitView.Pane>
                <Grid Background="{Binding NavAreaBackground, ElementName=ThisPage, FallbackValue='Blue'}" 
                      x:Name="PaneContent" Margin="0,48,0,0" Tapped="PaneContent_Tapped">

                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="0">

                        <ItemsControl ItemsSource="{Binding PrimaryButtons, ElementName=ThisPage}"
                            ItemTemplate="{StaticResource NavButtonTemplate}">
{'fraction_non_alphanumeric': 0.09157066979375043, 'fraction_numerical': 0.005794302269435055, 'mean_word_length': 1.1623536430755463, 'pattern_counts': {'":': 0, '<': 369, '<?xml version=': 0, '>': 369, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 266, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2130906', 'n_tokens_mistral': 5901, 'n_tokens_neox': 5359, 'n_words': 834}