Wpf treeview prevent selection on expander click -


i stuck on following problem:

i have custom treeviewitemstyle , when click on expander node selcted in addition expander expanding/collapsing. there way prevent selection on expanding/collapsing?

 <togglebutton x:name="expander" clickmode="press" ischecked="{binding isexpanded, mode=twoway, relativesource={relativesource templatedparent}}">               <togglebutton.style>                 <style targettype="{x:type togglebutton}">                   <setter property="focusable" value="false"/>                   <setter property="width" value="16"/>                   <setter property="height" value="16"/>                   <setter property="template">                     <setter.value>                       <controltemplate targettype="{x:type togglebutton}">                         <border background="transparent" height="16" padding="5" width="16">                           <path x:name="expandpath" data="m0,0l0,6 6,0z" fill="transparent" stroke="{dynamicresource blackbrush}">                             <path.rendertransform>                               <rotatetransform angle="135" centery="3" centerx="3"/>                             </path.rendertransform>                           </path>                         </border>                         <controltemplate.triggers>                           <trigger property="ischecked" value="true">                             <setter property="rendertransform" targetname="expandpath">                               <setter.value>                                 <rotatetransform angle="180" centery="3" centerx="3"/>                               </setter.value>                             </setter>                             <setter property="fill" targetname="expandpath" value="{dynamicresource blackbrush}"/>                             <setter property="stroke" targetname="expandpath" value="{dynamicresource blackbrush}"/>                           </trigger>                           <trigger property="ismouseover" value="true">                             <setter property="stroke" targetname="expandpath" value="darkgray"/>                             <setter property="fill" targetname="expandpath" value="darkgray"/>                           </trigger>                         </controltemplate.triggers>                       </controltemplate>                     </setter.value>                   </setter>                 </style>               </togglebutton.style>             </togglebutton> 

i have tried step previewmousedown event via eventsetter not able solution here either.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -