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
|
I have several properties on my class of type string[]; I want to have a custom type editor to control all of these. But I'm running into a problem when I try to use a TypeEditor to hit all of the properties. I'm unable to specify "Value" (as I can with a PropertyEditor) in my binding since type converters seem to bind directly to the object which is the propertie's value. But if I bind without the path set I get an error about twoway bindings requiring a path. My DataTemplate looks like this: My Editor Definition looks like this: Any suggestions for how to make this work? I using lots of PropertyEditors really isn't a valid solution since there are many & they are likely to change. The difference between a TypeEditor & a Property editor is more then a little confusing. Especially since with some of the struct based DataTemplates I have I can reference Value; but in this case I cannot. |
|
|
Try setting TypeEditor.TemplateBindingMode to WrappedValue. This makes the Value property available as if it were a PropertyEditor. The documentation for TemplateBindingMode explains why you see different behaviour between TypeEditors for structs and classes. Unfortunately, the reasons for the differences are largely historical: TypeEditors were originally designed for use with reference types, and struct support was added later. If we had our time again we'd probably unify the behaviour and implementation of TypeEditors and PropertyEditors a lot more than we have, but we have to balance that against the cost to customers of breaking compatibility with their existing code. |
|