Button
A clickable button that can bind a launcher action or function.Signature
Attributes
Action parameters go directly on the
Button as attributes or attribute elements; see the Actions reference.
Size / Variant values
Button.Size only accepts Sm / Md / Lg; the Xs–2Xl values of Text.Size do not apply to buttons. See Attribute values for the full table.
ShortcutKeys
- Supports
Alt/Ctrl/Shift/Metamodifiers and one main key. - You can also write
<ShortcutKey Key="Alt+L" />. - Multiple
ShortcutKeyelements form one shortcut. - Shortcuts are ignored while an input is focused.
- A shortcut runs the same
OnClick/Clicktrigger as a button click.
Effects
Buttons support the same<Button.Effects> as other visual nodes:
Content syntax
Text="刷新".
Runtime behavior
- Renders the launcher
Buttoncomponent. - With an empty
OnClickthe button is clickable but does nothing. - A click first fires the
Clicktrigger with the sameName, then runsOnClick. - In preview mode
RunCommand/PluginApido not execute.
Example
Gotchas
- The action parameters of
OnClickmust belong to that action; wrong ones are rejected by XML validation. - Long button text widens the button; for wrapping, use
Textinside a custom container, or shorten the text. Nameis not the display text; it only targets triggers.