In my view I have a Grid with a number of columns. I would like to hide/show one column and resize the others based on an ObservableProperty in the view model.
I have tried to bind to the Width of the ColumnDefinition and use a converter to convert the boolean to a GridLength. But no matter how I try, my breakpoint in the converter is not hit.
Is it simply not possible? a bug? or have I just not found the correct syntax yet?
My latest attempt looks like this:
<ColumnDefinition Width="{Binding ShowColorColumn, Converter={StaticResource converters:BoolToGridLengthConverter}, ConverterParameter='80|0'}" />
You can bind the ColumnDefinitions with ColumnDefinitionCollection, and add several ColumnDefinition object into it. like:
code bdehind: