<?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="XamFormsREST.Views.MainPage">
  <ContentPage.ToolbarItems>
    <ToolbarItem Name="Nowy" Activated="OnAddUserClick"  Order="Primary" Priority="0">
      <ToolbarItem.Icon>
        <OnPlatform x:TypeArguments="FileImageSource"
          WinPhone="Toolkit.Content/ApplicationBar.Add.png" />
      </ToolbarItem.Icon>
    </ToolbarItem>
  </ContentPage.ToolbarItems>
  <ListView x:Name="listView" ItemSelected="OnItemSelected"
            ItemsSource="{Binding .}">
    <ListView.RowHeight>
      <OnPlatform x:TypeArguments="x:Int32">
        <OnPlatform.iOS>55</OnPlatform.iOS>
        <OnPlatform.Android>55</OnPlatform.Android>
        <OnPlatform.WinPhone>75</OnPlatform.WinPhone>
      </OnPlatform>
    </ListView.RowHeight>
    <ListView.ItemTemplate>
      <DataTemplate>
        <ViewCell>
          <StackLayout HorizontalOptions="StartAndExpand" Orientation="Horizontal">
            <StackLayout Padding="5,0,0,0" VerticalOptions="StartAndExpand" Orientation="Vertical">
              <Label Text="{Binding OrderNumber}" YAlign="Center" FontSize="Medium" />
              <Label Text="{Binding ClientComments}" YAlign="Center" FontSize="Small" />
            </StackLayout>
            <Button Text="Usuń"
						  BackgroundColor="Red"
						  HorizontalOptions="EndAndExpand"
						  CommandParameter="{Binding ObjectId}"
						  Clicked="OnCellClicked" />
          </StackLayout>
        </ViewCell>
      </DataTemplate>
    </ListView.ItemTemplate>
  </ListView>
</ContentPage>