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

Created Unassigned: Bug in DescriptorPropertyDefinition, DataTemplate 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

Viewing all articles
Browse latest Browse all 4964

Trending Articles



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