Class
XamlSerializer

Provides functionality for serializing and deserializing XAML documents.

Definition

Namespace:Telerik.Windows.Documents.Xaml

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class XamlSerializer

Inheritance: objectXamlSerializer

Constructors

XamlSerializer()

Declaration

cs-api-definition
public XamlSerializer()

Fields

AttachedProperties

Declaration

cs-api-definition
protected Dictionary<Type, List<XamlSerializer.AttachedProperty>> AttachedProperties

Field Value

Dictionary<Type, List<XamlSerializer.AttachedProperty>>

BuiltIn

Declaration

cs-api-definition
protected static readonly TypeConverter BuiltIn

Field Value

TypeConverter

DiscoveredTypes

Declaration

cs-api-definition
protected HashSet<Type> DiscoveredTypes

Field Value

HashSet<Type>

PropEquals

Declaration

cs-api-definition
protected static readonly IEqualityComparer<PropertyInfo> PropEquals

Field Value

IEqualityComparer<PropertyInfo>

PropertiesToSkip

Declaration

cs-api-definition
protected HashSet<PropertyInfo> PropertiesToSkip

Field Value

HashSet<PropertyInfo>

RefEquals

Declaration

cs-api-definition
protected static readonly IEqualityComparer<object> RefEquals

Field Value

IEqualityComparer<object>

TypeConverters

Declaration

cs-api-definition
protected IDictionary<Type, TypeConverter> TypeConverters

Field Value

IDictionary<Type, TypeConverter>

XamlNamespace

Declaration

cs-api-definition
public const string XamlNamespace = "http://schemas.microsoft.com/winfx/2006/xaml"

Field Value

string

Methods

CanWriteObject(object, HashSet<object>)

Declaration

cs-api-definition
protected virtual bool CanWriteObject(object obj, HashSet<object> cycleCheckObjects)

Parameters

obj

object

cycleCheckObjects

HashSet<object>

Returns

bool

CanWriteProperty(PropertyInfo)

Declaration

cs-api-definition
protected bool CanWriteProperty(PropertyInfo propertyInfo)

Parameters

propertyInfo

PropertyInfo

Returns

bool

DiscoverAttachedProperties(Assembly)

Discovers attached properties defined in the specified assembly.

Declaration

cs-api-definition
public void DiscoverAttachedProperties(Assembly asm)

Parameters

asm

Assembly

The assembly to search for attached properties.

DiscoverAttachedProperties(Type)

Discovers all attached properties defined for the specified type.

Declaration

cs-api-definition
public void DiscoverAttachedProperties(Type type)

Parameters

type

Type

The type for which to discover attached properties.

GetAttachedOrder(AttachedProperty)

Declaration

cs-api-definition
protected virtual string GetAttachedOrder(XamlSerializer.AttachedProperty attachedProperty)

Parameters

attachedProperty

XamlSerializer.AttachedProperty

Returns

string

GetAttachedProperties(Type)

Declaration

cs-api-definition
protected IEnumerable<XamlSerializer.AttachedProperty> GetAttachedProperties(Type type)

Parameters

type

Type

Returns

IEnumerable<XamlSerializer.AttachedProperty>

GetContentProperty(object)

Declaration

cs-api-definition
protected PropertyInfo GetContentProperty(object obj)

Parameters

obj

object

Returns

PropertyInfo

GetNamespace(Type, IDictionary<string, string>)

Declaration

cs-api-definition
protected string GetNamespace(Type type, IDictionary<string, string> prefixMappings)

Parameters

type

Type

prefixMappings

IDictionary<string, string>

Returns

string

GetPrefix(string, IDictionary<string, string>, XmlWriter)

Declaration

cs-api-definition
protected virtual string GetPrefix(string ns, IDictionary<string, string> prefixMappings, XmlWriter writer)

Parameters

ns

string

prefixMappings

IDictionary<string, string>

writer

XmlWriter

Returns

string

GetPropertyGetter(PropertyInfo)

