예제 #1
0
 public static void CallDialogForReceiver(DialogContent content, Window container)
 {
     container.Dispatcher.BeginInvoke(new Action(() =>
     {
         ViewWindowEx.EnsureActive(container);
         var dialog = new Epxoxy.Controls.MessageDialog(container)
         {
             Title   = content.Title,
             Content = content.Content,
         };
         System.Media.SystemSounds.Beep.Play();
         if (content.PlayMusic)
         {
             MessengerLight.Messenger.Default.Send(new MediaParameters()
             {
                 Action = PlayAction.Play
             });
             System.ComponentModel.CancelEventHandler handler = null;
             handler = (sender, e) =>
             {
                 dialog.Closing -= handler;
                 MessengerLight.Messenger.Default.Send(new MediaParameters()
                 {
                     Action = PlayAction.Stop
                 });
             };
             dialog.Closing += handler;
         }
         dialog.ShowDialog();
     }));
 }
예제 #2
0
        private void messageDialogBtnClick(object sender, RoutedEventArgs e)
        {
            var dialog = new Epxoxy.Controls.MessageDialog
            {
                Content = "This is a message"
            };

            if (dialog.ShowDialog() == true)
            {
            }
            System.Diagnostics.Debug.WriteLine(dialog.DialogResult);
        }
예제 #3
0
 private void onCallDialog(DialogContent content)
 {
     this.Dispatcher.BeginInvoke(new Action(() =>
     {
         ensureActive();
         var dialog = new Epxoxy.Controls.MessageDialog(this)
         {
             Title   = content.Title,
             Content = content.Content
         };
         System.Media.SystemSounds.Beep.Play();
         dialog.ShowDialog();
     }));
 }