.net - Is it possible to set one side of Margin or Padding as to not override the default style? -


i've set default styles basic elements in wpf act default styles application, allows controls such buttons carry similar , feel without having adjust manually when defined, means needs changed once.

a snippet of resource dictionary looks follows:

<resourcedictionary     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">      <style targettype="button">         <setter property="margin" value="4"/>         <setter property="minwidth" value="75"/>         <setter property="padding" value="10,2"/>     </style>  </resourcedictionary> 

notice here i'm setting margin 4 sides. great provides gap between buttons without interface needing explicitly define it. want know how can single button, remove gap on 1 side without needing define "4" other sides allow butt against side of parent.

i don't want following deviates style (i.e. if change 4 5 in style need here):

<dockpanel>     <button dockpanel.dock="left" content="my button" margin="0,4,4,4" /> </dockpanel> 

i want set marginleft somehow , leave others default style defined.

note: have workaround use named style of "buttonleft" defined in resource dictionary no left margin.

i think workaround fine :) if want marginleft property should create own button , add property.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -