<?xml version="1.0" encoding="utf-8" ?>
<pages:BaseContentPage 
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="Bit.App.Pages.SyncPage"
    xmlns:pages="clr-namespace:Bit.App.Pages"
    xmlns:u="clr-namespace:Bit.App.Utilities"
    x:DataType="pages:SyncPageViewModel"
    Title="{Binding PageTitle}">

    <ContentPage.BindingContext>
        <pages:SyncPageViewModel />
    </ContentPage.BindingContext>

    <ContentPage.ToolbarItems>
        <ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
    </ContentPage.ToolbarItems>

    <ScrollView Padding="0, 0, 0, 20">
        <StackLayout Padding="0" Spacing="20">
            <StackLayout StyleClass="box">
                <StackLayout StyleClass="box-row, box-row-switch">
                    <Label
                        Text="{u:I18n EnableSyncOnRefresh}"
                        StyleClass="box-label-regular"
                        HorizontalOptions="StartAndExpand" />
                    <Switch
                        IsToggled="{Binding EnableSyncOnRefresh}"
                        StyleClass="box-value"
                        HorizontalOptions="End" />
                </StackLayout>
                <Label
                    Text="{u:I18n EnableSyncOnRefreshDescription}"
                    StyleClass="box-footer-label, box-footer-label-switch" />
            </StackLayout>
            <StackLayout StyleClass="box">
                <Button Text="{u:I18n SyncVaultNow}" Clicked="Sync_Clicked"></Button>
                <Label StyleClass="text-muted, text-sm" HorizontalTextAlignment="Center" Margin="0,10">
                    <Label.FormattedText>
                        <FormattedString>
                            <Span Text="{u:I18n LastSync}" />
                            <Span Text=" " />
                            <Span Text="{Binding LastSync}" />
                        </FormattedString>
                    </Label.FormattedText>
                </Label>
            </StackLayout>
        </StackLayout>
    </ScrollView>

</pages:BaseContentPage>