diff --git a/UI/GUI/UIEelements/Controls/Button.cs b/UI/GUI/UIEelements/Controls/Button.cs index 331cf0b..b2f1245 100644 --- a/UI/GUI/UIEelements/Controls/Button.cs +++ b/UI/GUI/UIEelements/Controls/Button.cs @@ -4,6 +4,8 @@ namespace RemSox.UI.GUI.UIEelements.Controls; public class Button() : Control("Button") { + public event EventHandler? OnClick; + public string Text { get; @@ -15,4 +17,9 @@ public class Button() : Control("Button") get; set => SetProperty(nameof(TextColor), ref field, value); } = Color.Black; + + public void Click() + { + OnClick?.Invoke(this, EventArgs.Empty); + } } \ No newline at end of file diff --git a/UI/GUI/UIEelements/Controls/CheckBox.cs b/UI/GUI/UIEelements/Controls/CheckBox.cs index f6539fb..d38fe5b 100644 --- a/UI/GUI/UIEelements/Controls/CheckBox.cs +++ b/UI/GUI/UIEelements/Controls/CheckBox.cs @@ -4,10 +4,16 @@ namespace RemSox.UI.GUI.UIEelements.Controls; public class CheckBox() : Control("CheckBox") { + public event EventHandler? OnCheckedChanged; + public bool IsChecked { get; - set => SetProperty(nameof(IsChecked), ref field, value); + set + { + SetProperty(nameof(IsChecked), ref field, value); + OnCheckedChanged?.Invoke(this, EventArgs.Empty); + } } = false; public string Text