RadToggleButton
Represents a button that can be toggled.
Definition
Namespace:Telerik.Maui.Controls
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class RadToggleButton : RadButtonBase, INotifyPropertyChanged
Inheritance: objectRadButtonBaseRadToggleButton
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadToggleButton class.
public RadToggleButton()
Fields
ActualContentProperty
BindableProperty
Identifies the ActualContent property.
public static readonly BindableProperty ActualContentProperty
ContentProperty
BindableProperty
Identifies the Content property.
public static readonly BindableProperty ContentProperty
ContentTemplateProperty
BindableProperty
Identifies the ContentTemplate property.
public static readonly BindableProperty ContentTemplateProperty
FontAttributesProperty
BindableProperty
Identifies the FontAttributes property.
public static readonly BindableProperty FontAttributesProperty
FontFamilyProperty
BindableProperty
Identifies the FontFamily property.
public static readonly BindableProperty FontFamilyProperty
FontSizeProperty
BindableProperty
Identifies the FontSize property.
public static readonly BindableProperty FontSizeProperty
HorizontalTextAlignmentProperty
BindableProperty
Identifies the HorizontalTextAlignment property.
public static readonly BindableProperty HorizontalTextAlignmentProperty
IsThreeStateProperty
BindableProperty
Identifies the IsThreeState property.
public static readonly BindableProperty IsThreeStateProperty
IsToggledProperty
BindableProperty
Identifies the IsToggled property.
public static readonly BindableProperty IsToggledProperty
TextColorProperty
BindableProperty
Identifies the TextColor property.
public static readonly BindableProperty TextColorProperty
TextDecorationsProperty
BindableProperty
Identifies the TextDecorations property.
public static readonly BindableProperty TextDecorationsProperty
VerticalTextAlignmentProperty
BindableProperty
Identifies the VerticalTextAlignment property.
public static readonly BindableProperty VerticalTextAlignmentProperty
Properties
ActualContent
View
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.
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.
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.
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.
public FontAttributes FontAttributes { get; set; }
Gets or sets the font family of the Label created when Content is string and ContentTemplate is not set.
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.
[TypeConverter(typeof(FontSizeConverter))]
public double FontSize { get; set; }
HorizontalTextAlignment
TextAlignment
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.
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.
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.
public bool? IsToggled { get; set; }
TextColor
Color
Gets or sets the text color of the Label created when Content is string and ContentTemplate is not set.
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.
public TextDecorations TextDecorations { get; set; }
VerticalTextAlignment
TextAlignment
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.
public TextAlignment VerticalTextAlignment { get; set; }
Methods
protected override void ChangeVisualState()
Overrides:
Events
Raised when the IsToggled property has changed.
public event EventHandler<ValueChangedEventArgs<bool?>> IsToggledChanged