async void Search(string keyword) { var r = await HeroesFunctions.SearchAsync(keyword); Items = new ObservableCollection <Hero>(r); NotifyPropertyChanged("Items"); NotifyPropertyChanged("Count"); }
async void DeleteHero(long id) { var first = Items.FirstOrDefault(d => d.Id == id); if (first != null) { if (first.Id == Selected.Id) { Selected = null; } await HeroesFunctions.DeleteAsync(id); Items.Remove(first); NotifyPropertyChanged("Items"); NotifyPropertyChanged("Count"); } }