Articles in this section
Category / Section

How to create a .NET MAUI Switch (SfSwitch)?

1 min read

This article shows how to create a .NET MAUI Switch application.

Step 1: Install the Syncfusion.Maui.Buttons package and add the namespace for buttons.

XAML:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:buttons="clr-namespace:Syncfusion.Maui.Buttons;assembly=Syncfusion.Maui.Buttons"
             x:Class="Switch.MainPage">

Step 2: Initialize the .NET MAUI Switch in XAML.

XAML:

<syncfusion:SfSwitch />

C#

SfSwitch sfSwitch = new SfSwitch();
this.Content = sfSwitch;

Output:

Switch2024-02-0811-21-47online-video-cutter.com-ezgif.com-video-to-gif-converter.gif

Conclusion

Hope you enjoyed learning how to create a .NET MAUI Switch (SfSwitch).

Refer to our .NET MAUI Switch feature tour page to learn about its other groundbreaking feature representations. You can explore our .NET MAUI Switch documentation to understand how to present and manipulate data.

For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Switch(SfSwitch) and other .NET MAUI components.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied