Skip to content

ResourceDictionary Controls trigger runtime error with embedded CanvasControl from Microsoft.Graphics.Win2D #10541

@StevoSM

Description

@StevoSM

Describe the bug

Adding Microsoft.Graphics.Win2D to a Project and embedding a CanvasControl in a Window or even UserControl works great. However, when embedding a CanvasControl in a ResourceDictionary control, it results in a runtime error, which isn't consistent.

The attached solution demonstrates the issue. It is configured to show a CanvasControl in all 3 scenarios.

Win2DSandbox.zip

Steps to reproduce the bug

Open provided solution and ensure packages are installed.
Build and run. See crash happen.

Expected behavior

No crash

Screenshots

No response

NuGet package version

None

Windows version

Windows 10 (21H2): Build 19044

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions