public FootballPlayerListviewCellPage()
        {
            InitializeComponent ();
            //			FootballPlayer footballplayercollection = (FootballPlayer)this.BindingContext;
            this.FootBallPlayerName.SetBinding (Label.TextProperty, "FullName");
            this.DateofBirthWithYears.SetBinding (Label.TextProperty, "DateOfBithWithAge");
            this.CountryImage.SetBinding (Image.SourceProperty, "CountryImage");
            this.CellView.BackgroundColor = Color.FromHex ("#eee");
            var deleteAction = new MenuItem {
                Text = "Delete", IsDestructive = true
            };

            deleteAction.SetBinding (MenuItem.CommandParameterProperty, new Binding ("."));
            deleteAction.Clicked += (sender, e) => {
                FootballPlayer player;
                var mi = ((MenuItem)sender);
                player= (FootballPlayer)mi.CommandParameter;
                SQLiteHelper databaseHelper = new SQLiteHelper();
                databaseHelper.DeletePlayerWithName(player);
                MessagingCenter.Send(this,"ItemDeleted");
            };
            this.ContextActions.Add (deleteAction);

            var favouriteAction = new MenuItem {
                Text = "Favourite", IsDestructive = false
            };
            favouriteAction.SetBinding (MenuItem.CommandParameterProperty, new Binding ("."));
            favouriteAction.Clicked += (sender, e) => {
                FootballPlayer player;
                var mi = ((MenuItem)sender);
                player = (FootballPlayer)mi.CommandParameter;
                SQLiteHelper databaseHelper = new SQLiteHelper();
                databaseHelper.DeletePlayerWithName(player);
                player.IsFavourite = !player.IsFavourite;
                if (player.IsFavourite) {
                    this.CellView.BackgroundColor = Color.Green;
                }
                else
                {
                    this.CellView.BackgroundColor = Color.FromHex("#eee");
                }

                databaseHelper.Save(player);
                MessagingCenter.Send(this,"ItemDeleted");
            };

            this.ContextActions.Add (favouriteAction);
        }
 public FootballPlayerListViewModel()
 {
     AddPlayerBTNTapped = new Command (OnAddPlayerBTNTapped);
     SQLiteHelper databaseHelper = new SQLiteHelper ();
     FootballPlayerCollection = new ObservableCollection<FootballPlayer> (databaseHelper.GetItems ());
 }
 protected override void OnAppearing()
 {
     base.OnAppearing ();
     SQLiteHelper databaseHelper = new SQLiteHelper ();
     this.FootballPlayersListView.ItemsSource = databaseHelper.GetItems ();
 }