<?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="AccessControl.Views.LoginPage"
             xmlns:validation="clr-namespace:AccessControl.Validation"
             Title="Login">
    <ContentPage.ToolbarItems>
        <ToolbarItem Text="Sign Up" Clicked="OnSignUpButtonClicked" />
    </ContentPage.ToolbarItems>
    <ContentPage.Content>
        <StackLayout Margin="10" VerticalOptions="StartAndExpand">
            <Label Text="Username" />
            <Entry x:Name="usernameEntry" Placeholder="username" Text="{Binding Email, Mode=TwoWay}">
                <Entry.Behaviors>
                    <validation:EntryValidationBehavior PropertyName="Email" />
                </Entry.Behaviors>
            </Entry>
            <Label Text="Password" />
            <Entry x:Name="passwordEntry" IsPassword="true" Text="{Binding Password, Mode=TwoWay}">
                <Entry.Behaviors>
                    <validation:EntryValidationBehavior PropertyName="Password" />
                </Entry.Behaviors>
            </Entry>
            <Switch IsToggled="{Binding RememberMe}"></Switch>
            <Button Text="Login" Command="{Binding LoginCommand}" IsEnabled="{Binding IsSubmitEnabled}" />
            <Label x:Name="messageLabel" />
        </StackLayout>
    </ContentPage.Content>
</ContentPage>