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
|
My application allows the user's to customize most all of the parts of the object that you are currently reading from the attributes. Is there a way to set these attributes in code? For example, I want to set the Category, Description and the Caption\HumanName from code.
|
|
|
The caption can be set when you add the custom node: grid.AddNode("My Caption", 123);. Category and Description are not available for custom nodes, but you can simulate them using custom grouping and data binding. For categories, rather than using the built-in NodeToCategoryConverter or PropertyGrouping.ByCategory (which is just a wrapper around the NodeToCategoryConverter), create your own GroupDescription: public class CustomGroupingConverter : IValueConverter { For descriptions, you would use a similar technique. E.g. assume you have a TextBlock where you want to show descriptive info about the selected row. You would use a binding like this: <TextBlock Text="{Binding SelectedGridItem, Converter={StaticResource CustomDescriptionConverter}}" /> where CustomDescriptionConverter is an IValueConverter whose Convert method is something like: public object Convert(object value, ...) { Note that AddNode returns the newly added node which is what you would use to populate the dictionaries (if you took that approach): foreach (UserDefinedThing t in allUserDefinedThings) Obviously the exact structure will depend on how your application models the custom metadata. |
|