Table of Contents

Event Accepting

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

Cancelable event raised when the user is accepting the state of the View and the Accept has been invoked. Set CommandEventArgs.Handled to true to indicate the event was handled and processing should stop.

public event EventHandler<CommandEventArgs>? Accepting

Returns

EventHandler<CommandEventArgs>
Cancelable event raised when the user is accepting the state of the View and the has been invoked. Set CommandEventArgs.Handled to true to indicate the event was handled and processing should stop.

Remarks

See RaiseAccepting(ICommandContext?) for more information.

When to use: Subscribe to Accepting only when you need to inspect or cancel the in-flight Accept operation (e.g., set e.Handled = true to prevent the accept). For simple side-effects that don't need to cancel, subscribe to Accepted instead — it is lighter-weight and communicates intent more clearly.

Rule of thumb: If your handler doesn't read or set anything on CommandEventArgs (no e.Handled, no inspection of context), use Accepted.