/// <summary> /// Invoked when the bookmark button is clicked. /// </summary> /// <param name="obj">The object</param> private void BookmarkButtonClicked(object obj) { if (obj is Model article) { this.LatestStories.Remove(article); if (this.LatestStories.Count == 0) { SfPopupView sfPopupView = new SfPopupView(); sfPopupView.ShowPopUp(content: "No bookmarks here"); } } }
/// <summary> /// Invoked when an delete button is clicked. /// </summary> /// <param name="obj">The Object</param> private void DeleteClicked(object obj) { if (this.WishlistDetails.Count > 0) { this.WishlistDetails.Remove(obj as Product); if (this.WishlistDetails.Count == 0) { SfPopupView sfPopupView = new SfPopupView(); sfPopupView.ShowPopUp(content: "Your wishlist is empty!", buttonText: "START SHOPPING"); } } }
/// <summary> /// Invoked when an item is selected. /// </summary> /// <param name="obj">The Object</param> private void RemoveClicked(object obj) { if (obj is Product product) { this.CartDetails.Remove(product); this.UpdatePrice(); if (this.CartDetails.Count == 0) { SfPopupView sfPopupView = new SfPopupView(); sfPopupView.ShowPopUp(content: "Your cart is empty!", buttonText: "CONTINUE SHOPPING"); } } }
/// <summary> /// Invoked when an item is selected. /// </summary> /// <param name="obj">The Object</param> private async void RemoveClicked(object obj) { if (obj is Product product) { var removed = await _serviceTerminiStavka.Delete <bool>(product.Id); if (removed == false) { SfPopupView sfPopupView = new SfPopupView(); sfPopupView.ShowPopUp(content: "Item could not be removed from cart.", buttonText: "OK"); return; } this.CartDetails.Remove(product); this.UpdatePrice(); if (this.CartDetails.Count == 0) { SfPopupView sfPopupView = new SfPopupView(); sfPopupView.ShowPopUp(content: "Košarica je prazna!", buttonText: "Nastavite kupovinu", navigation: Navigation, pageToNavigate: typeof(CatalogListPage)); } } }