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(); })); }
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(); })); }
private void onCallDialog(DialogContent content) { ViewWindowEx.CallDialogForReceiver(content, this); }