c# - Default TabItem Background Color -


i want set background color of tabitem header (tabitem.background) if content not set in tab. accomplish this, have brush property in viewmodel bound background property of tabitem. however, i'm not sure how get/create default tabitem background brush.

public brush tabitembrush {         {         return iscontentset ? defaulttabitembrush : brushes.lightskyblue;     } } 
<tabitem header="some header" background="{binding tabitembrush, mode=oneway}"> 

i defaulttabitembrush brush match other tabitems if theme changes tabitems still same.

is default brush available in systemcolors?

using c# / .net 3.5

i ended using solution in wpf, how current theme's button background?

then in code looks like:

public brush tabitembrush {         {         return iscontentset ?  (brush)uiutilities.getvaluefromstyle(typeof(tabitem), control.backgroundproperty) : brushes.lightskyblue;     } } 
<tabitem header="some header" background="{binding tabitembrush, mode=oneway}"> 

when iscontentset == true use default brush , when false other brush in case lightskyblue


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -