示例#1
0
        async void Search(string keyword)
        {
            var r = await HeroesFunctions.SearchAsync(keyword);

            Items = new ObservableCollection <Hero>(r);
            NotifyPropertyChanged("Items");
            NotifyPropertyChanged("Count");
        }
示例#2
0
        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");
            }
        }