<Page
    x:Class="AppStudio.Views.TecnogeekPage"
    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="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <!-- Page title -->
        <Border x:Name="HeaderHost" Grid.Row="0" Height="80">
            <ContentPresenter ContentTemplate="{StaticResource PageHeader}" />
        </Border>
        <TextBlock Grid.Row="1" Margin="12,24,0,0" Style="{StaticResource PageTitleStyle}">Tecnogeek</TextBlock>

        <Grid Grid.Row="2" Margin="12,12,12,0" DataContext="{Binding TecnogeekModel}"
              d:DataContext="{d:DesignData Source=/Assets/Data/TecnogeekDataSource.json, Type=vm:TecnogeekViewModel, IsDesignTimeCreatable=true}">
            <ContentPresenter ContentTemplate="{StaticResource TecnogeekList}" />
        </Grid>

    </Grid>

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