/// <summary>
 /// Cleares some resources.
 /// </summary>
 public void Dispose()
 {
     this.HookUnhookModelEvents(false);
     this.model = null;
     this.deleteFocusedObject = null;
     BindingOperations.ClearBinding(this.mainTreeView, TreeView.ItemsSourceProperty);
 }
 public void Init(ObservationScheduler scheduler, ApplicationConfiguration configuration, IList <Connector> initialConnectorState)
 {
     this.model = new ConnectorTreeViewModel();
     this.HookUnhookModelEvents(true);
     this.model.Init(scheduler, configuration, initialConnectorState);
     this.DataContext = this.model;
     this.SetupDataContext();
 }
Exemple #3
0
 public void Init(ObservationScheduler scheduler, ApplicationConfiguration configuration, IList <Connector> initialConnectorState)
 {
     this.model = new ConnectorTreeViewModel();
     this.model.PropertyChanged      += this.ModelPropertyChanged;
     this.model.EditItem             += (s, e) => this.EditItem?.Invoke(s, e);
     this.model.DeleteItem           += (s, e) => this.DeleteItem?.Invoke(s, e);
     this.model.ConfigurationChanged += (s, e) => this.ConfigurationChanged?.Invoke(this, EventArgs.Empty);
     this.model.Init(scheduler, configuration, initialConnectorState);
     this.DataContext = this.model;
     this.SetupDataContext();
 }