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

Commented Issue: Bug: PropertyGrid.Update not working since 1.9 [19322]

$
0
0
This error is new in the 1.9 release.

If the ```SelectedObject``` is modified outside the PropertyGrid or due to properties with side effects, the displayed properties cannot be refreshed anymore via ```PropertyGrid.Update()```. The getter of the properties is not called anymore. I just had a quick look into the changes from 1.8 to 1.9, but these are significant. I assume this due to the new inner proxy objects.

The ```BindingOperations.GetBindingExpressionBase(prop, PropertyItem.ValueProperty).UpdateTarget();``` call does not work anymore. By the way: if you use ```UpdateSource()``` instead of ```UpdateTarget``` it still overwrites the actual ```SelectedObject```'s property (setter is called with the editor's value).

__Additional feature request while fixing the issue__
It would be nice if ```Update()``` worked recursively so that extended properties are also correctly updated. With the old implementation I used the following solution:

```
private static void UpdateAllHelper(PropertyItemCollection properties)
{
foreach (var prop in properties)
{
BindingOperations.GetBindingExpressionBase(prop, PropertyItem.ValueProperty).UpdateTarget();
if (prop.IsExpandable)
{
UpdateAllHelper(prop.Properties);
}
}
}

public void Update()
{
UpdateAllHelper(Properties);
}
```
The recursion should not be a problem with the default max property depth. But of course, as stated above, the ```UpdateTarget()``` call is not working anymore.
Comments: ** Comment from web user: daageu **

When is v2.0 is going to be released? Any idea?


Viewing all articles
Browse latest Browse all 4964

Trending Articles



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