I’m trying to cancel property changes under certain conditions using OnIsSwitchChanging with ObservableProperty in .NET MAUI. However, I’m not entirely sure how to achieve this. I appreciate any help or guidance on this matter!
[ObservableProperty]
private bool isSwitch;
partial void OnIsSwitchChanging(bool oldValue, bool newValue)
{
if (someConditions)
{
//Cancel change operation
}
}