0
votes

I am using the Extended WPF Toolkit and I'm trying to set up a PropertyGrid.

All properties I want to show are configured like that in XAML:

    <xctk:PropertyDefinition TargetProperties="Name" 
                             Description="{StaticResource PropertyGridDescription_Name}" 
                             DisplayName="{StaticResource PropertyGridName_Name}"
                             Category="{StaticResource PropertyGridCategory_Overview}"
                             DisplayOrder="0"/>

One Property I would like to make expandable.

        <xctk:PropertyDefinition TargetProperties="Source" 
                                 Description="{StaticResource PropertyGridDescription_Connection}" 
                                 DisplayName="{StaticResource PropertyGridName_Connection}"
                                 Category="{StaticResource PropertyGridCategory_Overview}"
                                 IsExpandable="True"
                                 DisplayOrder="4"/>

First of all - I get these errors in XAML:

Cannot modify DisplayOrder once the definition has beed added to a collection.

Cannot modify IsExpandable once the definition has beed added to a collection.

Cannot modify DisplayName once the definition has beed added to a collection.

Cannot modify TargetProperties once the definition has beed added to a collection.

But the things work?!

Another Question: How to make a template for my expendable propertydefinition (I don't want to use AutoGenerateProperties)

1

1 Answers

0
votes

About these errors you can find more here: https://wpftoolkit.codeplex.com/discussions/472145

The error "Cannot modify TargetProperties once the definition has beed added to a collection." in XAML won't affect your program. It won't happen in v2.5.

Expandable Properties you can find here: https://wpftoolkit.codeplex.com/wikipage?title=PropertyGrid&referringTitle=Documentation#expandable_properties

Sometimes it is neccessary to show the properties of a complex object. The PropertyGrid supports this scenario and allows you to drill down into a property's heirarchy. To enable this behavior you must decorate your property with the ExpandableObject attribute.