XamlSerializer
Provides functionality for serializing and deserializing XAML documents.
Definition
Namespace:Telerik.Windows.Documents.Xaml
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class XamlSerializer
Inheritance: objectXamlSerializer
Constructors
public XamlSerializer()
Fields
protected Dictionary<Type, List<XamlSerializer.AttachedProperty>> AttachedProperties
protected static readonly TypeConverter BuiltIn
protected HashSet<Type> DiscoveredTypes
protected static readonly IEqualityComparer<PropertyInfo> PropEquals
protected HashSet<PropertyInfo> PropertiesToSkip
protected static readonly IEqualityComparer<object> RefEquals
protected IDictionary<Type, TypeConverter> TypeConverters
public const string XamlNamespace = "http://schemas.microsoft.com/winfx/2006/xaml"
Methods
protected bool CanWriteProperty(PropertyInfo propertyInfo)
Discovers attached properties defined in the specified assembly.
public void DiscoverAttachedProperties(Assembly asm)
The assembly to search for attached properties.
Discovers all attached properties defined for the specified type.
public void DiscoverAttachedProperties(Type type)
The type for which to discover attached properties.
protected virtual string GetAttachedOrder(XamlSerializer.AttachedProperty attachedProperty)
protected IEnumerable<XamlSerializer.AttachedProperty> GetAttachedProperties(Type type)
protected string GetNamespace(Type type, IDictionary<string, string> prefixMappings)
protected virtual string GetPrefix(string ns, IDictionary<string, string> prefixMappings, XmlWriter writer)
protected static Func<object, object> GetPropertyGetter(PropertyInfo propertyInfo)
protected TypeConverter GetTypeConverter(MemberInfo memberInfo)
protected virtual XmlWriter GetXmlWriter(StringBuilder output)
XmlWriter
Registers an attached property using the specified getter and setter methods.
public bool RegisterAttachedProperty(MethodInfo getter, MethodInfo setter)
The MethodInfo representing the getter method for the attached property.
setterMethodInfoThe MethodInfo representing the setter method for the attached property.
Returns:Returns a boolean value indicating whether the registration of the attached property was successful.
protected virtual bool ShouldSerialize(object obj, object propValue, PropertyInfo prop)
protected virtual void VisitAttachedProperty(object obj, object propValue, string propertyName, MethodInfo getter, MethodInfo setter, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)
protected virtual void VisitCollectionContents(IEnumerable collection, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)
protected virtual void VisitDictionaryContents(IDictionary dictionary, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)
protected virtual void VisitObject(object obj, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects, bool isRoot = false, object key = null)
protected virtual void VisitProperty(object obj, object propValue, PropertyInfo prop, bool isContentProperty, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)