Skip to content

Remove need for RemoveFromVisualTree #898

@benstevens48

Description

@benstevens48

It would be a lot easier to use CanvasControl etc if it wasn't necessary to call RemoveFromVisualTree after we no longer need it. Actually, #801 ensures we don't need to call it if all event handlers are removed. But we can do better by using the built-in APIs for reference tracking that WinUI makes use of. Some time ago, I created a WinUI issue to suggest separatng this logic out, maybe making it part of WIL, so it can be reused elsewhere e.g. in Win2D. See microsoft/microsoft-ui-xaml#3720. With this, we could get rid of RemoveFromVisualTree entirely, but if we wanted to retain it for backwards compatibility, we would still need to implement #801 (for a full discussion of why that pull request is a good idea, see #799).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions