private void HandleFavoriteCheckedChange(object sender, FavoriteCheckedChangeEventArgs e) { ProductViewModel vm = adapter.GetItem(e.Position).Product; vm.IsFavorite = e.IsChecked; if (e.IsChecked) { productService.AddToFavorites(vm); } else { productService.RemoveFromFavorites(vm); } }
private void OnFavoriteCheckedChange(FavoriteCheckedChangeEventArgs args) => FavoriteCheckedChange?.Invoke(this, args);