public void PerformClick()
{
// Do we toggle the checked state when clicked>
if (CheckOnClick)
{
// Grab current state from command or ourself
CheckState state = (KryptonCommand == null ? CheckState : KryptonCommand.CheckState);
// Find new state
switch (state)
{
case CheckState.Unchecked:
state = CheckState.Checked;
break;
case CheckState.Indeterminate:
case CheckState.Checked:
state = CheckState.Unchecked;
break;
}
// Update correct property
if (KryptonCommand != null)
KryptonCommand.CheckState = state;
else
CheckState = state;
}
OnClick(EventArgs.Empty);
// If we have an attached command then execute it
if (KryptonCommand != null)
KryptonCommand.PerformExecute();
}