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

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -