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++ - Convert big endian to little endian when reading from a binary file -

openssl - Load PKCS#8 binary key into Ruby -