I have a WPF window without Titlebar and border. So I want change windows background based on it is active or not.
I writed code below but I got message Cannot implicitly convert type 'System.Drawing.Brush' to 'System.Windows.Media.Brush'
.
Can you help me how to do this? Thank you!
// This function used for both "Actived" and "Deactived" event
private void window_Activated(object sender, EventArgs e)
{
Background = (IsActive)? System.Drawing.SystemBrushes.ActiveCaption :
System.Drawing.SystemBrushes.InactiveCaption;
}
EDIT
Current my windows title bar have Lime color if it active, and gray if inactive, but other user may be diffrent. How can I get these color by code?