Declaration

cs-api-definition
protected static Func<object, object> GetPropertyGetter(PropertyInfo propertyInfo)

Parameters

propertyInfo

PropertyInfo

Returns

Func<object, object>

GetPropertyOrder(PropertyInfo)

Declaration

cs-api-definition
protected virtual string GetPropertyOrder(PropertyInfo prop)

Parameters

prop

PropertyInfo

Returns

string

GetTypeConverter(MemberInfo)

Declaration

cs-api-definition
protected TypeConverter GetTypeConverter(MemberInfo memberInfo)

Parameters

memberInfo

MemberInfo

Returns

TypeConverter

GetXmlWriter(StringBuilder)

Declaration

cs-api-definition
protected virtual XmlWriter GetXmlWriter(StringBuilder output)

Parameters

output

StringBuilder

Returns

XmlWriter

IsDictionary(Type)

Declaration

cs-api-definition
protected static bool IsDictionary(Type type)

Parameters

type

Type

Returns

bool

IsInlinable(object, object, MemberInfo, HashSet<object>)

Declaration

cs-api-definition
protected virtual bool IsInlinable(object obj, object propValue, MemberInfo memberInfo, HashSet<object> cycleCheckObjects)

Parameters

obj

object

propValue

object

memberInfo

MemberInfo

cycleCheckObjects

HashSet<object>

Returns

bool

IsInlineAttachedProperty(object, object, MethodInfo, HashSet<object>)

Declaration

cs-api-definition
protected bool IsInlineAttachedProperty(object obj, object propValue, MethodInfo methodInfo, HashSet<object> cycleCheckObjects)

Parameters

obj

object

propValue

object

methodInfo

MethodInfo

cycleCheckObjects

HashSet<object>

Returns

bool

IsInlineProperty(object, object, PropertyInfo, HashSet<object>)

Declaration

cs-api-definition
protected bool IsInlineProperty(object obj, object propValue, PropertyInfo prop, HashSet<object> cycleCheckObjects)

Parameters

obj

object

propValue

object

prop

PropertyInfo

cycleCheckObjects

HashSet<object>

Returns

bool

IsList(Type)

Declaration

cs-api-definition
protected static bool IsList(Type type)

Parameters

type

Type

Returns

bool

IsUnique(object, HashSet<object>)

Declaration

cs-api-definition
protected bool IsUnique(object obj, HashSet<object> cycleCheckObjects)

Parameters

obj

object

cycleCheckObjects

HashSet<object>

Returns

bool

PostSerialize(object, ref string)

Declaration

cs-api-definition
protected virtual void PostSerialize(object obj, ref string value)

Parameters

obj

object

value

string

