Skip to content

An iOS, Android, macOS + Windows app built using .NET MAUI, demonstrating how to use the .NET MAUI CommunityToolkit

License

Notifications You must be signed in to change notification settings

brminnick/HelloMauiToolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET MAUI

HelloMauiToolkit

The .NET MAUI Community Toolkit is a collection of common elements for development with .NET MAUI that developers tend to replicate across multiple apps. It simplifies and demonstrates common developer tasks when building apps with .NET MAUI.

.NET MAUI Community Toolkit: Converters

This specific example uses the ColorToHexRgbStringConverter.

Add UseMauiCommunityToolkit()

In order to use the .NET MAUI Community Toolkit you need to call the extension method in your MauiProgram.cs file as follows:

using CommunityToolkit.Maui;

public static class MauiProgram
{
	public static MauiApp CreateMauiApp()
	{
		var builder = MauiApp.CreateBuilder();
		
		// Initialise the toolkit
		builder.UseMauiApp<App>().UseMauiCommunityToolkit();

		// the rest of your logic...
	}
}

Add XAML Namespace

At the top of your XAML file, add the following xmlns

xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"

Use ColorToHexRgbStringConverter

In your Binding assign Converter={converters:ColorToHexRgbStringConverter}:

Text="{Binding Source={x:Reference ClickMeButton}, Path=BackgroundColor, Converter={toolkit:ColorToHexRgbStringConverter}}

About

An iOS, Android, macOS + Windows app built using .NET MAUI, demonstrating how to use the .NET MAUI CommunityToolkit

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages