This project has moved and is read-only. For the latest updates, please go here.


Dec 6, 2013 at 8:01 PM
The Xaml designer is throwing the following error:
"Cannot modify TargetProperties once the definition has beed added to a collection."

on this line.
<xctk:EditorTemplateDefinition TargetProperties="EditorFont">
        <xctk:PropertyGrid x:Name="testPropertyGrid" Margin="10,10,10,72" ShowSearchBox="False" ShowSortOptions="False">
                <xctk:EditorTemplateDefinition TargetProperties="EditorFont">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Value.Family}" />
                                <TextBlock Text=", " />
                                <TextBlock Text="{Binding Value.FontSize}" />
                                <TextBlock Text=", " />
                                <TextBlock Text="{Binding Value.Weight}" />
                                <TextBlock Text=", " />
                                <TextBlock Text="{Binding Value.Style}" />
                                <TextBlock Text=", " />
                                <TextBlock Text="{Binding Value.Stretch}" />
Otherwise the propertygrid works fine.

Jan 8, 2014 at 8:39 PM
I am getting the same error when specifying the TargetProperties property in a PropertyDefinition - like you apart from the blue squiggles and the error message (Cannot modify TargetProperties once the definition has beed added to a collection.) everything works as expected.

Windows 8.1, Visual Studio 2013 Premium, WPF Toolkit v4.0.30319
        <xctk:PropertyGrid AutoGenerateProperties="False" >
                <xctk:PropertyDefinition TargetProperties="Prop1, Prop2 />
Jan 9, 2014 at 6:40 PM
I finally realized that learning to deal with such issues was taking me too far off of the original goal of creating the app. So I abandoned the PropertyGrid idea and moved on. I don't like having to write pages of code to get the job done if there is an already working solution.

Sadly it seems that as we progress with high level languages, what works is usually re-invented and then does not. Microsoft tends to deem things unnecessary and then discontinues them as well.

IMO this control need more work.
Jan 9, 2014 at 7:05 PM

I understand your frustration - but I guess this is the community edition and I appreciate the work Xceed have done here.

Having said that yesterday I downloaded the trial version of the latest (v2.1) Plus product and had the same error. A work around for me is to revert to the (obsolete) 'Name' attribute but it does make me wonder if the control is the right way to move ahead. For now it is a quick way for me to edit complex and changing objects during the early development phase but questionable if it is production ready.

I'll post to the support site for the full product and see what the response is.
Sep 3, 2014 at 3:16 PM

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.