Class
RadToggleButton

Represents a button that can be toggled.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class RadToggleButton : RadButtonBase, INotifyPropertyChanged

Inheritance: objectRadButtonBaseRadToggleButton

Implements: INotifyPropertyChanged

Inherited Members RadButtonBase.IsPressedPropertyRadButtonBase.CommandPropertyRadButtonBase.CommandParameterPropertyRadButtonBase.StylePropertyRadButtonBase.ControlTemplatePropertyRadButtonBase.BackgroundColorPropertyRadButtonBase.BackgroundPropertyRadButtonBase.PaddingPropertyRadButtonBase.BorderColorPropertyRadButtonBase.BorderBrushPropertyRadButtonBase.BorderThicknessPropertyRadButtonBase.CornerRadiusPropertyRadButtonBase.OnApplyTemplate()RadButtonBase.OnPropertyChanged(string)RadButtonBase.OnHandlerChanging(HandlerChangingEventArgs)RadButtonBase.OnHandlerChanged()RadButtonBase.IsPressedRadButtonBase.CommandRadButtonBase.CommandParameterRadButtonBase.StyleRadButtonBase.ControlTemplateRadButtonBase.BackgroundColorRadButtonBase.BackgroundRadButtonBase.PaddingRadButtonBase.BorderColorRadButtonBase.BorderBrushRadButtonBase.BorderThicknessRadButtonBase.CornerRadiusRadButtonBase.IsEnabledCoreRadButtonBase.ClickedRadButtonBase.PressedRadButtonBase.Released

Constructors

RadToggleButton()

Initializes a new instance of the RadToggleButton class.

Declaration

cs-api-definition
public RadToggleButton()

Fields

ActualContentProperty

Identifies the ActualContent property.

Declaration

cs-api-definition
public static readonly BindableProperty ActualContentProperty

Field Value

BindableProperty

ContentProperty

Identifies the Content property.

Declaration

cs-api-definition
public static readonly BindableProperty ContentProperty

Field Value

BindableProperty

ContentTemplateProperty

Identifies the ContentTemplate property.

Declaration

cs-api-definition
public static readonly BindableProperty ContentTemplateProperty

Field Value

BindableProperty

FontAttributesProperty

Identifies the FontAttributes property.

Declaration

cs-api-definition
public static readonly BindableProperty FontAttributesProperty

Field Value

BindableProperty

FontFamilyProperty

Identifies the FontFamily property.

Declaration

cs-api-definition
public static readonly BindableProperty FontFamilyProperty

Field Value

BindableProperty

FontSizeProperty

Identifies the FontSize property.

Declaration

cs-api-definition
public static readonly BindableProperty FontSizeProperty

Field Value

BindableProperty

HorizontalTextAlignmentProperty

Identifies the HorizontalTextAlignment property.

Declaration

cs-api-definition
public static readonly BindableProperty HorizontalTextAlignmentProperty

Field Value

BindableProperty

IsThreeStateProperty

Identifies the IsThreeState property.

Declaration

cs-api-definition
public static readonly BindableProperty IsThreeStateProperty

Field Value

BindableProperty

IsToggledProperty

Identifies the IsToggled property.

Declaration

cs-api-definition
public static readonly BindableProperty IsToggledProperty

Field Value

BindableProperty

TextColorProperty

Identifies the TextColor property.

Declaration

cs-api-definition
public static readonly BindableProperty TextColorProperty

Field Value

BindableProperty

TextDecorationsProperty

Identifies the TextDecorations property.

Declaration

cs-api-definition
public static readonly BindableProperty TextDecorationsProperty

Field Value

BindableProperty

VerticalTextAlignmentProperty

Identifies the VerticalTextAlignment property.

Declaration

cs-api-definition
public static readonly BindableProperty VerticalTextAlignmentProperty

Field Value

BindableProperty

Properties

ActualContent

