private static void GoToFriend(Friend friend) { App.CurrentFrame.Navigate(typeof (FriendPage), friend); }
private static async void ChangeDisplayName(Friend friend) { await ProgressHelper.ShowStatusBar(App.Loader.GetString("StatusBarChangeDisplay")); #if WINDOWS_PHONE_APP var contentDialog = new ChangeDisplayNameDialog(friend.FriendlyName); var result = await contentDialog.ShowAsync(); if (result != ContentDialogResult.Primary) return; await App.SnapChatManager.Endpoints.ChangeFriendDisplayNameAsync(friend.Name, contentDialog.NewDisplayName); friend.DisplayName = contentDialog.NewDisplayName; #else // TODO: Windows 8 App logic #endif friend.NotifyPropertyChanged("DisplayName"); friend.NotifyPropertyChanged("Name"); friend.NotifyPropertyChanged("FriendlyName"); await ProgressHelper.HideStatusBar(); App.UpdateSnapchatData(); }
private static async void RemoveFriend(Friend friend) { await ProgressHelper.ShowStatusBar(App.Loader.GetString("StatusBarRemoving")); var dialog = new MessageDialog(App.Loader.GetString("RemovingDialogBody"), App.Loader.GetString("GenericCautionDialogHeader")); dialog.Commands.Add(new UICommand(App.Loader.GetString("Yes"))); dialog.Commands.Add(new UICommand(App.Loader.GetString("Cancel"), command => ProgressHelper.HideStatusBar().Wait())); var result = await dialog.ShowAsync(); if (result.Label != App.Loader.GetString("Yes")) return; await App.SnapChatManager.Endpoints.SendFriendActionAsync(friend.Name, FriendAction.Delete); friend.NotifyPropertyChanged("FriendRequestState"); await ProgressHelper.HideStatusBar(); App.UpdateSnapchatData(); }