protected bool ToggleFavourite() { if (this.currentPlayingVideo != null) { var fav = dataService.IsFavourite(this.currentPlayingVideo.Parent); if (!fav) { dataService.AddToFavourite(this.currentPlayingVideo.Parent); } else { dataService.DeleteFromFavourite(this.currentPlayingVideo.Parent); } if (this.ToggelFavourite != null) { this.ToggelFavourite(this, new ToggleFavouriteEventArgs { IsFavourite = !fav, Video = this.currentPlayingVideo.Parent }); } return(!fav); } return(false); }
private void addToFavouriteToolStripMenuItem_Click(object sender, EventArgs e) { dataService.AddToFavourite(this.data); UpdateFavourite(); if (Favourited != null) { Favourited(this, new GalleryItemFavouriteEventArgs(this.data, true)); } }