<?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:local="clr-namespace:XamFormsAddingRemovingItems;assembly=XamFormsAddingRemovingItems"
             x:Class="XamFormsAddingRemovingItems.MainPage"
             BindingContext="{x:Static local:Character.Characters}"
             Title="Gwiezdne wojny">
  <ContentPage.ToolbarItems>
    <ToolbarItem Text="Nowy" Activated="OnToolbarClick"  Order="Primary" Priority="0">
      <ToolbarItem.Icon>
        <OnPlatform x:TypeArguments="FileImageSource"
          WinPhone="Toolkit.Content/ApplicationBar.Add.png" />
      </ToolbarItem.Icon>
    </ToolbarItem>
  </ContentPage.ToolbarItems>
  <ListView ItemsSource="{Binding .}" IsPullToRefreshEnabled="True" Refreshing="OnRefreshing">
    <ListView.ItemTemplate>
      <DataTemplate>
        <TextCell Text="{Binding Name}">
          <TextCell.ContextActions>
            <MenuItem Clicked="OnDelete" Text="Usuń" IsDestructive="True"/>
          </TextCell.ContextActions>
        </TextCell>
      </DataTemplate>
    </ListView.ItemTemplate>
  </ListView>
</ContentPage>