public ManageCloudUrls() { this.InitializeComponent(); this.DataContext = new ManageCloudUrlsViewModel(); this.Closed += (s, e) => Messenger.Default.Unregister(this); Messenger.Default.Register<NotificationMessage<bool>>(this, message => { if (message.Notification.Equals(Messages.ManageCloudUrlsDialogResult)) { this.DialogResult = message.Content; this.Close(); Messenger.Default.Unregister(this); } }); Messenger.Default.Register<NotificationMessageAction<bool>>( this, message => { if (message.Notification.Equals(Messages.AddCloudUrl)) { var view = new Views.AddCloudUrl(); Window parentWindow = Window.GetWindow(this); view.Owner = parentWindow; var result = view.ShowDialog(); message.Execute(result.GetValueOrDefault()); } }); Messenger.Default.Register<NotificationMessageAction<bool>>( this, message => { if (message.Notification.Equals(Messages.CreateMicrocloudTarget)) { var view = new Views.CreateMicrocloudTarget(); Window parentWindow = Window.GetWindow(this); view.Owner = parentWindow; var result = view.ShowDialog(); message.Execute(result.GetValueOrDefault()); } }); }
public ManageApplicationUrls() { this.InitializeComponent(); this.DataContext = new ManageApplicationUrlsViewModel(); this.Closed += (s, e) => Messenger.Default.Unregister(this); Messenger.Default.Register <NotificationMessage <bool> >(this, message => { if (message.Notification.Equals(Messages.ManageApplicationUrlsDialogResult)) { this.DialogResult = message.Content; this.Close(); Messenger.Default.Unregister(this); } }); Messenger.Default.Register <NotificationMessageAction <bool> >( this, message => { if (message.Notification.Equals(Messages.AddApplicationUrl)) { var view = new Views.AddApplicationUrl(); Window parentWindow = Window.GetWindow(this); view.Owner = parentWindow; var result = view.ShowDialog(); message.Execute(result.GetValueOrDefault()); } }); Messenger.Default.Register <NotificationMessageAction <bool> >( this, message => { if (message.Notification.Equals(Messages.CreateMicrocloudTarget)) { var view = new Views.CreateMicrocloudTarget(); Window parentWindow = Window.GetWindow(this); view.Owner = parentWindow; var result = view.ShowDialog(); message.Execute(result.GetValueOrDefault()); } }); }