wpf - Styling Inner Elements in XAML Style -


i have code

<hyperlinkbutton style="{staticresource hyperlink-navi-container}">       <hyperlinkbutton.content>              <textblock text="sample text"></textblock>       </hyperlinkbutton.content> </hyperlinkbutton> 

and style

<style x:key="hyperlink-navi-container" targettype="hyperlinkbutton">     <setter property="height" value="50"></setter>     <setter property="background">         <setter.value>             <lineargradientbrush startpoint="1, 0.5" endpoint="1, 2">                 <gradientstop color="white" offset="0.75"></gradientstop>                 <gradientstop color="gray"></gradientstop>             </lineargradientbrush>         </setter.value>     </setter>     <setter property="margin" value="2,2,2,0"></setter>     <setter property="foreground" value="orange"></setter>  </style> 

now question how style properties of textblock or other elements inside hyperlinkbutton in css

hyperlinkbutton.* {   background : red; } 

tia

you need resolve background property using binding

add textblock:

{binding path=background, relativesource={relativesource ancestortype={x:type hyperlinkbutton}}} 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -