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
|
Hi,
I am using the MultipleObjectWrapper (https://www.mindscapehq.com/forums/Thread.aspx?ThreadID=2011) to subscribe for the value changing and value changed event of object being shown in property grid. And I use the NonAutoUpdate custom textbox (http://www.mindscapehq.com/forums/Thread.aspx?ThreadID=1124) and use it as TypeEditor for base types such as String and integer. I also implemented IDataErrorInfo on the objects, and I want to show the validation result on the property grid. That is, if the validation fails, the NonAutoUpdate textbox should have red border. Could you suggest me how to achieve this?
Thank you! |
|
|
We don't currently support IDataErrorInfo on MultipleObjectWrapper because it's not clear how it should behave. What if some objects support IDataErrorInfo but others don't? What if different objects report different error strings for the same property? We could deal with this by saying 'we'll only report errors via IDataErrorInfo if all objects implement IDataErrorInfo and they all report the same error,' but this risks disguising errors in the case where two objects report different errors. I guess we could also synthesise a new error 'selected objects have different errors,' but we still run into issues if some objects report errors via exceptions and some via IDataErrorInfo. We're open to ideas on good ways to handle this! |
|
|
Hi Ivan,
Thanks for your answer. But before going to that, I have found another issue. I used a custom DataTemplate as a PropertyEditor for a specific property of MultipleObjectWrapper. I noticed that the PropertyChanging event is not fired in this case. Is this an expected behavior?
Thank you! |
|
|
PropertyChanging should be raised on the MultipleObjectWrapper for the property which is changing. Can you provide us with a project that reproduces the behaviour? You can attach a zip file via the Options tab. |
|
|
Hi Ivan,
The project itself is quite immense in size, so I will try to reproduce this in smaller size project. Just for clarification, I use a custom data template to show combo box. Then I apply this data template as a property editor for property of an object wrapped by the MultipleObjectWrapper. Somehow, the property changing event is not fired when user choose an item in the combo box. Yet the property changed event is fired after the value has been set. Is this expected?
Thank you!
|
|
|
Looking at the code I would expect that if you are getting PropertyChanged (from the MultipleObjectWrapper) then you should also be getting PropertyChanging. |
|