상속: System.NotifyPropertyChangedBase
예제 #1
0
		private static void GoToFriend(Friend friend)
		{
			App.CurrentFrame.Navigate(typeof (FriendPage), friend);
		}
예제 #2
0
		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();
		}
예제 #3
0
		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();
		}