views:

568

answers:

1

Hi,

How can I create a mask to cover ALL the elements of a Windows/Canvas (with subcanvas/elements inside)?

Thanks in advance

EDIT: I want to add more controls/elements/whatever after I create the mask. Is that ok? How?

A: 

Hi,

I am not sure you have to "mask" controls. Why don't you use the visibility property ?

For example, if you have a stackPanel and want to mask it and its content, just put

<StackPanel Visibility="Hidden">
...
</StackPanel>

By this way, you can control the visibility of each widget. If you want to "add" or make others visible, just set the Property to "Visible".

rockeye
What if I want to hide only a half of it? (E.g.: for a sliding animation)
ozke
Maybe you should use other widget such as Expander, or tabs. An ugly solution would be to use a rectangle to mask your widgets, but I am convinced, even without knowing your program, that there is a smarter way to do this.Firstly, it is a bit strange to mask UI elements... If you add widget, they must be visible, otherwise don't use them!Secondly, to perform sliding animation, you can use common element like stack, grid or canvas and apply a animation to them between 2 states (visible -> hidden)
rockeye