diff --git a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/TreePageViewModel.cs b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/TreePageViewModel.cs index 3416158feeb..1eed2ff00bc 100644 --- a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/TreePageViewModel.cs +++ b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/TreePageViewModel.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using Avalonia.Controls; using Avalonia.VisualTree; @@ -206,8 +205,9 @@ private static string GetVisualSelector(Visual visual) var classes = string.Concat(visual.Classes .Where(c => !c.StartsWith(":")) .Select(c => '.' + c)); + var pseudo = string.Concat(visual.Classes.Where(c => c[0] == ':').Select(c => c)); var type = StyledElement.GetStyleKey(visual); - return $$"""{{{type.Assembly.FullName}};{{type.Namespace}}.}{{type.Name}}{{name}}{{classes}}"""; + return $$"""{{{type.Assembly.FullName}};{{type.Namespace}}|}{{type.Name}}{{name}}{{classes}}{{pseudo}}"""; } private void ExpandNode(TreeNode? node)