C
C#2y ago
Ossie

[WPF] Creating grouped content in XAML to hide.

Hi, Is it possible to group multiple UI elements into a group, and then hide the entire group, while also being able to access each individual elemt of the group. This is just pseudocode of what I wish to achieve:
<Group Name="Group1">
<Element1 Name="Ele1">
<Element1 Name="Ele1">
<Element1 Name="Ele1">
</Group>
<Group Name="Group1">
<Element1 Name="Ele1">
<Element1 Name="Ele1">
<Element1 Name="Ele1">
</Group>
Then from C# I can do something like
Group1.Visibility = Visibility.Hidden;

// or

Ele1.Text = "Whatever";
Group1.Visibility = Visibility.Hidden;

// or

Ele1.Text = "Whatever";
Hope this is possible, so I don't have to hide each element individually. Thanks
2 Replies
Kouhai
Kouhai2y ago
Use a Grid?
Ossie
OssieOP2y ago
thanks lol

Did you find this page helpful?