Button

A tappable button.
public class Button : Control

Properties

Command

Command invoked on tap; its CanExecute drives the enabled state.

Type: ICommand?

public ICommand? Command { get; set; }

CommandParameter

The parameter passed to Command.

Type: object?

public object? CommandParameter { get; set; }

Icon

The local icon shown alongside the text, or null for none.

Type: Bindable<ImageSource?>

public Bindable<ImageSource?> Icon { get; set; }

IconPlacement

Where the icon sits relative to the text.

Type: IconPlacement

public IconPlacement IconPlacement { get; set; }

IconSize

The SF Symbol icon's point size, or NaN to match the size class. Other images keep their intrinsic size.

Type: double

public double IconSize { get; set; }

IconSpacing

Points between the icon (or spinner) and the text.

Type: double

public double IconSpacing { get; set; }

IsDestructive

Styles the button red, for destructive actions.

Type: bool

public bool IsDestructive { get; set; }

IsLoading

Shows a spinner in place of the icon while true. Bind it to a command's running state.

Type: Bindable<bool>

public Bindable<bool> IsLoading { get; set; }

Kind

The button's native style: plain, gray, tinted or filled.

Type: ButtonStyle

public ButtonStyle Kind { get; set; }

Menu entries shown on tap instead of invoking Command. Empty for a plain button.

Type: IList<MenuAction>

public IList<MenuAction> Menu { get; }

Padding

Padding around the content, or null for the size class default.

Type: Thickness?

public Thickness? Padding { get; set; }

SelectsFromMenu

When true the Menu acts as a popup picker: choosing an entry shows it as the button's title and fires its command.

Type: bool

public bool SelectsFromMenu { get; set; }

Size

The built-in size class.

Type: ButtonSize

public ButtonSize Size { get; set; }

Subtitle

Smaller text shown under the title, or null for none.

Type: Bindable<string?>

public Bindable<string?> Subtitle { get; set; }

Text

The button's title text.

Type: Bindable<string?>

public Bindable<string?> Text { get; set; }