Improvement

This commit is contained in:
Syntriax 2022-12-02 00:09:21 +03:00
parent ccb9666668
commit 8d5f9bd3c8
2 changed files with 6 additions and 8 deletions

View File

@ -14,11 +14,10 @@ namespace Syntriax.Modules.ToggleState
get => _isToggled;
set
{
bool oldValue = _isToggled;
if (value == _isToggled)
return;
_isToggled = value;
if (oldValue != value)
OnToggleStateChanged?.Invoke(value);
}
}

View File

@ -11,11 +11,10 @@ namespace Syntriax.Modules.ToggleState
get => _isToggled;
set
{
bool oldValue = _isToggled;
if (value == _isToggled)
return;
_isToggled = value;
if (oldValue != value)
OnToggleStateChanged?.Invoke(value);
}
}