I have a GridViewColumn where the IsVisible property is connected to a DynamicResource "ShowColumn". When I click on the Button, the value of the "ShowColumn" resource is negated. While the Content of the Button is updated, the IsVisible property of the column does not change.
How can I achieve that the column is hidden/shown when the resource value changes? The mechanism is part of a larger framework, that does not support direct binding to a ViewModel as the resources are dynamically created as needed and the values are inherited from higher levels.
<
Window.Resources
>
<
system:Boolean
x:Key
=
"ShowColumn"
>True</
system:Boolean
>
</
Window.Resources
>
<
DockPanel
>
<
Button
x:Name
=
"Button"
Content
=
"{DynamicResource ShowColumn}"
Click
=
"ShowHideClick"
/>
<
telerik:RadGridView
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Foo"
IsVisible
=
"{DynamicResource ShowColumn}"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
DockPanel
>