async Task AddItemToHat() { if (!string.IsNullOrWhiteSpace(NewItemEntry)) { if (!HatItems.Any(x => x.Equals(NewItemEntry, StringComparison.CurrentCultureIgnoreCase))) { HatItems.Add(NewItemEntry); NewItemEntry = string.Empty; OnPropertyChanged(nameof(HatItems)); OnPropertyChanged(nameof(NewItemEntry)); } else { await Application.Current.MainPage.DisplayAlert(string.Empty, "Item already added.", "OK"); } } }
void RemoveItemFromHat(string item) { HatItems.Remove(item); OnPropertyChanged(nameof(HatItems)); }