mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Merge pull request #2072 from BDisp/drawcontentcomplete-fix
Fixes #2071. DrawContentComplete event is never called from the base if it's overridden.
This commit is contained in:
@@ -1548,6 +1548,7 @@ namespace Terminal.Gui {
|
||||
};
|
||||
view.OnDrawContent (rect);
|
||||
view.Redraw (rect);
|
||||
view.OnDrawContentComplete (rect);
|
||||
}
|
||||
}
|
||||
view.NeedDisplay = Rect.Empty;
|
||||
|
||||
@@ -3892,5 +3892,23 @@ This is a tes
|
||||
This is a tes
|
||||
", output);
|
||||
}
|
||||
|
||||
[Fact, AutoInitShutdown]
|
||||
public void DrawContentComplete_Event_Is_Always_Called ()
|
||||
{
|
||||
var viewCalled = false;
|
||||
var tvCalled = false;
|
||||
|
||||
var view = new View ("View") { Width = 10, Height = 10 };
|
||||
view.DrawContentComplete += (e) => viewCalled = true;
|
||||
var tv = new TextView () { Y = 11, Width = 10, Height = 10 };
|
||||
tv.DrawContentComplete += (e) => tvCalled = true;
|
||||
|
||||
Application.Top.Add (view, tv);
|
||||
Application.Begin (Application.Top);
|
||||
|
||||
Assert.True (viewCalled);
|
||||
Assert.True (tvCalled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user