void SetActiveWorkspace(WorkspaceBaseVM workspace) { Debug.Assert(this.Workspaces.Contains(workspace)); ICollectionView collectionView = CollectionViewSource.GetDefaultView(this.Workspaces); if (collectionView != null) { collectionView.MoveCurrentTo(workspace); } }
void ShowAllUsers() { WorkspaceBaseVM workspace = this.Workspaces.FirstOrDefault(vm => vm is AllUsersVM) as WorkspaceBaseVM; if (workspace == null) { workspace = new AllUsersVM(_userRepository, this); Workspaces.Add(workspace); } SetActiveWorkspace(workspace); }
public void CloseRequest(WorkspaceBaseVM workspace) { workspace.Dispose(); this.Workspaces.Remove(workspace); }