Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brminnick/hellomauitoolkit
An iOS, Android, macOS + Windows app built using .NET MAUI, demonstrating how to use the .NET MAUI CommunityToolkit
https://github.com/brminnick/hellomauitoolkit
android catalyst csh dotnet ios maccatalyst macos maui net net6 windows winui
Last synced: about 1 month ago
JSON representation
An iOS, Android, macOS + Windows app built using .NET MAUI, demonstrating how to use the .NET MAUI CommunityToolkit
- Host: GitHub
- URL: https://github.com/brminnick/hellomauitoolkit
- Owner: brminnick
- License: mit
- Created: 2021-10-12T01:00:05.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-09T01:59:53.000Z (about 1 month ago)
- Last Synced: 2024-11-09T02:33:25.281Z (about 1 month ago)
- Topics: android, catalyst, csh, dotnet, ios, maccatalyst, macos, maui, net, net6, windows, winui
- Language: C#
- Homepage: https://github.com/communitytoolkit/maui
- Size: 176 KB
- Stars: 17
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[![.NET MAUI](https://github.com/brminnick/HelloMauiToolkit/actions/workflows/maui.yml/badge.svg)](https://github.com/brminnick/HelloMauiToolkit/actions/workflows/maui.yml)
# HelloMauiToolkit
The [.NET MAUI Community Toolkit](https://github.com/communitytoolkit/maui) 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`](https://github.com/CommunityToolkit/Maui/blob/202565a8ac06ae2df81123ebb87cce8c8ea673b9/src/CommunityToolkit.Maui/Converters/ColorToStringConverter.shared.cs#L25-L30).
#### 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:
```csharp
using CommunityToolkit.Maui;public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
// Initialise the toolkit
builder.UseMauiApp().UseMauiCommunityToolkit();// the rest of your logic...
}
}
```#### Add XAML Namespace
At the top of your XAML file, add the following `xmlns`
```xml
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
```#### Use `ColorToHexRgbStringConverter`
In your `Binding` assign `Converter={converters:ColorToHexRgbStringConverter}`:
```xml
Text="{Binding Source={x:Reference ClickMeButton}, Path=BackgroundColor, Converter={toolkit:ColorToHexRgbStringConverter}}
```