Approved
Last Updated: 04 Jan 2017 07:24 by ADMIN
ADMIN
Martin Ivanov
Created on: 24 Mar 2015 12:00
Category: PersistenceFramework
Type: Bug Report
2
PersistenceFramework: When the SerializationMetadataCollection is used, the framework saves more properties than expected.
When the SerializationMetadataCollection is used, the framework saves more properties than expected.

As a workaround you can use IPropertyProvider instead of SerializationOptions.

public class MyPropertyProvider : IPropertyProvider
{
        // This method returns a list with the properties that will be saved by the persistence manager
	public System.Reflection.PropertyInfo[] GetProperties()
	{
		List<PropertyInfo> properties = new List<PropertyInfo>();
		var allProperties = typeof(RadExpander).GetProperties();
		foreach (PropertyInfo item in allProperties)
		{
			if (item.Name == "IsExpanded")
			{
				properties.Add(item);
			}
		}
		return properties.ToArray();
	}
}
...............
// this registers the custom property provider globally for the elements of type RadExpander.
ServiceProvider.RegisterPersistenceProvider<IPropertyProvider>(typeof(RadExpander), new MyPropertyProvider());
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments