<Page
    x:Class="AppStudio.Views.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:AppStudio.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="using:AppStudio.ViewModels"
    mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="0"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Hub x:Name="Container" Grid.Row="1" Margin="0,32,0,0" Background="{StaticResource AppBackground}" DataContext="{Binding}" HeaderTemplate="{StaticResource PageHeader}" SectionsInViewChanged="OnSectionsInViewChanged">
            <HubSection x:Name="TELEFONOSDEEMERGENCIASection" Width="360" Header="TELÉFONOS DE EMERGENCIA" HeaderTemplate="{StaticResource HubSectionHeaderTemplate}" DataContext="{Binding MainViewModel.TELEFONOSDEEMERGENCIAModel}"
                        d:DataContext="{d:DesignData Source=/Assets/Data/TELEFONOSDEEMERGENCIADataSource.json, Type=vm:TELEFONOSDEEMERGENCIAViewModel, IsDesignTimeCreatable=true}"
                        ContentTemplate="{StaticResource TELEFONOSDEEMERGENCIAList}" IsHeaderInteractive="{Binding HasMoreItems}" />
        </Hub>
    </Grid>

    <Page.BottomAppBar>
        <CommandBar Visibility="{Binding MainViewModel.AppBarVisibility}" ClosedDisplayMode="Minimal" Background="{StaticResource AppBarBackground}" Foreground="{StaticResource AppBarForeground}">
            <AppBarButton x:Uid="TextToSpeechButton" Icon="Volume" DataContext="{Binding MainViewModel.SelectedItem}" Command="{Binding TextToSpeechCommand}" Visibility="{Binding TextToSpeechVisibility}"/>
            <AppBarButton x:Uid="RefreshButton" Icon="Refresh" DataContext="{Binding MainViewModel}" Command="{Binding RefreshCommand}" Visibility="{Binding RefreshVisibility}"/>
            <CommandBar.SecondaryCommands>
                <AppBarButton x:Uid="PrivacyButton" Label="privacy" Command="{Binding MainViewModel.PrivacyCommand}"/>
                <AppBarButton x:Uid="ShareItemButton" Label="share item" DataContext="{Binding MainViewModel.SelectedItem}" Visibility="{Binding ShareItemVisibility}" Command="{Binding ShareItemCommand}"/>
            </CommandBar.SecondaryCommands>
        </CommandBar>
    </Page.BottomAppBar>
</Page>
