I have a complex object bound to a DevExpress grid, with a custom EditTemplate
<ControlTemplate x:Key="EditLine">
<StackPanel VerticalAlignment="Center">
<TextBox Text="{Binding RowData.Row.Value}"
Margin="2"
Visibility="{Binding RowData.Row.ParamType, Converter={StaticResource ValueTypeToVisibilityConverter}, ConverterParameter='TextBox'}" />
<CheckBox Visibility="{Binding RowData.Row.ParamType, Converter={StaticResource ValueTypeToVisibilityConverter}, ConverterParameter='CheckBox'}"
IsChecked="{Binding RowData.Row.Value}"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</StackPanel>
</ControlTemplate>
My complex object Value can be encrypted or not, so the object has a property IsEncrypted (which is Boolean). My first thought was to create a converter to decrypt value on display and encrypt it on save, and bind it only on another textbox which is shown only if the boolean is true.
However, making my encrypted textbox visiblity to collapsed doesn't prevents binding, and create some except preventing window to show up (I cannot modify the behavior of the crypting function because it's used many places in other applications and it has to throw exception)...
Because ConverterParameter cannot be bound, how can I achieve my goal ?