Table of Contents

Property CommandsToBubbleUp

Namespace
Terminal.Gui.ViewBase
Assembly
Terminal.Gui.dll

CommandsToBubbleUp

Gets or sets the list of commands that should bubble up to this View from unhandled SubViews or from SubViews within this View's adornments (Padding, Border, Margin). When a SubView raises a command that is not handled, and the command is in the SuperView's CommandsToBubbleUp list, the command will be invoked on the SuperView.

public IReadOnlyList<Command> CommandsToBubbleUp { get; set; }

Property Value

IReadOnlyList<Command>

Remarks

For SubViews inside an AdornmentView (e.g., a view in Padding or Border), the bubble target is Parent (the owning View) rather than SuperView. This means a view added to editor.Padding will bubble commands directly to editor, not to the PaddingView.

Mouse-wheel forwarding pattern: A SubView can add a MouseBindings entry (e.g., MouseBindings.Add(MouseFlags.WheeledUp, Command.ScrollUp)) without calling AddCommand for the command. The unhandled command will fire CommandNotBound and then bubble via TryBubbleUp(ICommandContext?, bool) to the nearest ancestor whose CommandsToBubbleUp contains it.

Example — enable scroll command bubbling:

<pre><code class="lang-csharp">editor.CommandsToBubbleUp = [Command.ScrollUp, Command.ScrollDown];</code></pre>

Example — enable Activate bubbling for hierarchical views:

<pre><code class="lang-csharp">menuBar.CommandsToBubbleUp = [Command.Activate];</code></pre>