0

I want to use the default style of buttons and just want to add a Grid and Stackpanel with 2-3 Bindings. When i add the ControlTemplate in my Style all Trigger-, Border-, ...settings are overwritten. How can i just add my Grid/Stackpanel/Bindings while using the rest of the default settings?

<Style x:Key="listbutton">
        <Setter Property="Button.Height" Value="40"/>
        <Setter Property="Button.Margin" Value="0,3"/>
        <Setter Property="Button.Template">
            <Setter.Value>
                <ControlTemplate>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
</Style>

sibe94
  • 135
  • 1
  • 3
  • 10
  • You should consider using a DataTemplate instead of a ControlTemplate. See also [ControlTemplate vs. DataTemplate](http://stackoverflow.com/a/1340138/2712726) – Patrick Fromberg Nov 24 '16 at 22:58

1 Answers1

0

The purpose of a ControlTemplate is to define how a Control must be displayed. You can't have a ControlTemplate based on another ControlTemplate (it wouldn't make sense). What you can do is take the default ControlTemplate and modify it at your will.

The default ControlTemplate for Button can be found here

nkoniishvt
  • 2,442
  • 1
  • 14
  • 29