Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions XamlStudio/Views/Document.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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?
});
}
Expand Down