Let's say I have a button in the form that I want to turn off if some condition is met. Is there a way to check this condition inside the "IsEnabled" event handler and change the allowed state so that the activated state does not cause another call to the IsEnabled event handler a second time?
Let me demonstrate:
private void ExportResults_IsEnabledChanged (object sender, DependencyPropertyChangedEventArgs e)
{
if (some condition)
{
uxExportResults.IsEnabled = false;
}
}
Suppose I fire an event elsewhere (that I am).
source
share