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
|
Is it possible/how to highlight changed properties. See attached example... |
|
|
You can do this *IF* the object provides a way to find out which properties have changed, *AND* this way is binding-friendly. Here are some pointers: * For the left hand column, use the PropertyNameTemplate to override the default display. You can use Node.Name to get the name of the property being displayed, and Node.Source to get the object whose property is being displayed, but where this gets a bit tricky is binding to the "has changed" property: WPF doesn't really enable us to synthesise a property name for a binding (e.g. an IsFooDirty property that provides change info for the Foo property). We could multibind to Node.Name, Node.Source and Node.Value using a converter that converts the Name into a call to the IsDirty on the source, but this won't work if IsDirty can change without the value changing (e.g. saving an object resets IsDirty to false but without changing the value). In that case you might also need a Version which could be incorporated into the MultiBinding: the Version would have to change when any dirtiness status changed (whether due to a value change or a save). * For the right hand column, you would need to create custom editor templates. You could then bind these in the same way as described above, except that you would be receiving an ObjectWrapper rather than a PropertyGridRow, and would therefore need to bind to things like UnderlyingObject and/or Property rather than Node.Source and/or Node. See the ObjectWrapper docs. Hope this helps -- I'm afraid it's probably going to be a bit tricky but we'd be glad to provide further advice if you have a specific object model at hand. |
|
|
Hello Martin I am interested in similar features and looking for samples. Have you managed your property highlighting meanwhile? I'd appretiate it very much to get an example. Best regards, Paul
|
|