Load Method
Collapse the table of content
Expand the table of content

TemplateContentLoader.Load Method (XamlReader, IServiceProvider)

.NET Framework (current version)

Loads XAML content in a deferred mode, based on a XamlReader and certain required services from a service provider.

Namespace:   System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

public override object Load(
	XamlReader xamlReader,
	IServiceProvider serviceProvider


Type: System.Xaml.XamlReader

The initiating reader that is then returned on calls to Save.

Type: System.IServiceProvider

Service provider for required services.

Return Value

Type: System.Object

The root object for the node stream of the input XamlReader. Specifically, this is a TemplateContent instance.

Exception Condition

xamlReader or serviceProvider are null.


serviceProvider does not provide a required service.

IXamlObjectWriterFactory is a required service, it must be available on the passed serviceProvider.

.NET Framework
Available since 4.0
Return to top
© 2016 Microsoft