wpf - Button style does not apply to button in disabled state -


i have defined default button style in app.xaml:

<style targettype="button">     <setter property="margin" value="4"></setter>     <setter property="horizontalalignment" value="stretch"/> </style> 

i see margin not work when button in disabled state.

disabled state handled binding listbox.selecteditem property.

<button click="buttonopen_click" content="connect">                     <button.style>                         <style>                             <style.triggers>                                 <datatrigger binding ="{binding elementname=listboxaddress, path=selectedindex}" value="-1">                                     <setter property="button.isenabled" value="false"/>                                 </datatrigger>                             </style.triggers>                         </style>                     </button.style>                  </button>             <button>close</button> 

i guess <button.style> resets have set in app.xaml.

how can fix it?


Comments

Popular posts from this blog

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -