Skip to content

FreakyButton

Gulam Ali H edited this page Jul 16, 2023 · 2 revisions

The FreakyButton class is a custom button control designed for .NET Maui applications. It extends the functionality of the standard button control by providing additional customization options and visual enhancements.

  <freakyControls:FreakyButton
            Animation="FadeAndScale"
            BackgroundColor="{StaticResource Primary}"
            BorderColor="Black"
            BusyColor="White"
            HorizontalTextAlignment="Center"
            IconSize="30"
            LineBreakMode="CharacterWrap"
            Text="Edged icon trailing with fade and scale"
            TextColor="White"
            VerticalTextAlignment="Center">
            <freakyControls:FreakyButton.TrailingIcon>
                <Image Source="calendar.png" />
            </freakyControls:FreakyButton.TrailingIcon>
  </freakyControls:FreakyButton>

Overview

The FreakyButton class represents a custom button control that inherits from the ContentView class. It introduces additional properties and methods to customize the button's appearance and behavior.

Properties

The FreakyButton class exposes several bindable properties that allow you to customize its behavior and appearance. Here are some of the important properties:

ActivityIndicatorSize: Gets or sets the size of the activity indicator that appears when the button is in the busy state.

Animation: Gets or sets the animation type to apply when the button is pressed.

AreIconsDistant: Gets or sets a value indicating whether the leading and trailing icons should be displayed with extra spacing.

BackgroundColor: Gets or sets the background color of the button.

BorderColor: Gets or sets the color of the button's border.

BorderWidth: Gets or sets the width of the button's border.

BusyColor: Gets or sets the color of the activity indicator when the button is in the busy state.

CharacterSpacing: Gets or sets the spacing between characters in the button's text.

Command: Gets or sets the command to execute when the button is clicked.

CommandParameter: Gets or sets the parameter to pass to the command when the button is clicked.

CornerRadius: Gets or sets the radius of the button's corners.

FontAttributes: Gets or sets the font attributes of the button's text.

FontAutoScalingEnabled: Gets or sets a value indicating whether the button's text should automatically scale based on its size.

FontFamily: Gets or sets the font family for the button's text.

FontSize: Gets or sets the font size of the button's text.

HorizontalTextAlignment: Gets or sets the horizontal alignment of the button's text.

IconSize: Gets or sets the size of the leading and trailing icons.

IsBusy: Gets or sets a value indicating whether the button is in the busy state.

IsEnabled: Gets or sets a value indicating whether the button is enabled.

LeadingIcon: Gets or sets the view to display as the leading icon of the button.

LineBreakMode: Gets or sets the line break mode for the button's text.

Padding: Gets or sets the padding around the button's content.

Spacing: Gets or sets the spacing between the button's elements.

Text: Gets or sets the text to display on the button.

TextColor: Gets or sets the color of the button's text.

TextDecorations: Gets or sets the text decorations for the button's text.

TextTransform: Gets or sets the text transformation for the button's text.

TextType: Gets or sets the type of the button's text.

TrailingIcon: Gets or sets the view to display as the trailing icon of the button.

VerticalTextAlignment: Gets or sets the vertical alignment of the button's text.

Events

The FreakyButton class defines the following event:

Clicked: Occurs when the button is clicked or tapped.

Clone this wiki locally