Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 80 commits into from
Jun 17, 2021
Merged

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

merged 80 commits into from
Jun 17, 2021

Conversation

mattleibow
Copy link
Contributor

@mattleibow mattleibow commented Mar 30, 2021

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
@mattleibow mattleibow marked this pull request as ready for review June 17, 2021 16:04
@mattleibow mattleibow merged commit 3265316 into develop Jun 17, 2021
@mattleibow mattleibow deleted the dev/dotnet-6.0 branch June 17, 2021 19:26
@mattleibow mattleibow added this to the v2.88.0 milestone May 22, 2022
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