microsoft / microsoft-ui-xaml

WinUI: a modern UI framework with a rich set of controls and styles to build dynamic and high-performing Windows applications.
MIT License
6.37k stars 682 forks source link

Applying a template to `BreadcrumbItem` using style works differently then setting template directly #10141

Open xperiandri opened 2 weeks ago

xperiandri commented 2 weeks ago

Describe the bug

When a control template is applied to BreadcrumbBarItem using style WinUI cannot initialize it failing on finding deferred element by name, while it works fine if control template inlined or set using static resource.

Steps to reproduce the bug

Use reproduction project BreadcrumbTemplateRepro.zip Notice that if you extract the template and put it inline, project will run without any issues

Expected behavior

Template initialization works consistently in all cases: inline, static resource, within a style

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response