Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.
Javier Suárez edited this page Oct 14, 2021 · 16 revisions

What is .NET MAUI Graphics Controls?

Is a .NET MAUI experimental library that offers drawn controls allowing to choose between Cupertino, Fluent and Material.

Wait, drawn controls, does this mean that .NET MAUI will stop using native controls?

No, these drawn controls would not replace the native controls. It will be an added option to .NET MAUI, so at any time you can choose whether to use a native control or a drawn control.

What controls will include this library support?

Currently there are the following controls:

  • Button (Cupertino, Fluent, Material)
  • CheckBox (Cupertino, Fluent, Material)
  • DatePicker (Cupertino, Fluent, Material)
  • Editor (Cupertino, Fluent, Material)
  • Entry (Cupertino, Fluent, Material)
  • ProgressBar (Cupertino, Fluent, Material)
  • RadioButton (Cupertino, Fluent, Material)
  • Slider (Cupertino, Fluent, Material)
  • Stepper (Cupertino, Fluent, Material)
  • Switch (Cupertino, Fluent, Material)
  • TimePicker (Cupertino, Fluent, Material)

It will also include:

  • ActivityIndicator (Cupertino, Fluent, Material)
  • Label
  • Image

When will it be available?

At the moment this library is experimental. Because of this we are distributing it as a NuGet package on a separate feed (aka nightly).

If you want to try it out, add the nightly feed to your NuGet sources or add a NuGet.config file like below and install the Microsoft.Maui.Graphics.Controls package.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="maui-graphics-controls-nightly" value="https://aka.ms/maui-graphics-controls-nightly/index.json" />
    <add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

How can I use the library in my .NET MAUI application?

After adding the Microsoft.Maui.Graphics.Controls package, modify the MauiProgram class to register the drawn control handlers:

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var appBuilder = MauiApp.CreateBuilder();

        appBuilder
            .UseMauiApp<App>()
            .ConfigureGraphicsControls());

        return appBuilder.Build();
    }
}

Will .NET MAUI Graphics Controls be part of .NET MAUI?

It could be, although at the moment it is an experimental library. The current objective is to obtain feedback about the interest and value that the library provides in order to decide whether this option is included or discarded in upcoming .NET versions.

Clone this wiki locally