<?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="ZicMoove.Pages.UserProfile.UserProfilePage"
             xmlns:local="clr-namespace:ZicMoove;assembly=ZicMoove"
             xmlns:views="clr-namespace:ZicMoove.Views;assembly=ZicMoove"
             xmlns:extensions="clr-namespace:ZicMoove.Extensions;assembly=ZicMoove"
             xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
             Style="{StaticResource PageStyle}">

  <ScrollView>
    <ScrollView.Padding>
      <OnPlatform x:TypeArguments="Thickness"
                  Android="20,20,20,20"
                  WinPhone="20,20,20,20"
                  iOS="20,40,20,20" />
    </ScrollView.Padding>
    <StackLayout BoxView.Color="{StaticResource ContentBackgroundColor}" Spacing="10,10,10,10" >

      <StackLayout VisualElement.IsVisible="{Binding HaveAnUser}">
       
        <views:ImageButton
          x:Name="AvatarButton" 
          Source="{Binding Avatar}"
          IsEnabled="true"
          BackgroundColor="#01abdf"
          Orientation="ImageToLeft"
          Text="{Binding UserName}"
          TextColor="#ffffff"
          ></views:ImageButton>
        
        <StackLayout Orientation="Horizontal">
          <Label Text="Recevoir les notifications push" StyleClass="Header" />
          <Switch IsToggled="{Binding ReceivePushNotifications, Mode=TwoWay}"
                HorizontalOptions="End" />
        </StackLayout>

        <StackLayout Orientation="Horizontal">
          <Label Text="Utiliser ma position" StyleClass="Header" />
          <Switch HorizontalOptions="End" IsToggled="{Binding AllowUseMyPosition, Mode=TwoWay}"/>
        </StackLayout>

        <StackLayout VisualElement.IsVisible="{Binding IsAPerformer}">
          <StackLayout Orientation="Horizontal" VerticalOptions="Start"
                       VisualElement.IsVisible="{Binding IsAPerformer}" >
            <Label Text="Ne recevoir de demande de devis que de la part de professionnels uniquement" />
            <Switch HorizontalOptions="End" IsToggled="{Binding AllowProBookingOnly, Mode=TwoWay}"/>
          </StackLayout>

          <Button Text="{Binding PerformerStatus}" Clicked="OnViewPerformerStatus" />
        </StackLayout>

        <Button Text="Payer" x:Name="btnPay"/>
      </StackLayout>
    </StackLayout>
  </ScrollView>
</ContentPage>