This project is read-only.
1

Closed

UpdateControls does not support PropertyGrid from Extended WPF Toolkit

description

If I wrap the view model and assign it as a DataContext of Property Grid. Property Grid shows only the Properties: Class instance, Wrapped object... It does not find the underlying wrapped object.
Closed Nov 1, 2013 at 7:08 PM by MichaelLPerry1971
Thank you for reporting the problem. There was a bug in the way that the Update Controls type descriptor was handling null instances. Instead of describing the properties of the wrapped type, it was describing the properties of the wrapper.

The problem is fixed and posted to NuGet (version 2.2.5.2). Please pull and update and see if it resolves your issue.

There is still an issue related to object-type properties. The property grid shows the name "ForView.Wrap(ChildType)" instead of simply "ChildType". This is a consequence of an earlier fix for debugging. It was difficult to see the difference between the native type and the wrapper. Please open a new issue if this is a problem for you.

comments

chris_wen_11 wrote Nov 1, 2013 at 1:14 PM

I also tried to set the bound property to Wrapped object. It shows all the properties. However, when I change the value of model, the value of view does not change.

<xctk:PropertyGrid SelectedObject="{Binding WrappedObject}>

MichaelLPerry1971 wrote Nov 1, 2013 at 3:31 PM

The PropertyGrid probably does not honor the TypeDescriptorProvider attribute that Update Controls uses. I'll look into it and see if I can find a solution.

In the meantime, you can use ViewModelBase as a workaround. Inherit from this base class and put the following syntax in all of your property getters:

int MyProperty
{
get { return Get(() => _myProperty); }
}

I don't like to use the base class, but it comes in handy when the wrapper gets in the way.

chris_wen_11 wrote Nov 1, 2013 at 3:57 PM

Really appreciate your quick answer. I will try it.
BTW. UpdateControls is designed very well. :)

wrote Nov 1, 2013 at 7:08 PM