コード例 #1
0
 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);
     });
 }
コード例 #2
0
        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;
            }
        }