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

Force ShapeHandler to exist when adding shape to border #18076

Closed

Conversation

drasticactions
Copy link
Contributor

@drasticactions drasticactions commented Oct 17, 2023

Description of Change

TL;DR: If a border has an attached Shape and the shape handler is null, fire a ToHandler or ToPlatform to force it to exist. This will then let the underlying APIs that assume the handler to exist to work.

When Shapes are added as part of another item (Ex. Border), the handlers are never fired. The shapes themselves do exist and in .NET 8, with our recent changes to LogicalChildren, they now (correctly) appear as underlying elements. But because the handlers are null, any tooling that touches them will explode. Handlers should, as far as I can tell, always exist on a given element after they are created. These shapes are created, but the handlers are never attached.

This PR attempts to force that to happen. Whenever the border gets created, if a shape is attached as is null, it will force it to exist. This should fix Visual Diagnostic tooling and others who depend on it.

Issues Fixed

Fixes #18070
Fixes #16919

Fixes #

@Eilon Eilon added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Oct 17, 2023
@samhouts samhouts added this to the Under Consideration milestone Oct 18, 2023
@PureWeen PureWeen modified the milestones: Under Consideration, .NET 8 SR2 Nov 2, 2023
@chabiss chabiss modified the milestones: Under Consideration, .NET 8 SR1 Nov 2, 2023
@PureWeen PureWeen closed this Nov 4, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing
Projects
None yet
5 participants