<phone:PhoneApplicationPage 
    x:Class="AplicacionEstadisticas.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:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
    xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:System_Windows_Controls_DataVisualization_Charting_Primitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
    
    xmlns:local="clr-namespace:AplicacionEstadisticas"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">
    

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        
        <!--Pivot Control-->
        <controls:Pivot Title="Aplicacion Estadisticas">
            <!--Pivot item one-->
            <controls:PivotItem Header="por estado">
                <StackPanel>
                    <toolkit:ListPicker Header="Llave:" Width="300" Margin="0 0 0 8" HorizontalAlignment="Center" SelectionChanged="ActualizarLlaveEstados">
                        <TextBlock Text="Dreamspark" Margin="16 0 0 0" FontSize="25" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                        <TextBlock Text="Faculty Connection" Margin="16 0 0 0" FontSize="25" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                    </toolkit:ListPicker>
                    <!--Double line list with text wrapping-->
                    <toolkit:DatePicker Name="FechaEstados" Header="Año :" Value="12/31/2011" Width="300" Margin="0 8 0 40" HorizontalAlignment="Center" ValueChanged="ActualizarFechaEstados" />
                    
                    <!--<TextBox Name="EstadoTextbox" Text="2011" Width="300" Margin="0, 8, 0, 0" HorizontalAlignment="Center" TextAlignment="Center" />
                    <Button Name="buscar" Content="Buscar" Width="150" Click="ActualizarFechaEstados" />-->
                    <ScrollViewer Height="300">
                        <StackPanel>
                        <!--<chartingToolkit:Chart Title="Más llaves" Background="White" Foreground="Black" LegendTitle="Estados" Margin="0 32 0 0">
                                <chartingToolkit:Chart.Series>
                                    <chartingToolkit:ColumnSeries Title="+ llaves" ItemsSource="{Binding Estados_llaves}" />
                                </chartingToolkit:Chart.Series>
                            </chartingToolkit:Chart>-->
                            <TextBlock Text="Más llaves asignadas:" FontSize="32" HorizontalAlignment="Center"/>
                            <ListBox ItemsSource="{Binding NombreDeEstado}" IsHitTestVisible="False">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel>
                                            <TextBlock FontSize="24" Text="{Binding LineOne}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineTwo}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineThree}" TextWrapping="Wrap"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                            <!--<chartingToolkit:Chart Title="Menos llaves" Background="White" Foreground="Black" LegendTitle="Estados" Margin="0 32 0 0">
                                <chartingToolkit:Chart.Series>
                                    <chartingToolkit:ColumnSeries Title="- llaves" ItemsSource="{Binding Estados_llaves_menos}" />
                                </chartingToolkit:Chart.Series>
                            </chartingToolkit:Chart>-->
                            <TextBlock Text="Menos llaves asignadas:" FontSize="32" HorizontalAlignment="Center"/>
                            <ListBox ItemsSource="{Binding NombreDeEstado}" IsHitTestVisible="False">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel>
                                            <TextBlock FontSize="24" Text="{Binding LineFour}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineFive}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineSix}" TextWrapping="Wrap" />
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </StackPanel>

                    </ScrollViewer>
                    <Button Content="Ver detalles" Height="71" Name="ver_detalles" Width="196" Click="VerDetallesEstados" IsEnabled="True" HorizontalContentAlignment="Center" HorizontalAlignment="Center" />
                </StackPanel>                   
            </controls:PivotItem>

            <controls:PivotItem Header="por institucion">
                <StackPanel>
                    <toolkit:ListPicker Header="Llave:" Width="300" Margin="0 0 0 8" HorizontalAlignment="Center" SelectionChanged="ActualizarLlaveInstitucion">
                        <TextBlock Text="Dreamspark" Margin="16 0 0 0" FontSize="25" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                        <TextBlock Text="Faculty Connection" Margin="16 0 0 0" FontSize="25" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                    </toolkit:ListPicker>
                    <!--Double line list with text wrapping-->
                    <toolkit:DatePicker Name="FechaInstituciones" Header="Año :" Value="12/31/2011" Width="300" Margin="0 8 0 40" HorizontalAlignment="Center" ValueChanged="ActualizarFechaInstitucion" />
                    <ScrollViewer Height="300">
                        <StackPanel>
                            <!--<chartingToolkit:Chart Title="Más llaves" Background="White" Foreground="Black" LegendTitle="Instituciones" Margin="0 32 0 0">
                                <chartingToolkit:Chart.Series>
                                    <chartingToolkit:ColumnSeries Title="+ llaves" ItemsSource="{Binding Instituciones_llaves}" />
                                </chartingToolkit:Chart.Series>
                            </chartingToolkit:Chart>-->
                            <TextBlock Text="Más llaves asignadas:" FontSize="32" HorizontalAlignment="Center"/>
                            <ListBox ItemsSource="{Binding NombreDeInstitucion}" IsHitTestVisible="False">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel>
                                            <TextBlock FontSize="24" Text="{Binding LineOne}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineTwo}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineThree}" TextWrapping="Wrap"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                            <!--<chartingToolkit:Chart Title="Menos llaves" Background="White" Foreground="Black" LegendTitle="Instituciones" Margin="0 32 0 0">
                                <chartingToolkit:Chart.Series>
                                    <chartingToolkit:ColumnSeries Title="- llaves" ItemsSource="{Binding Instituciones_llaves_menos}" />
                                </chartingToolkit:Chart.Series>
                            </chartingToolkit:Chart>-->
                            <TextBlock Text="Menos llaves asignadas:" FontSize="32" HorizontalAlignment="Center"/>
                            <ListBox ItemsSource="{Binding NombreDeInstitucion}" IsHitTestVisible="False">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel>
                                            <TextBlock FontSize="24" Text="{Binding LineFour}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineFive}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineSix}" TextWrapping="Wrap"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </StackPanel>

                    </ScrollViewer>
                    <Button Content="Ver detalles" Height="71" Name="ver_detalles_institucion" Width="196" Click="VerDetallesInstituciones" IsEnabled="True" HorizontalContentAlignment="Center" HorizontalAlignment="Center" />
                </StackPanel>
            </controls:PivotItem>

            <controls:PivotItem Header="por mes">
                <StackPanel>
                    <toolkit:ListPicker Header="Llave:" Width="300" Margin="0 0 0 8" HorizontalAlignment="Center" SelectionChanged="ActualizarLlaveMes">
                        <TextBlock Text="Dreamspark" Margin="16 0 0 0" FontSize="25" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                        <TextBlock Text="Faculty Connection" Margin="16 0 0 0" FontSize="25" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                    </toolkit:ListPicker>
                    <!--Double line list with text wrapping-->
                    <toolkit:DatePicker Name="FechaMeses" Header="Año :" Value="12/31/2011" Width="300" Margin="0 8 0 40" HorizontalAlignment="Center" ValueChanged="ActualizarFechaMes" />
                    <ScrollViewer Height="300">
                        <StackPanel>
                            <!--<chartingToolkit:Chart Title="Más llaves" Background="White" Foreground="Black" LegendTitle="Meses" Margin="0 32 0 0">
                                <chartingToolkit:Chart.Series>
                                    <chartingToolkit:ColumnSeries Title="+ llaves" ItemsSource="{Binding Meses_llaves}" />
                                </chartingToolkit:Chart.Series>
                            </chartingToolkit:Chart>-->
                            <TextBlock Text="Más llaves asignadas:" FontSize="32" HorizontalAlignment="Center"/>
                            <ListBox ItemsSource="{Binding NombreDeMes}" IsHitTestVisible="False">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel>
                                            <TextBlock FontSize="24" Text="{Binding LineOne}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineTwo}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineThree}" TextWrapping="Wrap"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                            <!--<chartingToolkit:Chart Title="Menos llaves" Background="White" Foreground="Black" LegendTitle="Meses" Margin="0 32 0 0">
                                <chartingToolkit:Chart.Series>
                                    <chartingToolkit:ColumnSeries Title="- llaves" ItemsSource="{Binding Meses_llaves_menos}" />
                                </chartingToolkit:Chart.Series>
                            </chartingToolkit:Chart>-->
                            <TextBlock Text="Menos llaves asignadas:" FontSize="32" HorizontalAlignment="Center"/>
                            <ListBox ItemsSource="{Binding NombreDeMes}" IsHitTestVisible="False">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel>
                                            <TextBlock FontSize="24" Text="{Binding LineFour}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineFive}" TextWrapping="Wrap" />
                                            <TextBlock FontSize="24" Text="{Binding LineSix}" TextWrapping="Wrap"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </StackPanel>

                    </ScrollViewer>
                    <Button Content="Ver detalles" Height="71" Name="ver_detalles_mes" Width="196" Click="VerDetallesMeses" IsEnabled="True" HorizontalContentAlignment="Center" HorizontalAlignment="Center" />
                </StackPanel>
            </controls:PivotItem>


        </controls:Pivot>
        
    </Grid>
    
</phone:PhoneApplicationPage>