Experimental Microsoft.Maui.Graphics.Controls - Build drawn controls (Cupertino, Fluent and Material)
Перейти к файлу
Javier Suárez d1fbdc7c3d
Merge pull request #65 from jfversluis/update-pre9
Fix build pipeline and update dependencies
2021-10-13 10:58:40 +02:00
data Added benckmark samples 2021-01-03 17:57:04 +01:00
eng Eliminate warning and nuget to right location 2021-10-12 14:27:04 +02:00
images Updated README 2021-01-21 19:43:07 +01:00
src Bad merge 2021-10-13 10:26:05 +02:00
.gitattributes Added gitignore 2020-12-20 18:31:57 +01:00
.gitignore Update pipeline 2021-10-12 14:16:52 +02:00
CODE_OF_CONDUCT.md Link to correct CoC 2021-02-19 15:42:18 -08:00
Directory.Build.props Add pipeline 2021-05-03 19:11:26 +01:00
Directory.Build.targets Add pipeline 2021-05-03 19:11:26 +01:00
GitInfo.txt Update GitInfo.txt 2021-10-12 15:05:22 +02:00
LICENSE Added License 2021-02-01 09:51:04 +01:00
Microsoft.Maui.Graphics.Controls.MultiTargeting.targets Update Microsoft.Maui.Graphics.Controls.MultiTargeting.targets 2021-10-13 10:06:40 +02:00
NuGet.config New solution architecture using .NET MAUI 2021-04-23 19:24:20 +02:00
README.md Update README.md 2021-10-12 15:43:15 +02:00
STATUS.md Merge pull request #15 from dotnet/datepicker 2021-03-09 10:35:55 +01:00
THIRD-PARTY-NOTICES.txt Added Third party notices 2021-02-01 09:52:00 +01:00
global.json New solution architecture using .NET MAUI 2021-04-23 19:24:20 +02:00

README.md

Microsoft.Maui.Graphics.Controls

Build Status

Nightly Feed: https://aka.ms/maui-graphics-controls-nightly/index.json

Microsoft.Maui.Graphics.Controls is a .NET MAUI experiment that offers drawn controls allowing to choose between Cupertino, Fluent and Material.

NOTE: Are you interested in having more information? You have a detailed video!.

Microsoft.Maui.Graphics

This project is using Microsoft.Maui.Graphics. Microsoft.Maui.Graphics is a cross-platform graphics library for iOS, Android, Windows, macOS and Linux completely in C#. With this library you can use a common API to target multiple abstractions allowing you to share your drawing code between platforms, or mix and match graphics implentations within a singular application.

What controls are available?

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)

The controls have the same properties and events as those existing in Xamarin.Forms.

Features

The main features are:

Drawn controls

The controls are drawn getting a pixel perfect option to adjust in the same way on all the platforms.

Easy to extend

Do you want to extend a drawn control? Create your own control class, inherit from the drawn control and override the Draw method.

public class CustomControl : GraphicsView
{
    public override void Draw(ICanvas canvas, RectangleF dirtyRect)
    {
        base.Draw(canvas, dirtyRect);
    }
}

On the other hand, if you want to modify how a specific layer of an existing control is drawn, you just have to overwrite the method that draws the layer.

public class CustomSlider : Slider
{
    protected override void DrawSliderThumb(ICanvas canvas, RectangleF dirtyRect)
    {
        base.DrawSliderThumb(canvas, dirtyRect);
    }
}

Also can add new layers, delete existing layers or reorganize the priority when drawing the layers.

Dark Theme support

All controls, in the different visual modes (Cupertino, Fluent and Material) supports both light and dark theme.

RTL support (Work in progress)

All controls support RTL.

Mobile & Desktop support

Accesibility support

Building an accessible application ensures that the application is usable by people who approach the user interface with a range of needs and experiences. GraphicsControls will allow to set AutomationProperties, which in turn set native accessibility values.

(Work in progress)

Performance

Some native controls are complex. For example, Entry using Visual Material is made up of different elements. When using it, each of the different elements must be instantiated (the text box, the placeholder text, etc.). Using the drawn control, create an instance of a Canvas and draw the content. The time required to instantiate etc is shorter.

Goals

  • Have pixel-perfect drawn controls working on all the .NET MAUI supported platforms.
  • High performance and customization options controls.

Contributing

As an experimental project, there are several active areas of development and we're looking for your feedback to help set the direction for this project. Please check it out and let us know any feedback you have on the project by logging issues in this repo.

Thank you!

Code released under the MIT license.