123456789101112131415161718 |
- using System.ComponentModel;
- namespace CustomControls
- {
- [DesignTimeVisible(false)]
- public partial class Button : ButtonBase
- {
- // Note regarding style and template:
- // <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"> <-- use the base class here
- // <ControlTemplate TargetType="{x:Type local:ButtonBase}"> <-- use this class here
- // this way the control will be able to calculate its size correctly (cases: toolbars, autosize buttons)
- public Button()
- {
- InitializeComponent();
- }
- }
- }
|