wpf - Setting Window background color using resource -


i need use resource set color of main window in wpf application. since resource declaration comes after window declaration (i importing resource dictionary), can't use background property in window object. so, thought set background way:

<window.resources> ... </window.resources>  <window.background>     <solidcolorbrush color="{staticresource windowbackgroundbrush}"  /> </window.background> 

my syntax bit off, since object won't take brush resource color property. what's fix? help.

try this

<window.background>     <staticresource resourcekey="windowbackgroundbrush" /> </window.background> 

Comments

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -