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
Post a Comment