Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to logically group controls in WPF

Tags:

wpf

Here's the scenario

I have a Grid with some TextBlock controls, each in a separate cell in the grid. Logically I want to be able to set the Visibility on them bound to a property in my ViewModel. But since they're each in a separate cell in the grid, I have to set each TextBlock's Visibility property.

Is there a way of having a non-visual group on which I can set common properties of its children? Or am I dreaming?

like image 308
Craig Shearer Avatar asked Dec 03 '08 01:12

Craig Shearer


1 Answers

There is no non-visual group that would make this possible.

Setting the Visibility properties, directly or in a common Style shared by all of the TextBlocks, is probably the simplest solution.

like image 112
Ed Ball Avatar answered Oct 18 '22 15:10

Ed Ball