In my application I have a control whose background is set based on the user input, by the following code:
m_ToolBar.Background = (m_IToolbar.UseBackColor) ?
new SolidColorBrush(m_IToolbar.BackColor): m_DefaultWindowsBrush;
where m_IToolbar.UseBackColor is a boolean whether to update the color or not, if not then restore back to the default windows color which i have hardcoded in the initialise method.
Is there a way to get the default windows color other than hardcording( which has further problem if I change the windows theme color).
You can use the SystemColors Class. Specifically the SystemColors.ControlBrush Property
From above link: