using System; using System.Linq; using System.Windows.Input; using Avalonia.Controls.Metadata; using Avalonia.Controls.Primitives; using Avalonia.Data; using Avalonia.Input; using Avalonia.Interactivity; using Avalonia.LogicalTree; using Avalonia.VisualTree; namespace Avalonia.Controls { /// /// Defines how a reacts to clicks. /// public enum ClickMode { /// /// The event is raised when the pointer is released. /// Release, /// /// The event is raised when the pointer is pressed. /// Press, } /// /// A button control. /// [PseudoClasses(":pressed")] public class Button : ContentControl, ICommandSource { /// /// Defines the property. /// public static readonly StyledProperty ClickModeProperty = AvaloniaProperty.Register(nameof(ClickMode)); /// /// Defines the property. /// public static readonly DirectProperty CommandProperty = AvaloniaProperty.RegisterDirect(nameof(Command), button => button.Command, (button, command) => button.Command = command, enableDataValidation: true); /// /// Defines the property. /// public static readonly StyledProperty HotKeyProperty = HotKeyManager.HotKeyProperty.AddOwner