I just found an ugly solution:
grid1.SetResourceReference(
Control.BackgroundProperty,
SystemColors.DesktopBrushKey);
I hope someone will post a better one (I'd like to see something like grid1.Background = BackgroundBrush, because the syntax of SetResourceReference is a step backwards from Windows Forms).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…