using System; namespace DesktopMagicPluginAPI.Inputs { /// /// Represents a button control. /// public class Button : Element { /// /// Occurs when the button gets clicked. /// public event Action OnClick; private string _value; /// /// Gets or sets the text caption displayed in the element. /// public string Value { get => _value; set { if (_value != value) { _value = value; ValueChanged(); } } } /// /// Initializes a new instance of the class with the provided . /// /// The text caption displayed in the control. public Button(string value) { Value = value; } /// /// Triggers the event. /// public void Click() { OnClick?.Invoke(); } } }