From b56e58418ebb264301f172bbdf51272081e1ec44 Mon Sep 17 00:00:00 2001 From: Avishai Dernis Date: Wed, 7 Jan 2026 09:40:36 +0200 Subject: [PATCH 1/2] Added x:Name and x:Key info to breadcrumb info --- XamlStudio/Views/Document.xaml.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/XamlStudio/Views/Document.xaml.cs b/XamlStudio/Views/Document.xaml.cs index 156a096..3429cab 100644 --- a/XamlStudio/Views/Document.xaml.cs +++ b/XamlStudio/Views/Document.xaml.cs @@ -643,11 +643,25 @@ private async Task UpdateBreadcrumbs() { if (node is IXmlElementSyntax element) { - var loc = text.GetLineColumnIndex(node.Span.Start); + var (line, column) = text.GetLineColumnIndex(node.Span.Start); + var xName = element.GetAttributeValue("Name", "x"); + var xKey = element.GetAttributeValue("Key", "x"); + + // Construct a display name using the element type, x:Name, and x:Key + string displayName = element.Name; + if (xName is not null) + { + displayName = $"{xName} ({element.Name})"; + } + else if (xKey is not null) + { + displayName = $"{xKey} ({element.Name})"; + } + Breadcrumbs.Insert(0, new BreadcrumbInfo() { - Name = element.Name, - Location = new Position((uint)loc.Line, (uint)loc.Column), + Name = displayName, + Location = new Position((uint)line, (uint)column), // TODO: Put child sister nodes in a list so that can have drop-down to navigate within document? }); } From 93d3ada4a0b2179a6938438bf2e434201d3e650d Mon Sep 17 00:00:00 2001 From: "Michael Hawker MSFT (XAML Llama)" <24302614+michael-hawker@users.noreply.github.com> Date: Wed, 25 Feb 2026 15:41:18 -0800 Subject: [PATCH 2/2] Apply suggestion from @michael-hawker --- XamlStudio/Views/Document.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XamlStudio/Views/Document.xaml.cs b/XamlStudio/Views/Document.xaml.cs index 3429cab..fdbddf0 100644 --- a/XamlStudio/Views/Document.xaml.cs +++ b/XamlStudio/Views/Document.xaml.cs @@ -651,11 +651,11 @@ private async Task UpdateBreadcrumbs() string displayName = element.Name; if (xName is not null) { - displayName = $"{xName} ({element.Name})"; + displayName = $"{xName} [{element.Name}]"; } else if (xKey is not null) { - displayName = $"{xKey} ({element.Name})"; + displayName = $"{xKey} [{element.Name}]"; } Breadcrumbs.Insert(0, new BreadcrumbInfo()