<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:extensions="clr-namespace:PlantBox.Client.Extensions"
             xmlns:forms="clr-namespace:PlantBox.Client.Forms"
             xmlns:viewmodels="clr-namespace:PlantBox.Client.ViewModels"
             x:Class="PlantBox.Client.Forms.HomePage">
    <ContentPage.BindingContext>
        <viewmodels:HomeViewModel />
    </ContentPage.BindingContext>
    <ContentPage.Content>
        <AbsoluteLayout>
            <!--List-->
            <ListView x:Name="List"
                      AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
                      AbsoluteLayout.LayoutFlags="All"
                      ItemsSource="{Binding Plants}"
                      SelectionMode="None"
                      RowHeight="{OnPlatform Android=85}"
                      SeparatorVisibility="None"
                      IsPullToRefreshEnabled="True"
                      Refreshing="ListView_Refreshing"
                      ItemTapped="ListView_ItemTapped">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <forms:HomeItem Margin="5"
                                            PlantName="{Binding Name}"
                                            PlantType="{Binding Type}"
                                            PlantState="{Binding State}" />
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
            <!--Floating Button-->
            <Button AbsoluteLayout.LayoutBounds="0.9, 0.94, 64, 64"
                    AbsoluteLayout.LayoutFlags="PositionProportional"
                    BackgroundColor="Accent"
                    CornerRadius="100"
                    Image="Add.png"
                    Clicked="Button_Clicked" />
        </AbsoluteLayout>
    </ContentPage.Content>
</ContentPage>