Share via


IXRApplication::ParseXamlWithExistingRoot (Compact 2013)

3/28/2014

This method parses the source XAML and adds it to an existing root in the visual tree.

Syntax

virtual HRESULT STDMETHODCALLTYPE ParseXamlWithExistingRoot(
    XRXamlSource* pSource,
    IXRDependencyObject* pExistingRoot
) = 0;

Parameters

  • pSource
    [in] Pointer to an XRXamlSource structure that describes the source XAML that must be parsed into a new element tree.
  • pExistingRoot
    [in] Pointer to an IXRDependencyObject object that is the root element of an existing visual tree onto which the new element tree must be appended.

Return Value

Returns an HRESULT that indicates success or failure.

Returns XR_E_INVALID_OBJECT if pExistingRoot is not a XAML for Windows Embedded object.

When a XAML parser error occurs, this method can also return one of the following error messages:

Error message

Description

XR_E_PARSER_MISSING_DEFAULT_NAMESPACE

The root element of the source XAML is missing the default namespace declaration.

XR_E_PARSER_UNKNOWN_ELEMENT

The element that is being parsed is unknown to XAML for Windows Embedded.

XR_E_PARSER_UNKNOWN_ATTRIBUTE

The attribute that is being parsed is unknown to XAML for Windows Embedded.

XR_E_PARSER_UNKNOWN_NAMESPACE

The element or attribute that is being parsed belongs to an unknown namespace.

XR_E_PARSER_INVALID_PROPERTY

The property that is being parsed is invalid in this context.

XR_E_PARSER_MULTIPLE_PROPERTY_ELEMENT_VALUES

There are multiple property element values for the given element; for example:

<a><a.b>text1</a.b><a.b>text2</a.b></a>

XR_E_PARSER_INVALID_ATTRIBUTE

Both x:Name and Name cannot be specified on an element.

XR_E_PARSER_INVALID_ATTRIBUTE_VALUE

The value for this attribute is invalid.

XR_E_PARSER_ATTRIBUTE_OUT_OF_RANGE

The value for this attribute is out of acceptable range.

XR_E_PARSER_ATTRIBUTE_READONLY

This attribute is read-only and cannot be set in XAML.

XR_E_PARSER_FAILED_RESOURCE_FIND

The static resource could not be resolved.

XR_E_PARSER_RESOURCE_KEY_AND_NAME_SET

Both x:Key and x:Name attributes cannot be set in this element inside a resource dictionary.

XR_E_PARSER_TEXT_CONTENT_UNSUPPORTED

This element does not support text as its content.

XR_E_PARSER_INVALID_CONTENT

The content for this element is invalid.

Remarks

This method is helpful when you want to parse XAML markup that defines a specific UI object instead of a complete graphical scene.

.NET Framework Equivalent

None.

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRApplication
IXRApplication::ParseXaml