//win32API
[System.Runtime.InteropServices.DllImport("dwmapi.dll", PreserveSig =false)]
public static extern void DwmGetColorizationColor(out int pcrColorization, out bool pfOpaqueBlend);
DwmGetColorizationColor(out int pcrColorization, out _);
var color = GetColor(pcrColorization);
var brush = new SolidColorBrush(color);
XGrid.Background = brush;
private static System.Windows.Media.Color GetColor(int argb)=> new System.Windows.Media.Color(){
A =(byte)(argb >>24),
R =(byte)(argb >>16),
G =(byte)(argb >>8),
B =(byte)(argb)};