mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-05 07:46:15 +02:00
Plugin development QoL improvements
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DesktopMagicPluginAPI.Inputs
|
||||
{
|
||||
public class Button : Element
|
||||
{
|
||||
public event Action OnClick;
|
||||
|
||||
private string _value;
|
||||
|
||||
public string Value
|
||||
{
|
||||
get => _value;
|
||||
set
|
||||
{
|
||||
if (_value != value)
|
||||
{
|
||||
_value = value;
|
||||
ValueChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Button(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public void Click()
|
||||
{
|
||||
OnClick?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user