Class Margin
The lightweight Margin settings for a View. Accessed via Margin. The underlying MarginView is created lazily when shadows, sub-views, or other View-level functionality is needed.
public class Margin : AdornmentImpl, IAdornment
- Inheritance
-
Margin
- Implements
- Inherited Members
Remarks
The Margin is transparent by default. This can be overridden by setting a custom Scheme on the View via GetOrCreateView().
Margins are drawn after all other Views in the application View hierarchy are drawn.
Margins have Transparent and TransparentMouse enabled by default and are thus transparent to the mouse. This can be overridden by explicitly setting ViewportSettingsFlags.
Constructors
- Margin()
Initializes a new instance of the Margin class with default settings. By default, Margins are transparent and transparent to mouse events (i.e., they don't block mouse events from reaching underlying views). This can be overridden by explicitly setting ViewportSettingsFlags.
Properties
- ShadowStyle
Shadow effect. Setting to anything other than None forces a MarginView to be created so the shadow sub-views can be hosted.
Methods
- CreateView()
Factory method — subclasses return their specific AdornmentView subclass.
- GetFrame()
The calculated frame rectangle for this adornment layer, set by Terminal.Gui.ViewBase.View.SetAdornmentFrames. This is the single source of truth for adornment geometry.
- OnThicknessChanged()
Called when Thickness changes. Override in subclasses to react; base is empty.