Gets the actual presented content. If Content is set and ContentTemplate is set, returns a View created from the ContentTemplate.CreateView(), having Content as its BindingContext. If Content is set to a string and no ContentTemplate is set, returns a default Label which Text is set to Content. />. If Content is set to a View and no ContentTemplate is set, returns the View. If Content is set to a data object and no ContentTemplate, returns a default Label which Text is set to the ToString() representation of the data object.

Declaration

cs-api-definition
public View ActualContent { get; }

Property Value

View

Content

If Content is set and ContentTemplate is set, the View returned from the ContentTemplate.CreateView() will be displayed inside the ControlTemplate, having Content as its BindingContext. If Content is set to a string and no ContentTemplate is set, it will be converted to Label which Text is set to the Content inside the ControlTemplate. If Content is set to a View and no ContentTemplate is set, the View will be displayed inside the ControlTemplate. If Content is set to a data object and no ContentTemplate is set, the ToString() of the data object will be used and converted to Label inside the ControlTemplate.

Declaration

cs-api-definition
public object Content { get; set; }

Property Value

object

ContentTemplate

If ContentTemplate is set, the View returned from the ContentTemplate.CreateView() will be displayed inside the ControlTemplate, having Content as its BindingContext. If ContentTemplate is DataTemplateSelector, first the DataTemplate will be selected and then a View will be created from the chosen template using Content as its BindingContext.

Declaration

cs-api-definition
public DataTemplate ContentTemplate { get; set; }

Property Value

DataTemplate

FontAttributes

Gets or sets the font attributes of the Label created when Content is string and ContentTemplate is not set. For more information see the FontAttributes type.

Declaration

cs-api-definition
public FontAttributes FontAttributes { get; set; }

Property Value

FontAttributes

FontFamily

Gets or sets the font family of the Label created when Content is string and ContentTemplate is not set.

Declaration

cs-api-definition
public string FontFamily { get; set; }

Property Value

string

FontSize

Gets or sets the font size in pixels of the Label created when Content is string and ContentTemplate is not set.

Declaration

cs-api-definition
[TypeConverter(typeof(FontSizeConverter))]
public double FontSize { get; set; }

Property Value

double

HorizontalTextAlignment

Gets or sets the horizontal alignment of the Label created when Content is string and ContentTemplate is not set. For more information see the TextAlignment type.

Declaration

cs-api-definition
public TextAlignment HorizontalTextAlignment { get; set; }

Property Value

TextAlignment

IsThreeState

Gets or sets a boolean value indicating whether the IsToggled can be set to null. The default value is false.

Declaration

cs-api-definition
public bool IsThreeState { get; set; }

Property Value

bool

IsToggled

Gets or sets a value indicating whether the button is toggled or untoggled. If IsThreeState is set to true, this value also indicates if the button is in null/indeterminate state.

Declaration

cs-api-definition
public bool? IsToggled { get; set; }

Property Value

bool?

TextColor

Gets or sets the text color of the Label created when Content is string and ContentTemplate is not set.

Declaration

cs-api-definition
public Color TextColor { get; set; }

Property Value

Color

TextDecorations

Gets or sets the text decorations of the Label created when Content is string and ContentTemplate is not set. For more information see the TextDecorations type.

Declaration

cs-api-definition
public TextDecorations TextDecorations { get; set; }

Property Value

TextDecorations

VerticalTextAlignment

Gets or sets the vertical alignment of the Label created when Content is string and ContentTemplate is not set. For more information see the TextAlignment type.

Declaration

cs-api-definition
public TextAlignment VerticalTextAlignment { get; set; }

Property Value

TextAlignment

Methods

ChangeVisualState()

Declaration

cs-api-definition
protected override void ChangeVisualState()

Overrides RadButtonBase.ChangeVisualState()

Events

IsToggledChanged

Raised when the IsToggled property has changed.

Declaration

cs-api-definition
public event EventHandler<ValueChangedEventArgs<bool?>> IsToggledChanged

Event Value

EventHandler<ValueChangedEventArgs<bool?>>