Skip to content

SKCanvasElement renders blank inside Hot Design and stays blank after exiting until app restart #140

Open

Description

@noknowscode

Current behavior

An app whose main surface is a custom SKCanvasElement subclass loses that surface when Hot Design is used:

  1. Inside Hot Design, the element's area renders blank in the device frame, in both the Design and Interactive tabs. All regular XAML on the same page (buttons, text, borders) renders normally.
  2. After exiting Hot Design, the element stays blank in the live app. The rest of the app keeps working: view model state updates, commands run, other XAML re-renders on state changes.
  3. Calling Invalidate() on the element (via app state changes that normally trigger a redraw) does not recover it. Forcing a window resize does not recover it either.
  4. The only recovery is restarting the app. Reproduced twice in a row on the same session.

No exception is thrown and nothing is written to the process output. The process stays alive.

Expected behavior

The SKCanvasElement continues rendering after Hot Design exits, and ideally renders inside the design surface as well (or shows a placeholder there).

How to reproduce it

  1. Create an Uno Platform app with a SKCanvasElement subclass that overrides RenderOverride and draws anything (the repro app draws a scheduling chart; the subclass only delegates to a renderer class and exposes Invalidate()). Host it as the Child of a Border on the main page.
  2. Run a Debug build on net10.0-desktop with the devserver connected, signed in to Uno Platform.
  3. Enter Hot Design from the Studio overlay flame button. Observe the element area is blank in the design surface while sibling XAML renders.
  4. Exit Hot Design. Observe the element area is still blank in the running app, and stays blank through invalidations and window resizes.

Environment

  • Uno.Sdk 6.5.36, Single Project, net10.0-desktop, Skia renderer
  • App pins SkiaSharpVersion 4.148.0 (may or may not be a factor)
  • DevServer 6.6.176, Uno Settings 1.7.6
  • .NET SDK 10.0.302, Windows 11 Pro 10.0.26200
  • Debug configuration, launched via dotnet run with the devserver port baked in at build time

Notes

  • The working hypothesis from the app side: SKCanvasElement draws directly onto the window canvas in RenderOverride, and the Hot Design re-host/restore of the visual tree appears to permanently sever that registration.
  • Screenshots of each stage (before, inside Hot Design Design tab, inside Interactive tab, after exit, after resize attempt) are available on request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions