diff --git a/ImGui.Forms/Controls/CheckBox.cs b/ImGui.Forms/Controls/CheckBox.cs index d905712..0415cde 100644 --- a/ImGui.Forms/Controls/CheckBox.cs +++ b/ImGui.Forms/Controls/CheckBox.cs @@ -10,11 +10,21 @@ namespace ImGui.Forms.Controls { public class CheckBox : Component { + private bool _checked; + public LocalizedString Text { get; set; } public LocalizedString Tooltip { get; set; } - public bool Checked { get; set; } + public bool Checked + { + get=> _checked; + set + { + _checked = value; + OnCheckChanged(); + } + } #region Events @@ -42,10 +52,7 @@ protected override void UpdateInternal(Rectangle contentRect) ImGuiNET.ImGui.SetTooltip(Tooltip); if (ImGuiNET.ImGui.Checkbox(Text, ref check) && Enabled) - { Checked = check; - OnCheckChanged(); - } RemoveStyles(enabled); } diff --git a/ImGui.Forms/ImGui.Forms.nuspec b/ImGui.Forms/ImGui.Forms.nuspec index 0cd043e..3b2b542 100644 --- a/ImGui.Forms/ImGui.Forms.nuspec +++ b/ImGui.Forms/ImGui.Forms.nuspec @@ -2,7 +2,7 @@ Imgui.Forms - 1.0.49 + 1.0.50 A WinForms-inspired object-oriented framework around Dear ImGui (https://github.com/ocornut/imgui) onepiecefreak