diff --git a/Terminal.Gui/Core/View.cs b/Terminal.Gui/Core/View.cs index 99afe4b07..67dfdf755 100644 --- a/Terminal.Gui/Core/View.cs +++ b/Terminal.Gui/Core/View.cs @@ -1548,6 +1548,7 @@ namespace Terminal.Gui { }; view.OnDrawContent (rect); view.Redraw (rect); + view.OnDrawContentComplete (rect); } } view.NeedDisplay = Rect.Empty; diff --git a/UnitTests/ViewTests.cs b/UnitTests/ViewTests.cs index ef601b46b..3c03abe3f 100644 --- a/UnitTests/ViewTests.cs +++ b/UnitTests/ViewTests.cs @@ -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); + } } }