<commit_before>﻿<phone:PhoneApplicationPage
    x:Class="SparklrWP.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:sparklrControls="clr-namespace:SparklrWP.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:utils="clr-namespace:SparklrWP.Utils"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True" Background="#FF454050">

    <!--Data context is set to sample data above and LayoutRoot contains the root grid where all other page content is placed-->

    <phone:PhoneApplicationPage.Resources>
        <utils:ListToGroupedListConverter x:Key="ListToGroupedListConverter"/>
        <ItemsPanelTemplate x:Key="GroupItemsPanel">
            <toolkit:WrapPanel Margin="18,12" />
        </ItemsPanelTemplate>
    </phone:PhoneApplicationPage.Resources>

    <controls:Pivot Name="mainPivot" Title="sparklr*"  FontFamily="/SparklrWP;component/Fonts/Fonts.zip#Courgette" Background="#FF454050">
        <controls:Pivot.HeaderTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding}" HorizontalAlignment="Left" />
                    <Border Background="White" CornerRadius="8" VerticalAlignment="Top" HorizontalAlignment="Right" Visibility="{Binding NewCountVisibility}" Margin="4,0,0,0">
                        <TextBlock Foreground="#FF2A2339" Text="{Binding SelectedItem.NewCount, ElementName=mainPivot}" HorizontalAlignment="Center" Margin="10,0,10,4" FontSize="36" VerticalAlignment="Center"></TextBlock>
                    </Border>
                </StackPanel>
            </DataTemplate>
        </controls:Pivot.HeaderTemplate>
        <!--TitlePanel contains the name of the application and page title-->


        <!--ContentPanel contains ListBox and ListBox ItemTemplate. Place additional content here-->
        <sparklrControls:NotificationPivotItem Name="postsPivot" Header="Posts"  Margin="9,-7,0,0" FontFamily="/SparklrWP;component/Fonts/Fonts.zip#Courgette"
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}" NewCount="10">
            <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                <ListBox x:Name="MainListBox" ItemsSource="{Binding Items}" SelectionChanged="MainListBox_SelectionChanged" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel MinWidth="456" MaxWidth="456" Background="White" Margin="0,0,0,17">
                                <sparklrControls:SparklrText Post="{Binding}" />
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                    <!-- Workaround used to stretch the child elements to the full width -> HorizontalContentAlignment won't work for some reason... -->
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
                        </Style>
                    </ListBox.ItemContainerStyle>
                </ListBox>
            </Grid>
        </sparklrControls:NotificationPivotItem>
        <sparklrControls:NotificationPivotItem Name="notificationsPivot" Header="Notifications">
        </sparklrControls:NotificationPivotItem>
        <controls:PivotItem d:DataContext="{d:DesignData SampleData/FriendsViewModelSampleData.xaml}" Header="Friends" Name="friendPivot">
            <toolkit:LongListSelector Background="{x:Null}" GroupViewClosing="LongListSelector_GroupViewClosing" GroupViewOpened="LongListSelector_GroupViewOpened" ItemsSource="{Binding Items, ConverterParameter=Name, Converter={StaticResource ListToGroupedListConverter}}" GroupItemsPanel="{StaticResource GroupItemsPanel}">
                <toolkit:LongListSelector.GroupHeaderTemplate>
                    <DataTemplate>
                        <Grid Height="99" Width="99" Background="#FF2A2339" HorizontalAlignment="Left" Margin="12,6" toolkit:TiltEffect.IsTiltEnabled="True">
                            <TextBlock TextWrapping="Wrap" Text="{Binding KeyName}" Style="{StaticResource PhoneTextExtraLargeStyle}" HorizontalAlignment="Left" Margin="3,0,12,0" VerticalAlignment="Bottom" />
                        </Grid>
                    </DataTemplate>
                </toolkit:LongListSelector.GroupHeaderTemplate>
                <toolkit:LongListSelector.ItemTemplate>
                    <DataTemplate>
                        <Grid toolkit:TiltEffect.IsTiltEnabled="True">
                            <Image Height="60" Width="60" Source="{Binding Image}" Margin="12,6" HorizontalAlignment="Left" />
                            <TextBlock Text="{Binding Name}" Style="{StaticResource PhoneTextExtraLargeStyle}" VerticalAlignment="Center" Margin="84,0,12,0" />
                        </Grid>
                    </DataTemplate>
                </toolkit:LongListSelector.ItemTemplate>
            </toolkit:LongListSelector>
        </controls:PivotItem>
        <controls:PivotItem Header="Inbox">
            <Grid/>
        </controls:PivotItem>
        <controls:PivotItem Header="Profile">
            <Grid/>
        </controls:PivotItem>
    </controls:Pivot>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" BackgroundColor="#FF2A2339">
            <shell:ApplicationBarIconButton IconUri="/Assets/AppBar/appbar.add.rest.png" Text="New post" Click="ApplicationBarIconButton_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem IsEnabled="True" Text="About" Click="about_click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage><commit_msg>Fix and break notification counts<commit_after>﻿<phone:PhoneApplicationPage
    x:Class="SparklrWP.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:sparklrControls="clr-namespace:SparklrWP.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:utils="clr-namespace:SparklrWP.Utils"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True" Background="#FF454050">

    <!--Data context is set to sample data above and LayoutRoot contains the root grid where all other page content is placed-->

    <phone:PhoneApplicationPage.Resources>
        <utils:ListToGroupedListConverter x:Key="ListToGroupedListConverter"/>
        <ItemsPanelTemplate x:Key="GroupItemsPanel">
            <toolkit:WrapPanel Margin="18,12" />
        </ItemsPanelTemplate>
    </phone:PhoneApplicationPage.Resources>

    <controls:Pivot Name="mainPivot" Title="sparklr*"  FontFamily="/SparklrWP;component/Fonts/Fonts.zip#Courgette" Background="#FF454050">
        <controls:Pivot.HeaderTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding}" HorizontalAlignment="Left" />
                    <Border Background="White" CornerRadius="8" VerticalAlignment="Top" HorizontalAlignment="Right" Visibility="{Binding SelectedItem.NewCountVisibility, ElementName=mainPivot}" Margin="4,0,0,0">
                        <TextBlock Foreground="#FF2A2339" Text="{Binding Items[{Binding}].NewCount, ElementName=mainPivot}" HorizontalAlignment="Center" Margin="10,0,10,4" FontSize="36" VerticalAlignment="Center"></TextBlock>
                    </Border>
                </StackPanel>
            </DataTemplate>
        </controls:Pivot.HeaderTemplate>
        <!--TitlePanel contains the name of the application and page title-->


        <!--ContentPanel contains ListBox and ListBox ItemTemplate. Place additional content here-->
        <sparklrControls:NotificationPivotItem Name="postsPivot" Header="Posts"  Margin="9,-7,0,0" FontFamily="/SparklrWP;component/Fonts/Fonts.zip#Courgette"
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}" NewCount="10">
            <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                <ListBox x:Name="MainListBox" ItemsSource="{Binding Items}" SelectionChanged="MainListBox_SelectionChanged" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel MinWidth="456" MaxWidth="456" Background="White" Margin="0,0,0,17">
                                <sparklrControls:SparklrText Post="{Binding}" />
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                    <!-- Workaround used to stretch the child elements to the full width -> HorizontalContentAlignment won't work for some reason... -->
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
                        </Style>
                    </ListBox.ItemContainerStyle>
                </ListBox>
            </Grid>
        </sparklrControls:NotificationPivotItem>
        <sparklrControls:NotificationPivotItem Name="notificationsPivot" Header="Notifications">
        </sparklrControls:NotificationPivotItem>
        <sparklrControls:NotificationPivotItem d:DataContext="{d:DesignData SampleData/FriendsViewModelSampleData.xaml}" Header="Friends" Name="friendPivot">
            <toolkit:LongListSelector Background="{x:Null}" GroupViewClosing="LongListSelector_GroupViewClosing" GroupViewOpened="LongListSelector_GroupViewOpened" ItemsSource="{Binding Items, ConverterParameter=Name, Converter={StaticResource ListToGroupedListConverter}}" GroupItemsPanel="{StaticResource GroupItemsPanel}">
                <toolkit:LongListSelector.GroupHeaderTemplate>
                    <DataTemplate>
                        <Grid Height="99" Width="99" Background="#FF2A2339" HorizontalAlignment="Left" Margin="12,6" toolkit:TiltEffect.IsTiltEnabled="True">
                            <TextBlock TextWrapping="Wrap" Text="{Binding KeyName}" Style="{StaticResource PhoneTextExtraLargeStyle}" HorizontalAlignment="Left" Margin="3,0,12,0" VerticalAlignment="Bottom" />
                        </Grid>
                    </DataTemplate>
                </toolkit:LongListSelector.GroupHeaderTemplate>
                <toolkit:LongListSelector.ItemTemplate>
                    <DataTemplate>
                        <Grid toolkit:TiltEffect.IsTiltEnabled="True">
                            <Image Height="60" Width="60" Source="{Binding Image}" Margin="12,6" HorizontalAlignment="Left" />
                            <TextBlock Text="{Binding Name}" Style="{StaticResource PhoneTextExtraLargeStyle}" VerticalAlignment="Center" Margin="84,0,12,0" />
                        </Grid>
                    </DataTemplate>
                </toolkit:LongListSelector.ItemTemplate>
            </toolkit:LongListSelector>
        </sparklrControls:NotificationPivotItem>
        <sparklrControls:NotificationPivotItem Header="Inbox">
            <Grid/>
        </sparklrControls:NotificationPivotItem>
        <sparklrControls:NotificationPivotItem Header="Profile">
            <Grid/>
        </sparklrControls:NotificationPivotItem>
    </controls:Pivot>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" BackgroundColor="#FF2A2339">
            <shell:ApplicationBarIconButton IconUri="/Assets/AppBar/appbar.add.rest.png" Text="New post" Click="ApplicationBarIconButton_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem IsEnabled="True" Text="About" Click="about_click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
{'fraction_non_alphanumeric': 0.11846767050487157, 'fraction_numerical': 0.016976675524062592, 'mean_word_length': 3.1472298745026017, 'pattern_counts': {'":': 0, '<': 161, '<?xml version=': 0, '>': 163, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 22}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5250288', 'n_tokens_mistral': 3774, 'n_tokens_neox': 3463, 'n_words': 518}