Class Button
Raises the Accepting and Accepted events when the user presses HotKey,
Enter, or Space or clicks with the mouse.
public class Button : View, IDisposable, ISupportInitializeNotification, ISupportInitialize, IDesignable, IAcceptTarget
- Inheritance
-
Button
- Implements
- Inherited Members
- Extension Methods
Remarks
Use HotKeySpecifier to change the hot key specifier from the default of ('_').
Button can act as the default Accept handler for all peer-Views. See IsDefault.
Set MouseHoldRepeat to true to have the Accepting event invoked repeatedly while the button is pressed.
Button does not raise Activating events.
Default key bindings:
| Key | Action |
|---|---|
| Space | Accepts the button (Accept). |
| Enter | Accepts the button (Accept). |
Default mouse bindings:
| Mouse Event | Action |
|---|---|
| Click / Double-Click / Triple-Click | Accepts the button (Accept). |
Constructors
Properties
- DefaultMouseHighlightStates
Gets or sets the default Highlight Style.
- DefaultShadow
Gets or sets whether Buttons are shown with a shadow effect by default.
- HotKeySpecifier
Gets or sets the specifier character for the hot key (e.g. '_'). Set to '\xffff' to disable automatic hot key setting support for this View instance. The default is '\xffff'.
- IsDefault
Gets or sets a value indicating whether this view is the default accept target. When true, this view will NOT redirect Accept commands to another DefaultAcceptView and will NOT bubble up when it is the DefaultAcceptView.
- NoDecorations
Gets or sets whether the Button will show decorations or not. If true the glyphs that normally bracket the Button Title and the IsDefault indicator will not be shown.
- NoPadding
Gets or sets whether the Button will include padding on each side of the Title.
Methods
- EnableForDesign()
Causes the View to enable design-time mode. This typically means that the view will load demo data and be configured to allow for design-time manipulation.
- OnHotKeyCommand(ICommandContext?)
Called when the View's HotKey is pressed, if the event was not handled by OnHandlingHotKey(CommandEventArgs) or the HandlingHotKey event.
- OnMouseHoldRepeatChanged(ValueChangedEventArgs<MouseFlags?>)
Called after MouseHoldRepeat has changed.
- UpdateTextFormatterText()
Can be overridden if the Text has different format than the default.