I have a datagrid whose columns I would like to set the MaxWidth property of through binding. I have a converter to change ‘binding’ to ‘double’, but the converter never gets hit, the app stops on a xaml error: ‘System.Windows.Data.Binding’ cannot be converted to type ‘System.Double’. When I use the converter on other properties outside of the datagrid MaxWidth property then it works fine. Why does this not work?
<Grid.Resources>
<Converter:DoubleConverter x:Key="ConverterForDoubles" />
</Grid.Resources>
<data:DataGridTextColumn Header="Task ID" Binding="{Binding TaskId}"
MaxWidth="{Binding Source={StaticResource MainViewModel}, Path=TaskIdColumnMaxWidth,
Mode=TwoWay, Converter={StaticResource ConverterForDoubles}}" />
Found this to help with binding to setters: Setting Value Binding Helper