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

AnimatedIcon Catastrophic Failure when Unloaded from Visual Tree #9278

Open
michael-hawker opened this issue Jan 23, 2024 · 2 comments
Open
Labels
area-AnimatedIcon bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team

Comments

@michael-hawker
Copy link
Collaborator

Describe the bug

Testing things in XAML Studio with the MUXC Expander control, however, when I refresh the view, I disconnect the children first with DisconnectChildrenRecursive. This is causing a crash (catastrophic failure error message), appearing to come from the AnimatedIcon used in the Expander togglebutton style.

Happening on line 35 here after call to VisualTreeHelper.DisconnectChildrenRecursive(...);

void AnimatedIcon::OnApplyTemplate()
{
__super::OnApplyTemplate();
// Construct the visual from the Source property in on apply template so that it participates
// in the initial measure for the object.
ConstructAndInsertVisual();
auto const panel = winrt::VisualTreeHelper::GetChild(*this, 0).as<winrt::Panel>();

Steps to reproduce the bug

  1. Add an Expander to a page.
  2. Call VisualTree.DisconnectChildrenRecursive on it.

Expected behavior

No crash, unloads cleanly.

Screenshots

No response

NuGet package version

None

Windows version

Windows 10 (21H2): Build 19044

Additional context

Using 2.7.3 can't upgrade to latest due to PRI issue #8959

@michael-hawker michael-hawker added the bug Something isn't working label Jan 23, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jan 23, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@michael-hawker
Copy link
Collaborator Author

If I just call panel.Children.Clear() things work as expected, but haven't seen similar problems explicitly calling the VisualTreeHelper before now.

@bpulliam bpulliam added team-CompInput Issue for IXP (Composition, Input) team area-AnimatedIcon and removed needs-triage Issue needs to be triaged by the area owners labels Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-AnimatedIcon bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team
Projects
None yet
Development

No branches or pull requests

2 participants