skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • Resources Hub
    • .NET MAUI Tutorials and Learning
    • First Steps
    • Submit a Ticket
    • FAQs

    Docs & Resources

    • Docs
    • Demos
    • Migrate to .NET MAUI
    • Forums
    • Videos
    • Blogs

    Productivity and Design Tools

    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class RadToggleButton

Represents a button that can be toggled.

Inheritance
System.Object
RadButtonBase
RadToggleButton
Inherited Members
RadButtonBase.IsPressedProperty
RadButtonBase.CommandProperty
RadButtonBase.CommandParameterProperty
RadButtonBase.StyleProperty
RadButtonBase.ControlTemplateProperty
RadButtonBase.BackgroundColorProperty
RadButtonBase.BackgroundProperty
RadButtonBase.PaddingProperty
RadButtonBase.BorderColorProperty
RadButtonBase.BorderBrushProperty
RadButtonBase.BorderThicknessProperty
RadButtonBase.CornerRadiusProperty
RadButtonBase.OnApplyTemplate()
RadButtonBase.OnPropertyChanged(String)
RadButtonBase.OnHandlerChanging(HandlerChangingEventArgs)
RadButtonBase.OnHandlerChanged()
RadButtonBase.IsPressed
RadButtonBase.Command
RadButtonBase.CommandParameter
RadButtonBase.Style
RadButtonBase.ControlTemplate
RadButtonBase.BackgroundColor
RadButtonBase.Background
RadButtonBase.Padding
RadButtonBase.BorderColor
RadButtonBase.BorderBrush
RadButtonBase.BorderThickness
RadButtonBase.CornerRadius
RadButtonBase.IsEnabledCore
RadButtonBase.Clicked
RadButtonBase.Pressed
RadButtonBase.Released
Namespace: Telerik.Maui.Controls
Assembly: Telerik.Maui.Controls.dll

Syntax

public class RadToggleButton : RadButtonBase, ITextContentButton, IContentButton, INotifyPropertyChanged

Constructors

RadToggleButton()

Initializes a new instance of the RadToggleButton class.

Declaration
public RadToggleButton()

Fields

ActualContentProperty

Identifies the ActualContent property.

Declaration
public static readonly BindableProperty ActualContentProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

ContentProperty

Identifies the Content property.

Declaration
public static readonly BindableProperty ContentProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

ContentTemplateProperty

Identifies the ContentTemplate property.

Declaration
public static readonly BindableProperty ContentTemplateProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

FontAttributesProperty

Identifies the FontAttributes property.

Declaration
public static readonly BindableProperty FontAttributesProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

FontFamilyProperty

Identifies the FontFamily property.

Declaration
public static readonly BindableProperty FontFamilyProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

FontSizeProperty

Identifies the FontSize property.

Declaration
public static readonly BindableProperty FontSizeProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

HorizontalTextAlignmentProperty

Identifies the HorizontalTextAlignment property.

Declaration
public static readonly BindableProperty HorizontalTextAlignmentProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

IsThreeStateProperty

Identifies the IsThreeState property.

Declaration
public static readonly BindableProperty IsThreeStateProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

IsToggledProperty

Identifies the IsToggled property.

Declaration
public static readonly BindableProperty IsToggledProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

TextColorProperty

Identifies the TextColor property.

Declaration
public static readonly BindableProperty TextColorProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

TextDecorationsProperty

Identifies the TextDecorations property.

Declaration
public static readonly BindableProperty TextDecorationsProperty
Field Value
Microsoft.Maui.Controls.BindableProperty

VerticalTextAlignmentProperty

Identifies the VerticalTextAlignment property.

Declaration
public static readonly BindableProperty VerticalTextAlignmentProperty
Field Value
Microsoft.Maui.Controls.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
public View ActualContent { get; }
Property Value
Microsoft.Maui.Controls.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
public object Content { get; set; }
Property Value
System.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
public DataTemplate ContentTemplate { get; set; }
Property Value
Microsoft.Maui.Controls.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 Microsoft.Maui.Controls.FontAttributes type.

Declaration
public FontAttributes FontAttributes { get; set; }
Property Value
Microsoft.Maui.Controls.FontAttributes

FontFamily

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

Declaration
public string FontFamily { get; set; }
Property Value
System.String

FontSize

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

Declaration
public double FontSize { get; set; }
Property Value
System.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 Microsoft.Maui.TextAlignment type.

Declaration
public TextAlignment HorizontalTextAlignment { get; set; }
Property Value
Microsoft.Maui.TextAlignment

IsThreeState

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

Declaration
public bool IsThreeState { get; set; }
Property Value
System.Boolean

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
public Nullable<bool> IsToggled { get; set; }
Property Value
System.Nullable<System.Boolean>

TextColor

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

Declaration
public Color TextColor { get; set; }
Property Value
Microsoft.Maui.Graphics.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 Microsoft.Maui.TextDecorations type.

Declaration
public TextDecorations TextDecorations { get; set; }
Property Value
Microsoft.Maui.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 Microsoft.Maui.TextAlignment type.

Declaration
public TextAlignment VerticalTextAlignment { get; set; }
Property Value
Microsoft.Maui.TextAlignment

Methods

ChangeVisualState()

Declaration
protected override void ChangeVisualState()
Overrides
RadButtonBase.ChangeVisualState()

Events

IsToggledChanged

Raised when the IsToggled property has changed.

Declaration
public event EventHandler<ValueChangedEventArgs<Nullable<bool>>> IsToggledChanged
Event Type
System.EventHandler<ValueChangedEventArgs<System.Nullable<System.Boolean>>>

Extension Methods

AndroidTypeConversionExtensions.ToJavaObject(Object)
Sample Applications
  • Controls Samples App
  • Crypto Tracker App
Support Resources
  • .NET MAUI SDKBrowser App
Community
  • Forums
  • Blogs
  • Feedback Portal
  • YouTube Channel

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.