// Copyright (c) The Avalonia Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System; using System.Linq; using System.Windows.Input; 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. /// public class Button : ContentControl { /// /// 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