Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: Cannot modify DisplayName once the definition has beed added to a collection

$
0
0
Given a PropertyGrid like this:
<xctk:PropertyGrid AutoGenerateProperties="False" SelectedObject="{Binding}" >
            <xctk:PropertyGrid.PropertyDefinitions>
                <xctk:PropertyDefinition TargetProperties="Units" DisplayName="{Loc str_Units}"/>
            </xctk:PropertyGrid.PropertyDefinitions>
        </xctk:PropertyGrid>
Where "Loc" is the localization implementation from here (https://www.codeproject.com/Articles/249369/Advanced-WPF-Localization), whenever I try to update the culture of the app (which in turn should update the DisplayName), I get the exception:
Cannot save value from target back to source. BindingExpression:Path=Language; DataItem='MainWindowViewModel' (HashCode=30316242); target element is 'DescriptorPropertyDefinition' (HashCode=47637903); target property is 'Value' (type 'Object') InvalidOperationException:'System.InvalidOperationException: Cannot modify DisplayName once the definition has beed added to a collection.
This is the sole place in the application where this occurs; every other UI element updates with the new language; for instance:
<TextBlock Text="{Loc msg_PleaseOpenASurvey}" FontStyle="Italic"/>
Any way around this, so I can get the PropertyGrid to update its strings too?

Thanks! :)

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>