<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:Class="Navigator.Views.AboutPage"
             xmlns:nc="clr-namespace:Navigator.Core"
             xmlns:vm="clr-namespace:Navigator.ViewModels"
             Title="{Binding Title}">
    
    <ContentPage.BindingContext>
        <vm:AboutViewModel />
    </ContentPage.BindingContext>
    
    <ContentPage.Resources>
        <ResourceDictionary>
            <Color x:Key="Primary">#2196F3</Color>
            <Color x:Key="Accent">#96d1ff</Color>
            <Color x:Key="LightTextColor">#999999</Color>
        </ResourceDictionary>
    </ContentPage.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackLayout BackgroundColor="{StaticResource Accent}" VerticalOptions="FillAndExpand" HorizontalOptions="Fill">
            <StackLayout Orientation="Horizontal" HorizontalOptions="Center" VerticalOptions="Center">
                <ContentView Padding="0,40,0,40" VerticalOptions="FillAndExpand">
                    <Image Source="launcher_foreground.png" VerticalOptions="Center" HeightRequest="64" />
                </ContentView>
            </StackLayout>
        </StackLayout>
        <ScrollView Grid.Row="1">
            <StackLayout Orientation="Vertical" Padding="16,40,16,40" Spacing="10">
                <Label FontSize="22">
                    <Label.FormattedText>
                        <FormattedString>
                            <FormattedString.Spans>
                                <Span Text="Navigator" FontAttributes="Bold" FontSize="22" />
                                <Span Text=" " />
                                <Span Text="1.02" ForegroundColor="{StaticResource LightTextColor}" />
                            </FormattedString.Spans>
                        </FormattedString>
                    </Label.FormattedText>
                </Label>
                <Label>
                    <Label.FormattedText>
                        <FormattedString>
                            <FormattedString.Spans>
                                <Span Text="By Sean Kessler" />
                            </FormattedString.Spans>
                        </FormattedString>
                    </Label.FormattedText>
                </Label>
                <StackLayout Orientation="Horizontal">
                    <Label Text="Connection:" />
                    <Label Text="{Binding Message,Mode=TwoWay}" />
                </StackLayout>
              <StackLayout Orientation="Vertical" >
              <Label Text="Change:" />
              <nc:EntryWithCustomKeyboardReturnButton  Text="{Binding IPAddress,Mode=TwoWay}"  >
                <Entry.Behaviors>
                  <nc:EventToCommandBehavior EventName="Completed" Command="{Binding IPAddressCommand}" />
                </Entry.Behaviors>
              </nc:EntryWithCustomKeyboardReturnButton>
              <Label Text="Enter ip address and hit enter/done (xxx.xxx.xxx.xxx):" HorizontalOptions="Center"/>
            <Button  Text="Reset">
            <Button.Behaviors>
              <nc:EventToCommandBehavior EventName="Clicked" Command="{Binding OnResetCommand,Mode=OneWay}"/>
            </Button.Behaviors>
          </Button>
          <Label Text="{Binding Status,Mode=TwoWay}" />
        </StackLayout>
      </StackLayout>
        </ScrollView>
    </Grid>
    
</ContentPage>
