#nullable enable using System.Collections.Concurrent; namespace Terminal.Gui.App; public static partial class Application // Toplevel handling { // BUGBUG: Technically, this is not the full lst of TopLevels. There be dragons here, e.g. see how Toplevel.Id is used. What private static readonly ConcurrentStack _topLevels = new (); private static readonly object _topLevelsLock = new (); /// Holds the stack of TopLevel views. internal static ConcurrentStack TopLevels { get { lock (_topLevelsLock) { return _topLevels; } } } /// The that is currently active. /// The top. public static Toplevel? Top { get; internal set; } }