Color legend plain property dependency property method event
A clickable element with a text or any element as content. It can act once per click, repeat while held, or toggle on and off.
Button derives from BaseElement and has its members too. The controls page shows it in context, with code and screenshots.
Names are colored by what they are: a plain property, a method, an event or a dependency property, which a style, a binding or an animation can set.
Properties
BackgroundStyle 馃爢
ImageStyle 路 The style of the image the button draws its background with.
Content 馃爢
BaseElement 路 Any element shown inside the button instead of a text. A content you give is detached, not disposed, when it is replaced.
GeneralMouseCursorsSet 馃爢
MouseCursorsSet 路 Static. The cursors of every element of this style type; null (the default) falls back to DefaultMouseCursorsSet.
GeneralStyle 馃爢
ButtonStyle 路 Static. The style of every element of this style type. It starts as a copy of the framework defaults; changing one of its properties updates every such element, a property it leaves unset takes its default.
HoverColor 馃爢
Color 路 The solid color while the mouse is over the button. (200, 220, 240) unless set (DefaultSettings.DefaultButtonHoverColor).
MouseCursorsSet 馃爢
MouseCursorsSet 路 Read-only. The cursors the element shows: its override, else the set given to the control it is a part of, else its type鈥檚 general set, else DefaultMouseCursorsSet.
MouseCursorsSetOverride 馃爢
MouseCursorsSet 路 The cursors of this element only, passed on to its parts that have none of their own.
NormalColor 馃爢
Color 路 The solid color while nothing happens. (225, 225, 230) unless set (DefaultSettings.DefaultButtonNormalColor).
PressedColor 馃爢
Color 路 The solid color while the button is pressed. (160, 190, 225) unless set (DefaultSettings.DefaultButtonPressedColor).
StyleOverride 馃爢
ButtonStyle 路 A style for this element only, applied over the general style. Setting it to null takes its values back out.
Text 馃爢
string 路 Creates a centered Label content showing this text, styled by TextStyle.
TextStyle 馃爢
LabelStyle 路 The style of the text content made from Text.
ToggledColor 馃爢
Color 路 The solid color of a Toggle button that is on. (86, 156, 214) unless set (DefaultSettings.DefaultButtonToggledColor).
ToggledOn 馃爢
bool 路 Whether a Toggle button is on. Set it to switch the button from code; OnToggled is raised.
Type 馃爢
ButtonType 路 How the button reacts to the mouse: Normal, Repeat or Toggle.
Methods
Button() 馃爢
Button(string name = null) 路 Creates a button. The name is used by GetElementByName.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The element鈥檚 Name, which GetElementByName finds it by. Default: null. |
Events
OnToggled 馃爢
(BaseElement sender, bool isToggledOn) 路 A Toggle button turns on or off, by a click or from code.
| Parameter | Type | Description |
|---|---|---|
sender |
BaseElement |
The element that raised the event. |
isToggledOn |
bool |
Whether the button is on now. |