Skip to content

ListDetailsView uses hardcoded string to find NavigationView #4127

@michael-hawker

Description

@michael-hawker

Describe the bug

In the past, we didn't have a hard dependency on WinUI. It looks like the ListDetailsView then does 'hacks' to look it up in the Visual Tree to do better integration with the back button.

We should instead, now that we have a dependency on WinUI, just use the strongly-typed FindAscendent method and clean this code up. I think other spots where it registers to events or things could also be simplified.

Steps to Reproduce

_navigationView = this.FindAscendants().FirstOrDefault(p => p.GetType().FullName == "Microsoft.UI.Xaml.Controls.NavigationView");

Expected behavior

Not use hard-coded strings to find things. 🙂

@XAML-Knight did you want to pick this one up?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions