KMC
KMC

Reputation: 20046

Toggle and grey out a StackPanel

I am trying to toggle a small StackPanel on top of a large StackPanel: when the small StackPanel is toggled and show visible, the large StackPanel on the back is grey out with a opacity color. Does anyone know how can I grey out a whole StackPanel?

Upvotes: 5

Views: 8802

Answers (3)

Amir Touitou
Amir Touitou

Reputation: 3451

Try this:

stackPanel.IsEnabled = false;

Upvotes: 1

mkabatek
mkabatek

Reputation: 1276

H.B.'s answer does not work on Windows Phone 8.1 A simple way to disable all children of a control is to wrap your controls inside a <ContentControl x:Name="MyControl"> Then you can apply MyControl.IsEnabled = false; See here.

Upvotes: 3

brunnerh
brunnerh

Reputation: 185578

You could try to disable the StackPanel (stackPanel.IsEnabled = false;), then all children of that StackPanel will also be disabled which normally takes the apprearance of greyed out controls.

Upvotes: 13

Related Questions