Skip to content

Add .NET MAUI views (compat and handlers) - #1678

Merged
mattleibow merged 80 commits into
developfrom
dev/dotnet-6.0
Jun 17, 2021
Merged

Add .NET MAUI views (compat and handlers)#1678
mattleibow merged 80 commits into
developfrom
dev/dotnet-6.0

Conversation

@mattleibow

@mattleibow mattleibow commented Mar 30, 2021

Copy link
Copy Markdown
Contributor

Description of Change

I just pushed the bits from this PR to the preview feed as 2.88.0-pr.1678.25.

Add the .NET Maui views into the repo:

  • Compatibility Renderers and Image Handlers
  • .NET Maui View Handlers
  • .NET Maui Image Source Services

Not Included

  • Support for running Mac Catalyst apps
  • SKGLView using the new handlers on iOS/Android (compatibility renderers will still work)
  • SKGLView on WinUI since we are needing an update to ANGLE to work with WinUI

Usage

There are 3 new NuGet packages:

  • SkiaSharp.Views.Maui.Core - the main implementation logic
  • SkiaSharp.Views.Maui.Controls - the XAML views
  • SkiaSharp.Views.Maui.Controls.Compatibility - the compatibility renderers and image handlers

Unless you are specifically using the compatibility renderers, you should be able to just use the SkiaSharp.Views.Maui.Controls NuGet package.

Just for the first merge, there are a few limitations listed above, and a requirement on using the UseSkiaSharpHandlers in the startup. If you need to add the compatibility renderers, the UseSkiaSharpCompatibilityRenderers is also needed. Order matters and the last one wins. For a hybrid approach, use compatibility first as this will register the compat views and image sources, but then overwrite the ones with the new handlers:

public void Configure(IAppHostBuilder appBuilder) =>
	appBuilder
		.UseSkiaSharpCompatibilityRenderers()
		.UseSkiaSharpHandlers()
		.UseMauiApp<App>();

@mattleibow
mattleibow changed the base branch from main to develop April 4, 2021 20:32
@mattleibow mattleibow mentioned this pull request May 4, 2021
4 tasks
@mattleibow mattleibow changed the title Update to install .NET 6.0 Add MAUI + .NET 6.0 Support May 18, 2021
@mattleibow
mattleibow marked this pull request as draft May 18, 2021 03:18
@mattleibow mattleibow changed the title Add MAUI + .NET 6.0 Support Add .NET MAUI views (compat and handlers) Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant