public void OnAcceptedReceived(object source, RequestEventArgs e) { this.Dispatcher.Invoke(() => { Console.WriteLine(e.user.ToString()); Chat chatPage = new Chat(e.user, userController, frame, this); frame.Navigate(chatPage); }); }
public void OnRequestReceived(object source, RequestEventArgs e) { MessageBoxResult result = MessageBox.Show("Would you like to talk with " + e.user.ToString() + "?", "Request", MessageBoxButton.YesNoCancel); switch (result) { case MessageBoxResult.Yes: this.Dispatcher.Invoke(() => { Chat chatPage = new Chat(e.user, userController, frame, this); frame.Navigate(chatPage); }); break; case MessageBoxResult.No: MessageBox.Show("Oh well, too bad!", "Request"); break; case MessageBoxResult.Cancel: MessageBox.Show("Nevermind then...", "Request"); break; } }