wpf - Apply styles to a UserControl from within its own Xaml -


is there way apply styles (specifically style data triggers) usercontrol within it's own xaml code?

you cannot access style in xaml within usercontrol's resources - have few options tho:

  1. set in coding in constructor through style = findresource(<name>) style
  2. set in parent control <local:myusercontrol style="{staticresource mystyle}"
  3. put style in visual control's resources-property 'up-the-chain' empty key , targettype="{x:type myusercontrol}"

hope helps.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -