fix<WorkingCopy>: force trigger DataGrid layout update to fix bad column with issue

This commit is contained in:
leo 2021-01-12 20:49:48 +08:00
parent 57a02b1d86
commit 2054df31b9
2 changed files with 8 additions and 2 deletions

View file

@ -114,6 +114,12 @@ namespace SourceGit.UI {
UpdateData(unstaged, UnstagedListData, UnstagedTreeData);
UpdateData(staged, StagedListData, StagedTreeData);
// Force trigger UpdateLayout for DataGrid.
unstagedList.Columns.Add(new DataGridTextColumn());
unstagedList.Columns.RemoveAt(unstagedList.Columns.Count - 1);
stageList.Columns.Add(new DataGridTextColumn());
stageList.Columns.RemoveAt(stageList.Columns.Count - 1);
var current = Repo.CurrentBranch();
if (current != null && !string.IsNullOrEmpty(current.Upstream) && chkAmend.IsChecked != true) {
btnCommitAndPush.Visibility = Visibility.Visible;