I've got a UserControl which has an opacity of 0. At that state it shouldn't be clickable. How to disable/re-enable it?
A:
Set HitTestVisible to false.
Like below this.IsHitTestVisible = false;
HTH
Avatar
2010-09-23 17:29:38
+5
A:
Opacity doesn't disable hit testing.
You disable hit testing several ways:
- The most obvious, set IsHitTestVisible=false on your UserControl
- Change visibility to hidden instead of Opacity=0
- Change Visibility to collapsed (NOTE: This will change the layout semantics, collapsed will NOT consume screen real estate so it is actually different behaviorally then Opacity=0)
Foovanadil
2010-09-23 17:30:05