<?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="InABox.Mobile.Settings" 
    xmlns:local="clr-namespace:InABox.Mobile">
    
    <ContentPage.Content>
        
        <Grid x:Name="SettingsGrid" Margin="5" RowSpacing="10">
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="50"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>

            <Label Text="URL" Grid.Row="0" Grid.Column="0"  VerticalOptions="CenterAndExpand" FontSize="Small"/>
            <Entry x:Name="URL" Grid.Row="0" Grid.Column="1"  Text="{Binding URL}" Keyboard="Url" VerticalOptions="Fill" HorizontalOptions="Fill" FontSize="Small"/>

            <Label Text="Port" Grid.Row="1" Grid.Column="0"  VerticalOptions="CenterAndExpand" FontSize="Small"/>
            <Entry x:Name="Port" Grid.Row="1" Grid.Column="1" Text="{Binding Port}" Keyboard="Numeric" VerticalOptions="Fill" HorizontalOptions="Fill" FontSize="Small"/>

            <Label Text="User ID" Grid.Row="2" Grid.Column="0"  VerticalOptions="CenterAndExpand" FontSize="Small"/>
            <Entry x:Name="UserID" Grid.Row="2" Grid.Column="1" Text="{Binding UserID}" Keyboard="Url" VerticalOptions="Fill" HorizontalOptions="Fill" FontSize="Small"/>

            <Label Text="Password" Grid.Row="3" Grid.Column="0"  VerticalOptions="CenterAndExpand" FontSize="Small"/>
            <Entry x:Name="Password" Grid.Row="3" Grid.Column="1" Text="{Binding Password}" Keyboard="Url" IsPassword="True" VerticalOptions="Fill" HorizontalOptions="Fill" FontSize="Small"/>
                            
            <Label Text="Update URL" Grid.Row="4" Grid.Column="0"  VerticalOptions="CenterAndExpand" FontSize="Small"/>
            <Entry x:Name="UpdateURL" Grid.Row="4" Grid.Column="1" Text="{Binding AutoUpdateLocation}" VerticalOptions="Fill" HorizontalOptions="Fill" Keyboard="Url" FontSize="Small"/>
            
            <Label Text="" Grid.Row="5" Grid.Column="0" FontSize="Small"/>
                            
            <Label Text="Device ID" Grid.Row="6" Grid.Column="0"  VerticalOptions="CenterAndExpand" FontSize="Small"/>
            <Entry x:Name="DeviceID" Grid.Row="6" Grid.Column="1" Text="{Binding DeviceID}" IsEnabled="false" VerticalOptions="Fill" HorizontalOptions="Fill" FontSize="Small"/>
                   
            <Label Text="App Version" Grid.Row="7" Grid.Column="0"  VerticalOptions="CenterAndExpand" FontSize="Small"/>
            <Entry x:Name="AppVersion" Grid.Row="7" Grid.Column="1" Text="{Binding AppVersion}" IsEnabled="false" VerticalOptions="Fill" HorizontalOptions="Fill" FontSize="Small"/>
            
            <Button x:Name="CancelButton" IsVisible="false" Grid.Row="8" Grid.Column="0" WidthRequest="100" HeightRequest="40" VerticalOptions="End" HorizontalOptions="Start" Margin="5" Text="Cancel" Clicked="CancelClicked" BorderColor="Black" BorderWidth="1" BackgroundColor="White" />
            <Button x:Name="SaveButton" IsVisible="false" Grid.Row="8" Grid.Column="1" WidthRequest="100" HeightRequest="40" VerticalOptions="End" HorizontalOptions="End" Margin="5" Text="Save" Clicked="SaveClicked" BorderColor="Black" BorderWidth="1" BackgroundColor="White"/>
            
        </Grid>

            
    </ContentPage.Content>
</ContentPage>
