Skip to content

Commit 91acf0a

Browse files
committed
enhance: fore invalidate measure after data context of BisectStateIndicator changed
Signed-off-by: leo <longshuang@msn.cn>
1 parent d44d2b9 commit 91acf0a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Models/Bisect.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23

34
namespace SourceGit.Models
45
{
@@ -9,6 +10,7 @@ public enum BisectState
910
Detecting,
1011
}
1112

13+
[Flags]
1214
public enum BisectCommitFlag
1315
{
1416
None = 0,

src/Views/BisectStateIndicator.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ public override void Render(DrawingContext context)
6565
RenderImpl(context, Brushes.Red, _bad, x);
6666
}
6767

68+
protected override void OnDataContextChanged(EventArgs e)
69+
{
70+
base.OnDataContextChanged(e);
71+
InvalidateMeasure();
72+
}
73+
6874
protected override Size MeasureOverride(Size availableSize)
6975
{
7076
var desiredFlags = Models.BisectCommitFlag.None;

0 commit comments

Comments
 (0)