mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 00:56:19 +02:00
Add click event to Button and checked changed event to CheckBox
This commit is contained in:
@@ -4,6 +4,8 @@ namespace RemSox.UI.GUI.UIEelements.Controls;
|
|||||||
|
|
||||||
public class Button() : Control("Button")
|
public class Button() : Control("Button")
|
||||||
{
|
{
|
||||||
|
public event EventHandler? OnClick;
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
@@ -15,4 +17,9 @@ public class Button() : Control("Button")
|
|||||||
get;
|
get;
|
||||||
set => SetProperty(nameof(TextColor), ref field, value);
|
set => SetProperty(nameof(TextColor), ref field, value);
|
||||||
} = Color.Black;
|
} = Color.Black;
|
||||||
|
|
||||||
|
public void Click()
|
||||||
|
{
|
||||||
|
OnClick?.Invoke(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,10 +4,16 @@ namespace RemSox.UI.GUI.UIEelements.Controls;
|
|||||||
|
|
||||||
public class CheckBox() : Control("CheckBox")
|
public class CheckBox() : Control("CheckBox")
|
||||||
{
|
{
|
||||||
|
public event EventHandler? OnCheckedChanged;
|
||||||
|
|
||||||
public bool IsChecked
|
public bool IsChecked
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
set => SetProperty(nameof(IsChecked), ref field, value);
|
set
|
||||||
|
{
|
||||||
|
SetProperty(nameof(IsChecked), ref field, value);
|
||||||
|
OnCheckedChanged?.Invoke(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
} = false;
|
} = false;
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
|
|||||||
Reference in New Issue
Block a user