Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
555
Adressing Property in Collection
posted

I'm trying to minimize the size of our persisted configuration for a XamGrid. At the moment the configuration is 3400 bytes big. I managed to shrink the size of the configuration by only persisting some properties that are necessary. For example I'm not saving all FilteringSettings but defined the PropertyPath to the properties I needed:

_settings.PropertySettings.Add(new PropertyNamePersistenceInfo
{
PropertyName = "FilteringSettings.FilterMenuSelectionListGeneration",
Options = PropertyNamePersistenceOptions.PropertyPath
});

We want to persist "Width" and the "IsSorted" properties of the columns. At the moment the configuration for these properties looks like this:

_settings.PropertySettings.Add(new PropertyNamePersistenceInfo
{
PropertyName = "Width",
Options = PropertyNamePersistenceOptions.PropertyName
});
_settings.PropertySettings.Add(new PropertyNamePersistenceInfo
{
PropertyName = "IsSorted",
Options = PropertyNamePersistenceOptions.PropertyName
});

Also in this case I want to switch to "PropertyPath" to specify exactly the property I need to persist. The mentioned properties are located in the "Columns" Collection. How can I define the property path such that I achive the behavior? I tried following but it isn't working:

 

_settings.PropertySettings.Add(new PropertyNamePersistenceInfo
{
PropertyName = "Columns[].IsSorted",
Options = PropertyNamePersistenceOptions.PropertyPath
});