wpf - In Template, can I make a trigger change Path.Fill when Path is a ContentPresenter? -
i have button template, contentpresenter path.
on mouseover, want change path.fill.
see template:
<style x:key="spinbuttonstyle" targettype="{x:type repeatbutton}"> <setter property="template"> <setter.value> <controltemplate targettype="{x:type repeatbutton}"> <border x:name="bd" borderthickness="0" background="transparent" cornerradius="2"> <contentpresenter horizontalalignment="stretch" verticalalignment="stretch" /> </border> <controltemplate.triggers> <trigger property="ismouseover" value="true"> <setter property="background" targetname="bd" value="#666666"/> <setter property="control.foreground" value="#999999"/> </trigger> </controltemplate.triggers> </controltemplate> </setter.value> </setter> </style> and code uses template:
<repeatbutton style="{staticresource spinbuttonstyle}"> <path blah blah blah/> </repeatbutton> now, in case, contentpresenter path. there way change path.fill color in xaml?
all need bind path fill property repeatbutton foreground property:
fill="{binding path=foreground, relativesource={relativesource ancestortype={x:type repeatbutton}}}"
Comments
Post a Comment