PreSerialize(object, Dictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void PreSerialize(object obj, Dictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

obj

object

prefixMappings

Dictionary<string, string>

cycleCheckObjects

HashSet<object>

RegisterAttachedProperty(MethodInfo, MethodInfo)

Registers an attached property using the specified getter and setter methods.

Declaration

cs-api-definition
public bool RegisterAttachedProperty(MethodInfo getter, MethodInfo setter)

Parameters

getter

MethodInfo

The MethodInfo representing the getter method for the attached property.

setter

MethodInfo

The MethodInfo representing the setter method for the attached property.

Returns

bool

Returns a boolean value indicating whether the registration of the attached property was successful.

ShouldSerialize(object, object, PropertyInfo)

Declaration

cs-api-definition
protected virtual bool ShouldSerialize(object obj, object propValue, PropertyInfo prop)

Parameters

obj

object

propValue

object

prop

PropertyInfo

Returns

bool

VisitAfterAttributes(object, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitAfterAttributes(object obj, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

obj

object

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

VisitAfterBeginElement(object, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitAfterBeginElement(object obj, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

obj

object

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

VisitAlternateContent(object, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitAlternateContent(object obj, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

obj

object

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

VisitAttachedProperty(object, object, string, MethodInfo, MethodInfo, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitAttachedProperty(object obj, object propValue, string propertyName, MethodInfo getter, MethodInfo setter, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

obj

object

propValue

object

propertyName

string

getter

MethodInfo

setter

MethodInfo

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

VisitBeforeEndElement(object, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitBeforeEndElement(object obj, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

obj

object

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

VisitCollectionContents(IEnumerable, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitCollectionContents(IEnumerable collection, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

collection

IEnumerable

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

VisitDictionaryContents(IDictionary, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitDictionaryContents(IDictionary dictionary, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

dictionary

IDictionary

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

VisitKey(object, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitKey(object key, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

key

object

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

VisitObject(object, XmlWriter, IDictionary<string, string>, HashSet<object>, bool, object)

Declaration

cs-api-definition
protected virtual void VisitObject(object obj, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects, bool isRoot = false, object key = null)

Parameters

obj

object

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

isRoot

bool

key

object

VisitProperty(object, object, PropertyInfo, bool, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitProperty(object obj, object propValue, PropertyInfo prop, bool isContentProperty, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

obj

object

propValue

object

prop

PropertyInfo

isContentProperty

bool

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

VisitRootAttribute(object, XmlWriter, IDictionary<string, string>, HashSet<object>)

Declaration

cs-api-definition
protected virtual void VisitRootAttribute(object obj, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)

Parameters

obj

object

writer

XmlWriter

prefixMappings

IDictionary<string, string>

cycleCheckObjects

HashSet<object>

In this article
DefinitionConstructorsXamlSerializer()FieldsAttachedPropertiesBuiltInDiscoveredTypesPropEqualsPropertiesToSkipRefEqualsTypeConvertersXamlNamespaceMethodsCanWriteObject(object, HashSet<object>)CanWriteProperty(PropertyInfo)DiscoverAttachedProperties(Assembly)DiscoverAttachedProperties(Type)GetAttachedOrder(AttachedProperty)GetAttachedProperties(Type)GetContentProperty(object)GetNamespace(Type, IDictionary<string, string>)GetPrefix(string, IDictionary<string, string>, XmlWriter)GetPropertyGetter(PropertyInfo)GetPropertyOrder(PropertyInfo)GetTypeConverter(MemberInfo)GetXmlWriter(StringBuilder)IsDictionary(Type)IsInlinable(object, object, MemberInfo, HashSet<object>)IsInlineAttachedProperty(object, object, MethodInfo, HashSet<object>)IsInlineProperty(object, object, PropertyInfo, HashSet<object>)IsList(Type)IsUnique(object, HashSet<object>)PostSerialize(object, ref string)PreSerialize(object, Dictionary<string, string>, HashSet<object>)RegisterAttachedProperty(MethodInfo, MethodInfo)ShouldSerialize(object, object, PropertyInfo)VisitAfterAttributes(object, XmlWriter, IDictionary<string, string>, HashSet<object>)VisitAfterBeginElement(object, XmlWriter, IDictionary<string, string>, HashSet<object>)VisitAlternateContent(object, XmlWriter, IDictionary<string, string>, HashSet<object>)VisitAttachedProperty(object, object, string, MethodInfo, MethodInfo, XmlWriter, IDictionary<string, string>, HashSet<object>)VisitBeforeEndElement(object, XmlWriter, IDictionary<string, string>, HashSet<object>)VisitCollectionContents(IEnumerable, XmlWriter, IDictionary<string, string>, HashSet<object>)VisitDictionaryContents(IDictionary, XmlWriter, IDictionary<string, string>, HashSet<object>)VisitKey(object, XmlWriter, IDictionary<string, string>, HashSet<object>)VisitObject(object, XmlWriter, IDictionary<string, string>, HashSet<object>, bool, object)VisitProperty(object, object, PropertyInfo, bool, XmlWriter, IDictionary<string, string>, HashSet<object>)VisitRootAttribute(object, XmlWriter, IDictionary<string, string>, HashSet<object>)
Not finding the help you need?
Contact Support