This section provides a quick overview for working with the SfColorPicker for .NET MAUI. Walk through the entire process of creating a real world of this control.
Start by creating a .NET MAUI project.
Syncfusion .NET MAUI components are available on the NuGet Gallery. To add the SfColorPicker to your project, open the NuGet package manager in Visual Studio. Search for for Syncfusion.Maui.Inputs NuGet package and then install it.
Register the handler for the Syncfusion Core package in the MauiProgram.cs file.
using Syncfusion.Maui.Core.Hosting;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.ConfigureSyncfusionCore()
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
return builder.Build();
}
}
Add the Syncfusion.Maui.Inputs namespace in your XAML page.
XAML
xmlns:inputs="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui. Inputs "
Now, initialize the Syncfusion .NET MAUI Color Picker control. Refer to the following example code.
XAML
<inputs:SfColorPicker x:Name="colorPicker" />
C#
SfColorPicker colorPicker = new SfColorPicker();
Content = colorPicker;
Run the application to render the following output: