Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Edited Issue: Bug in DescriptorPropertyDefinition, value binding ignores culture [21909]

$
0
0
As a result of this discussion (see https://wpftoolkit.codeplex.com/discussions/639720), I did some debugging and I found the bug:

The DescriptorPropertyDefinition class which creates the binding to the value, does ignore the culture settings. Therefore the implicit converters which are used when a DataTemplate is set, it uses the default culture setting.

This is how I fixed it:

```
protected override BindingBase CreateValueBinding()
{
//Bind the value property with the source object.
var binding = new Binding( PropertyDescriptor.Name )
{
Source = SelectedObject,
Mode = PropertyDescriptor.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay,
ValidatesOnDataErrors = true,
ValidatesOnExceptions = true,
//when I set the converterCulture like this, its working.
ConverterCulture = System.Globalization.CultureInfo.CurrentCulture
};

return binding;
}
```

Maybe it's worth including it in the next release?

regards

Andreas
Comments: ** Comment from web user: BoucherS **


Hi,

This will be fixed in v2.8.

Thanks for looking into it !


Viewing all articles
Browse latest Browse all 4964


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>