コード例 #1
0
ファイル: WindowHelper.cs プロジェクト: dpx9fR/AIT.Taskboard
        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();
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Creates a new instance of the TaskboardControlManipulator class.
        /// </summary>
        /// <param name="owningTaskboadControl">TaskboardControl upon which all visual changes are performed.</param>
        public TaskboardControlManipulator(TaskboardControl owningTaskboadControl)
        {
            if (owningTaskboadControl == null)
            {
                throw new ArgumentException("owningTasboardControl");
            }

            _owningControl = owningTaskboadControl;
        }
コード例 #3
0
ファイル: WindowHelper.cs プロジェクト: dpx9fR/AIT.Taskboard
 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);
                 }
             }
         }
     }
 }