Introducing the new .NET MAUI Button Control
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (172).NET Core  (29).NET MAUI  (186)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (209)BoldSign  (12)DocIO  (24)Essential JS 2  (106)Essential Studio  (199)File Formats  (63)Flutter  (129)JavaScript  (218)Microsoft  (118)PDF  (80)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (871)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (49)Windows Forms  (61)WinUI  (68)WPF  (155)Xamarin  (160)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (145)Chart  (123)Cloud  (14)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (62)Development  (608)Doc  (7)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (37)Extensions  (22)File Manager  (6)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (479)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (39)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (29)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (361)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (30)Visual Studio Code  (17)Web  (572)What's new  (311)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Introducing the new .NET MAUI Button Control

Introducing the new .NET MAUI Button Control

Get ready to revolutionize your .NET MAUI applications with the all-new Syncfusion .NET MAUI Button control, unveiled in our latest release, 2023 Volume 3. It isn’t just a button; it’s a powerhouse of customization. With features that allow you to set icons, background images, and corner edge radii, you can create a button that truly represents your brand. Plus, you can tailor the appearance for different visual states with the Visual State Manager.

Let’s explore the key features of this groundbreaking .NET MAUI Button control and the steps to get started with it.

Key features

The .NET MAUI Button control supports many user-friendly features. Some of them are:

Image support

Incorporating images into your mobile app’s buttons can greatly enhance their visual appeal. The .NET MAUI Button control supports image integration, allowing you to create a sophisticated appearance that aligns perfectly with your app’s style.

ShowIcon

With the ShowIcon property, you can easily enable or disable the display of an icon image within the Button control. This provides flexibility in choosing when to show or hide the associated image.

ImageSource

The ImageSource property allows you to customize the Button icon image by adding a custom image, giving you complete control over the visual representation.

ImageSize and ImageAlignment

You can fine-tune the width and alignment of the icon image using the ImageSize and ImageAlignment properties, respectively. You can position the icon at the button’s start, end, top, bottom, left, or right positions, providing extensive design possibilities.

Customizing the Image Icon Position in the .NET MAUI Button
Customizing the Image Icon Position in the .NET MAUI Button Control
Customizing the Image Icon Position in the .NET MAUI Button Control

Background image support

The .NET MAUI Button control allows you to customize the background using the BackgroundImageSource property.

Adding a Background Image in the .NET MAUI Button Control
Adding a Background Image in the .NET MAUI Button Control

Custom content

With the .NET MAUI Button control, you can use any custom views as templates, enabling you to create buttons with unique and complex content.

Customizing Content in .NET MAUI Button Control
Customizing Content in .NET MAUI Button Control

Font customizations

Tailor the font style and appearance to your specific needs with the FontSize, FontFamily, FontAttributes, and TextColor properties. Whether you require pixel precision or standard options like small, medium, or large fonts, the choice is yours.

Font Customizations in .NET MAUI Button Control
Font Customizations in .NET MAUI Button Control

Border customizations

Buttons often need distinctive borders to stand out. The .NET MAUI Button control also supports customizing its various border elements.

Border color

The border color of the Button can easily be customized to any desired color.

Customizing Border Color in .NET MAUI Button Control
Customizing Border Color in .NET MAUI Button Control

Border thickness

Control the thickness of the Button’s border, allowing for variations in visual style. If a border is not needed, you can remove it altogether.

Customizing Border Width in .NET MAUI Button Control
Customizing Border Width in .NET MAUI Button Control

Corner radius

Create buttons with rounded edges by customizing the corner radii, adding a touch of elegance to your app’s design.

Customizing Corner Radii in .NET MAUI Button Control
Customizing Corner Radii in .NET MAUI Button Control

UI customizations

The .NET MAUI Button control offers various visual styles to cater to your app’s specific needs. Let’s see them.

Primary buttons

A primary button is the default button style with an accent color as the background.

.NET MAUI Primary Button
.NET MAUI Primary Button

Normal buttons

A normal button is a button with a traditional look and appearance.

.NET MAUI Normal Button
.NET MAUI Normal Button

Flat buttons

For a sleek and minimalistic design, you can customize the .NET MAUI Button control to be devoid of border or background color. This allows for a clean, uncluttered aesthetic that focuses on functionality.

.NET MAUI Flat Button
.NET MAUI Flat Button

Outline buttons

You can create a unique and crisp appearance for the Button by defining an outline with a border while opting for no background color.

.NET MAUI Outline Button
.NET MAUI Outline Button

Icon buttons

The .NET MAUI Button control empowers users to add icons and captions to it.

.NET MAUI Icon Button
.NET MAUI Icon Button

Circular buttons

You can craft a unique style by defining the shape of a button with rounded edges and incorporating font icons. This customization offers a distinctive and appealing aesthetic to your user interface.

.NET MAUI Circular Button
.NET MAUI Circular Button

Note: For more details, refer to the .NET MAUI Button documentation.

Getting started with the .NET MAUI Button control

We have seen the key features of the .NET MAUI Button control. Now let’s learn how to integrate it into your .NET MAUI app and utilize its features:

Step 1: Create a .NET MAUI app

First, create a .NET MAUI application.

Step 2: Add the required NuGet package

Syncfusion .NET MAUI controls are available on the NuGet Gallery. To add the .NET MAUI Button control to your project, open the NuGet package manager in Visual Studio. Search for Syncfusion.Maui.Buttons and then install it.

Step 3: Register the handler

Register the handler for the Syncfusion core in the MauiProgram.cs file.

using Microsoft.Maui;
using Microsoft.Maui.Hosting;
using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Hosting;
using Microsoft.Maui.Controls.Xaml;
using Syncfusion.Maui.Core.Hosting;
namespace ButtonSample
{
  public static class MauiProgram
  {
	public static MauiApp CreateMauiApp()
	{
	   var builder = MauiApp.CreateBuilder();
	   builder
	      .UseMauiApp<App>()
	      .ConfigureSyncfusionCore()
	      .ConfigureFonts(fonts =>
	      {
	         fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
	      });
	   return builder.Build();
        }
   }
}

Step 4: Add the namespace

Add the Syncfusion.Maui.Buttons namespace in your XAML page.

xmlns:buttons="clr-namespace:Syncfusion.Maui.Buttons;assembly=Syncfusion.Maui.Buttons"

Step 5: Initialize the Syncfusion .NET MAUI Button control

Finally, initialize the Syncfusion .NET MAUI Button control. Refer to the following code example.

<buttons:SfButton x:Name="button" WidthRequest="100" Text = "Click me" TextColor ="White"/>

After executing these code examples, we’ll get a button control like the following image.

Integrating the Button Control in the .NET MAUI Application
Integrating the Button Control in the .NET MAUI Application

GitHub references

For more details, refer to the .NET MAUI Button Control demo on GitHub.

Conclusion

Thanks for reading! In this blog, we’ve explored the features of the new Syncfusion .NET MAUI Button control that rolled out in the 2023 Volume 3 release. You can learn more about the latest .NET MAUI advancements on our Release Notes and What’s New pages. Try them out and leave your feedback in the comments section below!

Download Essential Studio for .NET MAUI to start evaluating them immediately.

If you have any questions, you can also contact us through our support forumsupport portal, or feedback portal. We are always happy to help you!

Test Flight
App Center Badge
Google Play Store Badge
Microsoft Badge
Github Store Badge

Related blogs

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed
Scroll To Top