xaml - Execute command on mouse click on image control wpf -
there command property in wpf trying execute on image click. changing style of scroller. downloaded sample styles here , after changing style end like:
ok let me explain. on top there arrow pointing upwards on top of image. plan rid of top arrow reason why need because in xaml has command when clicked scrolls upward. code arrow is:
<repeatbutton style="{staticresource scrollbarbutton}" margin="0,15,0,0" verticalalignment="top" background="#ffffffff" grid.row="0" command="{x:static scrollbar.lineupcommand}" <!-- line enables scroll upwards when clicked --> theme:scrollchrome.scrollglyph="uparrow" rendertransformorigin="0.5, 0.5"> <repeatbutton.rendertransform> <scaletransform scalex="4" scaley="2"/> </repeatbutton.rendertransform> </repeatbutton>
in short interested in following property:
command="{x:static scrollbar.lineupcommand}"
it nice if rid of top arrow , place command in image instead. problem image control not have property command. know can make alpha of top arrow equal 0 , make appear there image curios of understanding how work , add more functionality such changing image appearance on mouse enter etc..
create button control template having image , bind command of button. more on can found here: attach icommand in wpf usercontrol
Comments
Post a Comment