using System.Windows.Baml2006; var knownTypes = new WpfKnownType[] { // Define known types here }; var xamlContext = new XamlSchemaContext(knownTypes); var myXamlReader = new XamlReader(); var xaml = "In this example, we create an array of known types, initialize a new instance of the XamlSchemaContext class, create a new instance of the XamlReader class, and load XAML code into an object using the Load method. The package library for System.Windows.Baml2006 is part of the .NET Framework and is included in versions 3.0 and higher.