The Node Loop
Performing a transformation from one format to another involves reading XAML nodes from an appropriate reader and sending them to an appropriate writer. XamlReader and XamlWriter are designed to make this easy, enabling you to write a simple “node loop” that performs the necessary reading and writing from beginning to end. With a XAML reader called reader and a XAML writer called writer, here is what a simple node loop looks like:
// Simple node loopwhile (reader.Read()){ writer.WriteNode(reader);}
What actually happens in this loop depends on the type of the reader and writer. The XAMLPAD sample accompanying this book has the goal of reading XAML in XAML format (stored in a string) and producing a live object graph that can be ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access