MaxWillmott
MaxWillmott

Reputation: 2220

GroupBox visibility in a Template XAML

<GroupBox Header="{Binding Path=FilterGroupName}" 
         Height ="Auto" 
         IsEnabled="{Binding IsSelected}" 
         IsVisible="{Binding Selected}" />

I get an error message saying that the visibility is readonly, in this case how to toggle the visibility?

Upvotes: 1

Views: 1285

Answers (1)

thumbmunkeys
thumbmunkeys

Reputation: 20764

You have to bind to the Visibility property to change the visibility of a control.

In your case the variable that you bind to is a bool, so you need a converter that changes the bool to a Visibility type variable

Upvotes: 1

Related Questions