<Page
    x:Class="AppStudio.Views.TELEFONOSDEEMERGENCIA1Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:AppStudio.Views"
     xmlns:controls="using:AppStudio.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:commands="using:AppStudio.Commands"
    xmlns:vm="using:AppStudio.ViewModels"
    mc:Ignorable="d">

    <Grid Background="{StaticResource AppBackground}">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>

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

        <TextBlock x:Name="Title" Grid.Row="1" Margin="120,0,0,0" Style="{StaticResource PageTitleStyle}">TELÉFONOS DE EMERGENCIA</TextBlock>

        <Grid Grid.Row="2" DataContext="{Binding TELEFONOSDEEMERGENCIA1Model}" 
              d:DataContext="{d:DesignData Source=/Assets/Data/TELEFONOSDEEMERGENCIA1DataSource.json, Type=vm:TELEFONOSDEEMERGENCIA1ViewModel, IsDesignTimeCreatable=true}">

            <GridView x:Name="List" Margin="0,12,0,0" Padding="120,0,120,20" ItemsSource="{Binding Items}"
                      SelectionMode="None" IsSwipeEnabled="False" IsItemClickEnabled="True" commands:ItemClickCommand.Command="{Binding ItemClickCommand}"
                      ScrollViewer.VerticalScrollBarVisibility="Hidden"
                      ItemTemplate="{StaticResource TELEFONOSDEEMERGENCIA1Item}"/>
            <ListView x:Name="ListSnapped" Margin="30,0,0,0" ItemsSource="{Binding Items}"
                      SelectionMode="None" IsSwipeEnabled="False" IsItemClickEnabled="True" commands:ItemClickCommand.Command="{Binding ItemClickCommand}"
                      Width="240" HorizontalAlignment="Left"
                      ScrollViewer.VerticalScrollBarVisibility="Hidden"
                      ItemTemplate="{StaticResource TELEFONOSDEEMERGENCIA1ItemSnapped}"
                      Visibility="Collapsed"/>
            <ProgressBar Width="520" Height="40" IsIndeterminate="True" Visibility="{Binding ProgressBarVisibility}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        </Grid>

      <!-- Back button and page title -->
      <ContentPresenter x:Name="HeaderHost" Grid.Row="0" ContentTemplate="{StaticResource PageHeader}" Content="{Binding NavigationHelper}" />

      <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="SnappedView">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderHost" Storyboard.TargetProperty="ContentTemplate">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PageHeaderSnapped}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Title" Storyboard.TargetProperty="Margin">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="24,24,0,0"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="List" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ListSnapped" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="FullscreenView">
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>

    <Page.BottomAppBar>
        <CommandBar Background="{StaticResource AppBarBackground}" BorderBrush="{StaticResource AppBarBackground}" Foreground="{StaticResource AppBarForeground}">
            <AppBarButton x:Uid="RefreshButton" Icon="Refresh" DataContext="{Binding TELEFONOSDEEMERGENCIA1Model}" Command="{Binding RefreshCommand}" Visibility="{Binding RefreshVisibility}"/>
        </CommandBar>
    </Page.BottomAppBar>
</Page>
