2

Given this for a single button:

<Button xml:space="preserve">  Send  </Button>

How does one set this for all buttons as a Style?

<Style TargetType="{x:Type Button}">
  <Style.Setters>
    <Setter Property="Background" Value="LightGray"/>
  </Style.Setters>
</Style>
bhs67
  • 29
  • 4
  • 3
    Seems like it would be more trouble to remember to add the whitespace to every instance than it would be to just add a margin of like 5,0 to the ContentPresenter in the button template so it adds a uniform consistent spacing everytime without extra effort wouldn't it? – Chris W. Feb 17 '14 at 19:29
  • @bhs67 - I don't think it can be set in default style? Why not to wrap all buttons in panel and set the value on panel and let child controls inherit it from there? – Rohit Vats Feb 17 '14 at 19:35
  • -1 down vote accept There are quite a few buttons located on tabs, etc. They are different sizes. All heights are the same, have different widths, have different margins around the buttons. The xml:space="preserve" works well ... but is cumbersome to add to every button. – bhs67 Feb 18 '14 at 13:35

0 Answers0