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 there a way to get access to the current property value from a derived property editor? |
|
|
Do you mean as part of the editor declaration (i.e. in CanEdit), or in the editor template? As part of the editor declaration, the property value is in node.Value. However if you are thinking of using this to determine whether to display the editor or not then I'd advise caution because I don't think we would update the choice of editor as the property value changed. In the editor DataTemplate, the property value is available as {Binding Value}. |
|
|
I need it in the editor declaration. But there is no node property. Please can you explain it in more detail or better give a short code snippet |
|
|
Editor declarations don't have a node property, because they are effectively selectors of nodes, not attached to individual node instances. So the node gets passed to the editor as an argument to the CanEdit method. See http://www.mindscape.co.nz/blog/index.php/2008/04/30/smart-editor-declarations-in-the-wpf-property-grid/ for a code snippet; but once again I'd reiterate that using the node.Value as part of the CanEdit criteria may not work as the value changes. Again, if you want the property value in the DataTemplate of a PropertyEditor, you can get it with {Binding Value}. So if you are trying to use the node value to select a template, then a DataTrigger in the DataTemplate may be a better way to go about it. |
|