New to Telerik UI for .NET MAUIStart a free 30-day trial

Represents a button that can be toggled.

Definition

Constructors

Initializes a new instance of the RadToggleButton class.

C#
public RadToggleButton()

Fields

ActualContentProperty

BindableProperty

Identifies the ActualContent property.

C#
public static readonly BindableProperty ActualContentProperty

ContentProperty

BindableProperty

Identifies the Content property.

C#
public static readonly BindableProperty ContentProperty

ContentTemplateProperty

BindableProperty

Identifies the ContentTemplate property.

C#
public static readonly BindableProperty ContentTemplateProperty

FontAttributesProperty

BindableProperty

Identifies the FontAttributes property.

C#
public static readonly BindableProperty FontAttributesProperty

FontFamilyProperty

BindableProperty

Identifies the FontFamily property.

C#
public static readonly BindableProperty FontFamilyProperty

FontSizeProperty

BindableProperty

Identifies the FontSize property.

C#
public static readonly BindableProperty FontSizeProperty

Identifies the HorizontalTextAlignment property.

C#
public static readonly BindableProperty HorizontalTextAlignmentProperty

IsThreeStateProperty

BindableProperty

Identifies the IsThreeState property.

C#
public static readonly BindableProperty IsThreeStateProperty

IsToggledProperty

BindableProperty

Identifies the IsToggled property.

C#
public static readonly BindableProperty IsToggledProperty

TextColorProperty

BindableProperty

Identifies the TextColor property.

C#
public static readonly BindableProperty TextColorProperty

TextDecorationsProperty

BindableProperty

Identifies the TextDecorations property.

C#
public static readonly BindableProperty TextDecorationsProperty

Identifies the VerticalTextAlignment property.

C#
public static readonly BindableProperty VerticalTextAlignmentProperty

Properties

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.

C#
public View ActualContent { get; }

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.

C#
public object Content { get; set; }

ContentTemplate

DataTemplate

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.

C#
public DataTemplate ContentTemplate { get; set; }

FontAttributes

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.

C#
public FontAttributes FontAttributes { get; set; }

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

C#
public string FontFamily { get; set; }

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

C#
[TypeConverter(typeof(FontSizeConverter))]
public double FontSize { get; set; }

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.

C#
public TextAlignment HorizontalTextAlignment { get; set; }

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

C#
public bool IsThreeState { get; set; }

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.

C#
public bool? IsToggled { get; set; }

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

C#
public Color TextColor { get; set; }

TextDecorations

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.

C#
public TextDecorations TextDecorations { get; set; }

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.

C#
public TextAlignment VerticalTextAlignment { get; set; }

Methods

C#
protected override void ChangeVisualState()

Overrides: RadButtonBase.ChangeVisualState()

Events

Raised when the IsToggled property has changed.

C#
public event EventHandler<ValueChangedEventArgs<bool?>> IsToggledChanged