コード例 #1
0
        async Task ExecuteFavoriteCommandAsync(Session session)
        {
            var toggled = await FavoriteService.ToggleFavorite(session);

            if (toggled && Settings.Current.FavoritesOnly)
            {
                SortSessions();
            }
        }
コード例 #2
0
        void ExecuteFavoriteCommand(Session session)
        {
            MessagingService.Current.SendMessage <MessagingServiceQuestion>(MessageKeys.Question, new MessagingServiceQuestion
            {
                Negative    = "Cancel",
                Positive    = "Unfavorite",
                Question    = "Are you sure you want to remove this session from your favorites?",
                Title       = "Unfavorite Session",
                OnCompleted = (async(result) =>
                {
                    if (!result)
                    {
                        return;
                    }

                    var toggled = await FavoriteService.ToggleFavorite(session);
                    if (toggled)
                    {
                        await ExecuteLoadSessionsCommandAsync();
                    }
                })
            });
        }
コード例 #3
0
 async Task ExecuteFavoriteCommandAsync()
 {
     await FavoriteService.ToggleFavorite(Session);
 }