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