private void WorkspaceUpdatedEventHandler(object sender, WorkspaceUpdatedEventArgs e) { CollectionViewSource.GetDefaultView(Workspaces).Refresh(); CollectionViewSource.GetDefaultView(e.Workspace.CurrentSolution.Projects).Refresh(); WorkspacesMenu.ItemsSource = null; WorkspacesMenu.ItemsSource = Workspaces; return; foreach (var workspacesMenuItem in WorkspacesMenu.Items) { var container0 = WorkspacesMenu.ItemContainerGenerator.ContainerFromItem(workspacesMenuItem); } int i = 0; foreach (object item in WorkspacesMenu.ItemContainerGenerator.Items) { if (Equals(item, e.Workspace)) { var container0 = WorkspacesMenu.ItemContainerGenerator.ContainerFromIndex(i); } i++; } var container = WorkspacesMenu.ItemContainerGenerator.ContainerFromItem(e.Workspace); if (container is MenuItem menuItem) { menuItem.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget(); } // WorkspacesMenu.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget(); }
public void TheIsRefreshProperty(string title1, string title2, bool expectedResult) { var workspace1 = !string.IsNullOrEmpty(title1) ? new Workspace { Title = title1 } : null; var workspace2 = !string.IsNullOrEmpty(title2) ? new Workspace { Title = title2 } : null; var workspaceUpdatedEventArgs = new WorkspaceUpdatedEventArgs(workspace1, workspace2); Assert.AreEqual(expectedResult, workspaceUpdatedEventArgs.IsRefresh); }
private void OnCurrentWorkspaceChanged(object sender, WorkspaceUpdatedEventArgs e) { UpdateCurrentWorkspace(); }
private void Add(WorkspaceUpdatedEventArgs pEvent) { _objWaitTimer.Start(); Updates.Add(pEvent); }
private void WorkspaceContainer_WorkspaceItemUpdated(object sender, WorkspaceUpdatedEventArgs e) { Add(e); }