This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Class Wavelength implements INotifyPropertyChanged interface and has 2 subproperies "Value" and "Unit" 1. Expand node W1 W1 subproperty "Value" remaines intact
|
|
|
This issue occurs because your value converter is returning an entire new object, and setting Class1.W1 to this new value. There are two problems with this: firstly, Class1 does not raise PropertyChanged to tell us that Class1.W1 has changed; and secondly, even if it did, we have an issue where we don't recreate the child nodes to reflect the new object. I'll look into this. However, I'd suggest an alternative design anyway. Rather than using a value converter and replacing the entire object, use a multi-value converter and set the properties of the incumbent object. Here's how the IMultiValueConverter would look -- basically the same as your code but adapted to deal with an array of property values rather than a Wavelength object: public class WavelengthConverter2 : IMultiValueConverter Then your editor template would look like this: And the TypeEditor declaration would now use the default (reference) mode instead of WrappedValue: <ms:TypeEditor AllowExpand="True" The result of these changes is that the text entered into the text box is applied to the properties of the existing Class1.W1 Wavelength object, to which the subproperty nodes are already hooked up, and the subproperty nodes therefore update correctly. As I say, I will look into the issue of regenerating subproperty nodes when a reference property is replaced, but for this particular case, I would recommend the IMultiValueConverter approach anyway. |
|