Пример #1
0
        /* ************************
         * VISUAL SWYPE (ITEM MOVE)
         * ************************
         */
        private async void ItemSwipeTriggerComplete(object sender, LLM.SwipeCompleteEventArgs args)
        {
            LLM.LLMListViewItem item = (LLM.LLMListViewItem)sender;
            Quote quote = (Quote)item.Content;

            if (args.SwipeDirection == LLM.SwipeDirection.Left)
            {
                quote.IsShared = false;
                Controller.share(quote);
            }
            else
            {
                // Favorite/Un-Favorite
                if (FavoritesController.IsFavorite(quote.Link))
                {
                    // Remove from favorites
                    bool result = await FavoritesController.RemoveFavorite(quote);

                    if (result)
                    {
                        quote.IsFavorite = false;
                    }
                }
                else
                {
                    // Add to favorites
                    bool result = await FavoritesController.AddFavorite(quote);

                    if (result)
                    {
                        quote.IsFavorite = true;
                    }
                }
            }
        }
Пример #2
0
        private async void Favorite_Tapped(object sender, TappedRoutedEventArgs e)
        {
            FontIcon icon  = (FontIcon)sender;
            Quote    quote = (Quote)icon.DataContext;

            if (FavoritesController.IsFavorite(quote.Link))
            {
                // Remove from favorites
                bool result = await FavoritesController.RemoveFavorite(quote);

                if (result)
                {
                    quote.IsFavorite = false;
                }
            }
            else
            {
                // Add to favorites
                bool result = await FavoritesController.AddFavorite(quote);

                if (result)
                {
                    quote.IsFavorite = true;
                }
            }
        }
Пример #3
0
        /* ***************
         * EVENTS HANDLERS
         * ***************
         */
        private async void Favorite_Tapped(object sender, TappedRoutedEventArgs e)
        {
            FontIcon icon  = (FontIcon)sender;
            Quote    quote = (Quote)icon.DataContext;

            bool result = await FavoritesController.RemoveFavorite(quote, FavoritesController.CollectionType.favorites);
        }