private void ViewManager_ItemSelected(object sender, DataRoutedEventArgs <object> e) { if (e.Data == null) { throw new ArgumentException("e.Data is null", "e"); } StateDescriptor <ManagementList> sd = (StateDescriptor <ManagementList>)e.Data; sd.RestoreState(this); this.CurrentView = sd; }
private void ViewManager_ItemDeleted(object sender, DataRoutedEventArgs <object> e) { if (e.Data == null) { throw new ArgumentException("e.Data is null", "e"); } StateDescriptor <ManagementList> sd = (StateDescriptor <ManagementList>)e.Data; this.Views.Remove(sd); this.RaiseEvent(new RoutedEventArgs(ViewsChangedEvent)); if (object.ReferenceEquals(sd, this.CurrentView)) { this.CurrentView = null; } }