ButtonExtensions
Wisej.Web.Markup.ButtonExtensions
Last updated
Was this helpful?
Wisej.Web.Markup.ButtonExtensions
Last updated
Was this helpful?
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.0.0.0)
Adds fluent markup extension methods to the ButtonBase, Button and SplitButton classes.
public class ButtonExtensions
Sets the AllowHtml property of the specified ButtonBase.
TButtonBase
button
The button for which to set the AllowHtml property.
value
A boolean indicating whether HTML is allowed in the button's text.
Returns: TButtonBase. The modified button with the updated AllowHtml property.
This method allows you to enable or disable HTML content in the button's text.
myButton.AllowHtml(true);
Sets the AllowMarkdown property of the specified ButtonBase.
TButtonBase
button
The button for which to set the AllowMarkdown property.
value
A boolean indicating whether Markdown is allowed in the button's text.
Returns: TButtonBase. The modified button with the updated AllowMarkdown property.
This method allows you to enable or disable Markdown content in the button's text.
myButton.AllowMarkdown(true);
Sets the AutoEllipsis property of the specified ButtonBase.
TButtonBase
button
The button for which to set the AutoEllipsis property.
value
A boolean indicating whether to automatically show ellipses when text is truncated.
Returns: TButtonBase. The modified button with the updated AutoEllipsis property.
This method allows you to enable or disable the automatic display of ellipses when the button's text is truncated.
myButton.AutoEllipsis(true);
Sets the AutoShowLoader property of the specified ButtonBase.
TButtonBase
button
The button for which to set the AutoShowLoader property.
value
A boolean indicating whether to automatically show a loader on the button.
Returns: TButtonBase. The modified button with the updated AutoShowLoader property.
This method allows you to enable or disable the automatic display of a loader on the button.
myButton.AutoShowLoader(true);
Sets the AutoSizeMode property of the specified Button.
TButton
button
The button for which to set the AutoSizeMode property.
mode
Returns: TButton. The modified button with the updated AutoSizeMode property.
This method allows you to specify the automatic sizing behavior for the button.
myButton.AutoSizeMode(AutoSizeMode.GrowAndShrink);
Sets the AutoToolTip property of the specified Button.
TButton
button
The button for which to set the AutoToolTip property.
value
A boolean indicating whether tooltips are automatically shown for the button.
Returns: TButton. The modified button with the updated AutoToolTip property.
This method allows you to enable or disable automatic tooltips for the button.
myButton.AutoToolTip(true);
Sets the BorderStyle property of the specified Button.
TButton
button
The button for which to set the BorderStyle property.
borderStyle
Returns: TButton. The modified button with the updated BorderStyle property.
This method allows you to specify the border style for the button.
myButton.BorderStyle(BorderStyle.FixedSingle);
Sets the CharacterCasing property of the specified ButtonBase.
TButtonBase
button
The button for which to set the CharacterCasing property.
casing
Returns: TButtonBase. The modified button with the updated CharacterCasing property.
This method allows you to specify the character casing for the button's text.
myButton.CharacterCasing(CharacterCasing.Upper);
Sets the Display property of the specified Button.
TButton
button
The button for which to set the Display property.
display
Returns: TButton. The modified button with the updated Display property.
This method allows you to specify the display setting for the button.
myButton.Display(Display.Standard);
Sets the ImageSpacing property of the specified Button.
TButton
button
The button for which to set the ImageSpacing property.
spacing
The spacing to set between the image and text on the button.
Returns: TButton. The modified button with the updated ImageSpacing property.
This method allows you to specify the spacing between the image and text on the button.
myButton.ImageSpacing(10);
Adds the specified menu items to the MenuItems collection of the specified Button.
TButton
button
The button to which the menu items should be added.
items
Returns: TButton. The modified button with the added menu items.
This method allows you to add multiple menu items to the button in one call.
myButton.MenuItems(new MenuItem("Item1"), new MenuItem("Item2"));
Attaches an event handler for the ItemClicked event of the specified Button.
TButton
button
The button to attach the event handler to.
action
An action to execute when an item is clicked.
Returns: TButton. The modified button with the attached ItemClicked event handler.
This method allows you to execute a custom action whenever an item within the button's menu is clicked.
myButton.OnItemClicked((btn, args) =>
{
AlertBox.Show("Item clicked!");
});
Attaches an event handler for the MenuCollapse event of the specified Button.
TButton
button
The button to attach the event handler to.
action
An action to execute when the menu collapses.
Returns: TButton. The modified button with the attached MenuCollapse event handler.
This method allows you to execute a custom action whenever the button's menu collapses.
myButton.OnMenuCollapse(btn =>
{
AlertBox.Show("Menu collapsed!");
});
Attaches an event handler for the MenuPopup event of the specified Button.
TButton
button
The button to attach the event handler to.
action
An action to execute when the menu pops up.
Returns: TButton. The modified button with the attached MenuPopup event handler.
This method allows you to execute a custom action whenever the button's menu pops up.
myButton.OnMenuPopup(btn =>
{
AlertBox.Show("Menu popped up!");
});
Sets the Orientation property of the specified SplitButton.
TSplitButton
button
The split button for which to set the Orientation property.
orientation
Returns: TSplitButton. The modified button with the updated Orientation property.
This method allows you to specify the orientation of the split button, such as horizontal or vertical.
mySplitButton.Orientation(Orientation.Horizontal);
Sets the Repeat property of the specified Button.
TButton
button
The button for which to set the Repeat property.
value
A boolean indicating whether the button repeats its action when held down.
Returns: TButton. The modified button with the updated Repeat property.
This method allows you to enable or disable repeating actions for the button when it is held down.
myButton.Repeat(true);
Sets the Shortcut property of the specified Button.
TButton
button
The button for which to set the Shortcut property.
shortcut
Returns: TButton. The modified button with the updated Shortcut property.
This method allows you to specify a keyboard shortcut for the button.
myButton.Shortcut(Shortcut.CtrlS);
Sets the TextAlign property of the specified ButtonBase.
TButtonBase
button
The button for which to set the TextAlign property.
alignment
Returns: TButtonBase. The modified button with the updated TextAlign property.
This method allows you to specify the alignment of the text on the button.
myButton.TextAlign(ContentAlignment.MiddleCenter);
Sets the TextImageRelation property of the specified ButtonBase.
TButtonBase
button
The button for which to set the TextImageRelation property.
textImageRelation
Returns: TButtonBase. The modified button with the updated TextImageRelation property.
This method allows you to specify the relationship between the button's text and image.
myButton.TextImageRelation(TextImageRelation.ImageBeforeText);
Sets the UseMnemonic property of the specified ButtonBase.
TButtonBase
button
The button for which to set the UseMnemonic property.
value
A boolean indicating whether mnemonic characters are used.
Returns: TButtonBase. The modified button with the updated UseMnemonic property.
This method allows you to enable or disable the use of mnemonic characters in the button's text.
myButton.UseMnemonic(true);
The type of the button, must inherit from .
The type of the button, must inherit from .
The type of the button, must inherit from .
The type of the button, must inherit from .
The type of the button, must inherit from .
The to set for the button.
The type of the button, must inherit from and have an AutoToolTip property.
The type of the button, must inherit from and have a BorderStyle property.
The to set for the button.
The type of the button, must inherit from .
The to set for the button text.
The type of the button, must inherit from and have a Display property.
The setting to apply to the button.
The type of the button, must inherit from and have an ImageSpacing property.
The type of the button, must inherit from and have a MenuItems property.
An array of to add to the button.
The type of the button, must inherit from and have an ItemClicked event.
The type of the button, must inherit from and have a MenuCollapse event.
The type of the button, must inherit from and have a MenuPopup event.
The type of the button, must inherit from .
The to set for the button.
The type of the button, must inherit from and have a Repeat property.
The type of the button, must inherit from and have a Shortcut property.
The to set for the button.
The type of the button, must inherit from .
The to set for the button text.
The type of the button, must inherit from .
The to set for the button.
The type of the button, must inherit from .