internal static void RefreshWorkItemCell(TaskboardControl taskboard) { var grid = WpfHelper.FindVisualChild <DataGrid>(taskboard); if (grid != null) { // get selected item var workItemControl = WorkItemControl.SelectedItem; if (workItemControl != null) { // get cells presenter for current row var gridCellsPresenter = WpfHelper.FindVisualParent <System.Windows.Controls.Primitives.DataGridCellsPresenter>(workItemControl); if (gridCellsPresenter != null) { for (int i = 0; i < gridCellsPresenter.Items.Count; i++) { var cell = gridCellsPresenter.ItemContainerGenerator.ContainerFromIndex(i) as DataGridCell; if (cell != null) { // reset data context for cell to re-render content ResetDataContext(cell); } } } } var applicationViewModel = grid.DataContext as ApplicationViewModel; if (applicationViewModel != null) { applicationViewModel.RefreshSummaries(); } } }
public static void RefreshBacklogItemCell(TaskboardControl taskboardControl) { if (taskboardControl != null) { var grid = WpfHelper.FindVisualChild <DataGrid>(taskboardControl); if (grid != null) { var workItemControl = WorkItemControl.SelectedItem; if (workItemControl != null) { var row = WpfHelper.FindVisualParent <DataGridRow>(workItemControl); if (row != null) { ResetDataContext(row); } var childPresenter = WpfHelper.FindVisualChild <ContentPresenter>(workItemControl); if (childPresenter != null) { ResetDataContext(childPresenter); } } } } }