async Task ExecuteFavoriteCommandAsync(Session session) { var toggled = await FavoriteService.ToggleFavorite(session); if (toggled && Settings.Current.FavoritesOnly) { SortSessions(); } }
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(); } }) }); }
async Task ExecuteFavoriteCommandAsync() { await FavoriteService.ToggleFavorite(Session); }