public FootballPlayerListPage()
        {
            this.BindingContext = new FootballPlayerViewModel ();

            Title = "Football Legends";
            var create = new ToolbarItem ();
            create.Name = "create";

            this.ToolbarItems.Add (create);
            create.Clicked += Create_Clicked;
            //	create.SetBinding (ToolbarItem.CommandProperty, "CreatePlayer");
            MyFootballList = new ListView ();
            MyFootballList.IsPullToRefreshEnabled = true;
            MyFootballList.Refreshing += MyFootballList_Refreshing;
            MyFootballList.SetBinding (ListView.ItemsSourceProperty, "Footballplayercollection");
            var cell = new DataTemplate (typeof(FootballPlayerListCell));
            MyFootballList.ItemTemplate = cell;
            MyFootballList.RowHeight = 70;

            MessagingCenter.Subscribe<FootballPlayerListCell>(this,"delete",(sender) => {
                this.BindingContext = new FootballPlayerViewModel();
                FootballPlayer dat= new FootballPlayer ();
                MyFootballList.ItemsSource = dat.GetItems ();

            },null);

            MyFootballList.ItemSelected += (object sender, SelectedItemChangedEventArgs e) =>
            {

                Navigation.PushAsync(new FootballPlayerDetailPage(e.SelectedItem));

            };

            this.Content = MyFootballList;
        }
        protected override void OnAppearing()
        {
            base.OnAppearing();
            FootballPlayer dat = new FootballPlayer();

            MyFootballList.ItemsSource = dat.GetItems();
        }
        void MyFootballList_Refreshing(object sender, EventArgs e)
        {
            FootballPlayer dat = new FootballPlayer();

            MyFootballList.ItemsSource = dat.GetItems();
            MyFootballList.EndRefresh();
        }
        public FootballPlayerViewModel()
        {
            SaveCommand = new Command (OnSaveCommand);
            //CreatePlayer = new Command (OnCreatePlayerCommand);
            DeleteData = new Command (OnDeletePlayerCommand);
            //PickImage = new Command (onPick);

            player = new FootballPlayer ();

            Footballplayercollection =new ObservableCollection<FootballPlayer>(player.GetItems());
        }
        public FootballPlayerViewModel()
        {
            SaveCommand = new Command(OnSaveCommand);
            //CreatePlayer = new Command (OnCreatePlayerCommand);
            DeleteData = new Command(OnDeletePlayerCommand);
            //PickImage = new Command (onPick);

            player = new FootballPlayer();


            Footballplayercollection = new ObservableCollection <FootballPlayer>(player.GetItems());
        }
        public FootballPlayerListPage()
        {
            this.BindingContext = new FootballPlayerViewModel();


            Title = "Football Legends";
            var create = new ToolbarItem();

            create.Name = "create";

            this.ToolbarItems.Add(create);
            create.Clicked += Create_Clicked;
            //	create.SetBinding (ToolbarItem.CommandProperty, "CreatePlayer");
            MyFootballList = new ListView();
            MyFootballList.IsPullToRefreshEnabled = true;
            MyFootballList.Refreshing            += MyFootballList_Refreshing;
            MyFootballList.SetBinding(ListView.ItemsSourceProperty, "Footballplayercollection");
            var cell = new DataTemplate(typeof(FootballPlayerListCell));

            MyFootballList.ItemTemplate = cell;
            MyFootballList.RowHeight    = 70;

            MessagingCenter.Subscribe <FootballPlayerListCell>(this, "delete", (sender) => {
                this.BindingContext        = new FootballPlayerViewModel();
                FootballPlayer dat         = new FootballPlayer();
                MyFootballList.ItemsSource = dat.GetItems();
            }, null);



            MyFootballList.ItemSelected += (object sender, SelectedItemChangedEventArgs e) =>
            {
                Navigation.PushAsync(new FootballPlayerDetailPage(e.SelectedItem));
            };

            this.Content = MyFootballList;
        }
 void MyFootballList_Refreshing(object sender, EventArgs e)
 {
     FootballPlayer dat= new FootballPlayer ();
     MyFootballList.ItemsSource =  dat.GetItems ();
     MyFootballList.EndRefresh();
 }
 protected override void OnAppearing()
 {
     base.OnAppearing ();
     FootballPlayer dat= new FootballPlayer ();
     MyFootballList.ItemsSource = dat.GetItems ();
 }