diff --git a/ILSpy.Tests/Metadata/MetadataColumnBuilderTests.cs b/ILSpy.Tests/Metadata/MetadataColumnBuilderTests.cs index 6dd88f103..838603d35 100644 --- a/ILSpy.Tests/Metadata/MetadataColumnBuilderTests.cs +++ b/ILSpy.Tests/Metadata/MetadataColumnBuilderTests.cs @@ -20,6 +20,9 @@ using System.Linq; using Avalonia.Controls; using Avalonia.Headless.NUnit; +using Avalonia.Media; +using Avalonia.Threading; +using Avalonia.VisualTree; using AwesomeAssertions; @@ -128,4 +131,33 @@ public class MetadataColumnBuilderTests columns[1].Should().BeOfType("Method is Kind=Token"); columns[2].Should().BeOfType("Name has no [ColumnInfo]"); } + + [AvaloniaTest] + public void Token_Cell_Link_Color_Comes_From_The_Theme_And_Yields_To_The_Selected_Row() + { + // Foreground is inherited, so a local brush on the button would outrank the + // DataGridRow:selected white override and leave the link unreadable on the accent fill -- + // which is exactly the row navigation lands on. The "link" class lets the row win while + // still carrying the themed colour everywhere else. + var grid = new DataGrid { AutoGenerateColumns = false }; + foreach (var column in MetadataColumnBuilder.For()) + grid.Columns.Add(column); + grid.ItemsSource = new[] { new SampleEntryWithToken { RID = 1, Method = 0x06000001 } }; + + var window = new Window { Content = grid, Width = 400, Height = 200 }; + window.Show(); + Dispatcher.UIThread.RunJobs(); + + var link = grid.GetVisualDescendants().OfType