@@ -505,6 +505,11 @@ public static partial class Application // Run (Begin, Run, End, Stop)
{
bool neededLayout = View.Layout (TopLevels.Reverse (), Screen.Size);
+ if (ClearScreenNextIteration)
+ {
+ forceDraw = true;
+ ClearScreenNextIteration = false;
+ }
if (forceDraw)
Driver?.ClearContents ();
@@ -67,4 +67,13 @@ public static partial class Application // Screen related stuff
return true;
}
+
+ /// <summary>
+ /// Gets or sets whether the screen will be cleared, and all Views redrawn, during the next Application iteration.
+ /// </summary>
+ /// <remarks>
+ /// This is typicall set to true when a View's <see cref="View.Frame"/> changes and that view has no
+ /// SuperView (e.g. when <see cref="Application.Top"/> is moved or resized.
+ /// </remarks>
+ public static bool ClearScreenNextIteratio { get; set; }
@@ -215,6 +215,8 @@ public static partial class Application
Navigation = null;
AddApplicationKeyBindings ();
// Reset synchronization context to allow the user to run async/await,
@@ -557,7 +557,14 @@ public partial class View // Layout APIs
SetTitleTextFormatterSize ();
- SuperView?.SetNeedsDraw ();
+ if (SuperView is { })
+ SuperView?.SetNeedsDraw ();
+ else
+ // Application.ClearScreenNextIteration = true;
if (TextFormatter.ConstrainToWidth is null)