private void OnConfigurationRegistered(object sender, SDK.Model.Events.ConfigurationChangedEventArgs e) { if (!this.Dispatcher.CheckAccess()) { this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new SDK.Model.Events.ConfigurationChangedEventHandler((s, e2) => { OnConfigurationRegistered(sender, e2); }), sender, e); return; } Configurations.Add(new ConfigurationViewModel(e.Configuration)); }
private void OnConfigurationUnRegistered(object sender, SDK.Model.Events.ConfigurationChangedEventArgs e) { if (!this.Dispatcher.CheckAccess()) { this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new SDK.Model.Events.ConfigurationChangedEventHandler((s, e2) => { OnConfigurationUnRegistered(sender, e2); }), sender, e); return; } ConfigurationViewModel viewModel = Configurations.FirstOrDefault(c => c.Configuration.Equals(e.Configuration)); if (viewModel != null) { Configurations.Remove(viewModel); } }