// ----------------------------------------------------------------------- // // Copyright 2013 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex.Controls { using System; using System.Linq; using System.Windows.Input; using Perspex.Input; using Perspex.Interactivity; using Perspex.Rendering; using Perspex.VisualTree; public enum ClickMode { Release, Press, } public class Button : ContentControl { public static readonly PerspexProperty ClickModeProperty = PerspexProperty.Register("ClickMode"); public static readonly PerspexProperty CommandProperty = PerspexProperty.Register("Command"); public static readonly PerspexProperty CommandParameterProperty = PerspexProperty.Register("CommandParameter"); public static readonly PerspexProperty IsDefaultProperty = PerspexProperty.Register("IsDefault"); public static readonly RoutedEvent ClickEvent = RoutedEvent.Register("Click", RoutingStrategies.Bubble); static Button() { FocusableProperty.OverrideDefaultValue(typeof(Button), true); ClickEvent.AddClassHandler