<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="CollectionView101.OnDemand" x:Name="page">
  <StackLayout VerticalOptions="FillAndExpand">
    <Label BindingContext="{x:Reference page}" Text="{Binding Title}" IsVisible="{StaticResource TitleVisible}" HorizontalOptions="Center" Font="Large"/>
    <Entry x:Name="search" Placeholder="Enter text to search videos on YouTube" TextChanged="OnTextChanged"/>
    <Picker x:Name="orderBy"  Title="OrderBy" SelectedIndexChanged="OrderByChanged"/>
    <Grid VerticalOptions="FillAndExpand">
      <ActivityIndicator x:Name="activityIndicator" VerticalOptions="Center"/>
      <ListView x:Name="list" ItemTapped="OnItemTapped">
        <ListView.ItemTemplate>
          <DataTemplate>
            <ImageCell Text="{Binding Title}" ImageSource="{Binding Thumbnail}"/>
          </DataTemplate>
        </ListView.ItemTemplate>
      </ListView>
      <Label x:Name="message"
             Text=""
             IsVisible="False"
             FontSize="Large"
             XAlign="Center"
             YAlign="Center"/>
    </Grid>
  </StackLayout>
</ContentPage>