Skip to content
New issue

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

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

Already on GitHub? # to your account

Update Blazor component to handle dotnet 9 rendermodes #4816

Closed
wants to merge 6 commits into from

Conversation

xela-trawets
Copy link

added checks to only create the Skia view when running in the browser

   private SKCanvasView? SKView { get; set; } = OperatingSystem.IsBrowser() ? new() : null;
   public override void Refresh()
   {
       SKView?.Invalidate();
   }

and

 @if (OperatingSystem.IsBrowser())
 {
     <SKCanvasView @ref="SKView"
                   style="width:inherit; height:inherit;"
                   OnPaintSurface="OnPaintSurface"
                   IgnorePixelScaling="true"
                   EnableRenderLoop="EnableRenderLoop"
                   @onpointerdown="OnPointerPressed"
                   @onpointermove="OnPointerMoved"
                   @onpointerup="OnPointerReleased"
                   @onwheel="OnPointerWheelChanged"
                   @onkeydown="OnKeyDown"
                   @onkeyup="OnKeyUp" />
 }

@xela-trawets
Copy link
Author

Prerender is the default in mixed rendermode blazor

Screenshot 2025-02-24 174606

Screenshot 2025-02-24 174638

@xela-trawets
Copy link
Author

The test fails due to "multiple SkiaSharp versions found"
This is intentional, I only touched the Blazor control.
I did try updating all the projects to SkiaSharp 3.116.1.
Didnt test that, it seems a big step.

Alex

@xela-trawets
Copy link
Author

I would only take the blazor bits, the global skia version involved changes in heatmap.cs and SKGLElement.cs that were just me trying to pass the tests. (I will figure out the details later)..

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant