<?xml version="1.0" encoding="utf-8" ?>
<ui:BillingPage xmlns="http://xamarin.com/schemas/2014/forms"
                xmlns:r="clr-namespace:Billing.Languages"
                xmlns:ui="clr-namespace:Billing.UI"
                xmlns:v="clr-namespace:Billing.Views"
                xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                x:Class="Billing.Views.AccountPage"
                x:Name="accountPage"
                x:DataType="v:AccountPage"
                Title="{r:Text Accounts}"
                BindingContext="{x:Reference accountPage}">

    <ContentPage.Resources>
        <ui:MoneyConverter x:Key="moneyConverter"/>
    </ContentPage.Resources>

    <ContentPage.ToolbarItems>
        <ToolbarItem Order="Primary" IconImageSource="plus.png" Command="{Binding AddAccount}"/>
    </ContentPage.ToolbarItems>

    <ScrollView>
        <StackLayout>
            <Grid HeightRequest="100" BackgroundColor="{DynamicResource PromptBackgroundColor}" ColumnDefinitions="Auto, *">
                <!--<Grid.Effects>
                    <ui:ShadowEffect Offect="0, 3" Color="Black" Opacity=".4"/>
                </Grid.Effects>-->
                <StackLayout VerticalOptions="Center" Margin="20, 0" Spacing="0">
                    <Label FontSize="Small" Text="{r:Text Balance}"/>
                    <Label FontSize="24" FontFamily="{DynamicResource RobotoCondensedFontBold}"
                           Text="{Binding Balance, Converter={StaticResource moneyConverter}}"/>
                </StackLayout>
                <Grid Grid.Column="1" Margin="20, 0" VerticalOptions="Center" HorizontalOptions="End"
                      ColumnDefinitions="Auto, Auto" RowDefinitions="Auto, Auto">
                    <Label FontSize="Small" HorizontalOptions="End" Text="{r:Text Assets}"/>
                    <Label Grid.Column="1" FontSize="Small" Margin="10, 0, 0, 0" HorizontalOptions="End"
                           Text="{Binding Asset, Converter={StaticResource moneyConverter}}"/>
                    <Label Grid.Row="1" FontSize="Small" HorizontalOptions="End" Text="{r:Text Liability}"/>
                    <Label Grid.Row="1" Grid.Column="1" FontSize="Small" Margin="10, 0, 0, 0" HorizontalOptions="End"
                           TextColor="{DynamicResource RedColor}"
                           Text="{Binding Liability, Converter={StaticResource moneyConverter}}"/>
                </Grid>
            </Grid>
        </StackLayout>
    </ScrollView>
</ui:BillingPage>