Interface IButtonBuilder
A button, the Button element of a view file, built in C#.
public interface IButtonBuilder : IControlBuilder<IButtonBuilder>
- Inherited Members
Methods
BindText(Action<IControlTextBindingBuilder<IButtonBuilder>>)
Binds the button's text, with the binding set up by configure. Same result
as BindText(string).
IButtonBuilder BindText(Action<IControlTextBindingBuilder<IButtonBuilder>> configure)
Parameters
configureAction<IControlTextBindingBuilder<IButtonBuilder>>
Returns
BindText(string)
Binds the button's text to the view model property propertyName.
IButtonBuilder BindText(string propertyName)
Parameters
propertyNamestring
Returns
WithClickedState(Action<IControlStateBuilder<IButtonBuilder>>)
Configures the button's look while it is pressed with the mouse. Falls back to the normal state when not set.
IButtonBuilder WithClickedState(Action<IControlStateBuilder<IButtonBuilder>> configure)
Parameters
configureAction<IControlStateBuilder<IButtonBuilder>>
Returns
WithCommand(string)
Sets the name of the view model's ICommand property that runs when the button is
pressed.
IButtonBuilder WithCommand(string command)
Parameters
commandstring
Returns
WithFocusedState(Action<IControlStateBuilder<IButtonBuilder>>)
Configures the button's look while it has keyboard focus.
IButtonBuilder WithFocusedState(Action<IControlStateBuilder<IButtonBuilder>> configure)
Parameters
configureAction<IControlStateBuilder<IButtonBuilder>>
Returns
WithFont(string)
Sets the font for the button's text: a BMFont (.fnt) or TrueType (.ttf/.otf) file.
IButtonBuilder WithFont(string fontName)
Parameters
fontNamestring
Returns
WithFontSize(float)
Sets the point size of the text. Zero keeps the font's own size.
IButtonBuilder WithFontSize(float size)
Parameters
sizefloat
Returns
WithHoverState(Action<IControlStateBuilder<IButtonBuilder>>)
Configures the button's look while the pointer is over it. Falls back to the normal state when not set.
IButtonBuilder WithHoverState(Action<IControlStateBuilder<IButtonBuilder>> configure)
Parameters
configureAction<IControlStateBuilder<IButtonBuilder>>
Returns
WithIsDefault(bool)
Whether this is the view's default button, pressed by Enter. Several may say so; the one in front of the player wins.
IButtonBuilder WithIsDefault(bool isDefault)
Parameters
isDefaultbool
Returns
WithLetterSpacing(float)
Sets the extra space between glyphs, in pixels.
IButtonBuilder WithLetterSpacing(float spacing)
Parameters
spacingfloat
Returns
WithNormalState(Action<IControlStateBuilder<IButtonBuilder>>)
Configures the button's look in its normal state.
IButtonBuilder WithNormalState(Action<IControlStateBuilder<IButtonBuilder>> configure)
Parameters
configureAction<IControlStateBuilder<IButtonBuilder>>
Returns
WithSize(int, int)
Sets the button's size in pixels, as the Size attribute does.
IButtonBuilder WithSize(int width, int height)
Parameters
Returns
WithText(string)
Sets the text on the button. A "{Localize key}" shows that key's text in the current language.
IButtonBuilder WithText(string text)
Parameters
textstring