MaterialButton
December 26, 2023 ยท View on GitHub
Buttons allow users to take actions, and make choices, with a single tap.
View Material Design documentation
Screenshot
Example
<material3:MaterialButton
Text="Download"
LeadingIcon="download.png"
Command="{Binding DownloadCommand}"
CommandParameter="Saved"
IsBusy="{Binding DownloadCommand.IsRunning}" />
Documentation
Property ButtonType:
Allowed values
- Elevated
- Filled (Default)
- Tonal
- Outlined
- Text
Property Command:
This property is to set the command to the button.
Property CommandParameter:
This property is to set the command parameter to the button.
Property HeadlineFontFamily:
This property is to set the headline text font family.
Property IsEnabled:
This property is to set if the button is enabled or disabled.
Property Animation:
This property is to set the animation when the button is tapped.
Allowed values
- None
- Fade (Default)
- Scale
- Custom
Property AnimationParameter:
This property is to customize the animation when the button is tapped.
Property ButtonCustomAnimation:
This property is to set a custom animation when the button is tapped.
Property Text:
This property is to set the text of the button.
Property TextColor:
This property is to set the color of the button text.
Property DisabledTextColor:
This property is to set the disabled color of the button text.
Property BackgroundColor:
This property is to set the background color of the button.
Property DisabledBackgroundColor:
This property is to set the disabled background color of the button.
Property FontSize:
This property is to set the font size of the button text.
Property FontFamily:
This property is to set the font family of the button text.
Property IsTextUnderlined:
This property is to set the underlined style to the button text. It only works with the ButtonType Text.
Property ToUpper:
This property is to make the text uppercase or lowercase, the default is false.
Property CornerRadius:
This property is to set the corner radius of the button.
Property BorderColor:
This property is to set the border color of the button.
Property DisabledBorderColor:
This property is to set the disabled border color of the button.
Property BusyColor:
This property is to set the color of the busy indicator.
Property IsBusy:
This property is to show a busy indicator in the button when a command is running.
Property LeadingIcon:
This property is to set the leading icon with support for PNG, JPG or JPEG.
Property CustomLeadingIcon:
This property is to set the leading icon with support for view, you can use SVG, font icon, PNG, JPG or JPEG.
Property TrailingIcon:
This property is to set the trailing icon with support for PNG, JPG or JPEG.
Property CustomTrailingIcon:
This property is to set the trailing icon with support for view, you can use SVG, font icon, PNG, JPG or JPEG.
Property IconSize:
This property is to set the sizes to the trailing and leading icons.
Property CustomActivityIndicator:
This property is to set a view with a custom busy indicator.
Property ActivityIndicatorSize:
This property is to set the size to the busy indicator.
Property Padding:
This property is to set the padding of the button.
Property Spacing:
This property is to set the spacing of the stack that contains the button icons and button text.
Property ContentIsExpanded:
This property is to set if the content of the button is expanded, default is false