<?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="Borepin.Page.ProfilePage"
             xmlns:converters="clr-namespace:Borepin.Converter"
             xmlns:resource_text="clr-namespace:Borepin.Resources.Text" xmlns:views="clr-namespace:Borepin.View"
             Title="{x:Static resource_text:TextResource.TITLE_Profile}">
    <ContentPage.Resources>
        <ResourceDictionary>
            <converters:AllTrueBoolConverter x:Key="AllTrueBoolConverter"/>
            <converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
        </ResourceDictionary>
    </ContentPage.Resources>
    <ContentPage.Content>
        <StackLayout Padding="20">
            <views:ConnectionStateView/>
            <StackLayout>
                <StackLayout.IsVisible>
                    <MultiBinding Converter="{StaticResource AllTrueBoolConverter}">
                        <Binding Path="IsBusy" Converter="{StaticResource InvertBoolConverter}"/>
                        <Binding Path="IsConnected" />
                    </MultiBinding>
                </StackLayout.IsVisible>
                <Label Text="{Binding Username}" Style="{StaticResource LabelStyle_Title}"/>
                <StackLayout IsVisible="{Binding CanManage}">
                    <Label Text="{x:Static resource_text:TextResource.ProfilePage_ChangePassword}" Style="{StaticResource Style_Label_Property_Title}"/>
                    <Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_OldPassword}" Text="{Binding OldPassword}"/>
                    <Entry Placeholder="{x:Static resource_text:TextResource.ProfilePage_NewPassword}" Text="{Binding NewPassword}"/>
                    <Button Text="{x:Static resource_text:TextResource.ProfilePage_UpdatePassword}" Command="{Binding UpdatePasswordCommand}" Style="{StaticResource Style_Button_Primary}"/>
                </StackLayout>
            </StackLayout>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>