C# WPF XAML Loading

286 Views Asked by At

Hi I'd like to inquire on how i can load a WPF Xaml into code so that I can change the values of the attributes of some XAML elements and output it by creating another XAML files. This is so that I can output the same file with values dynamically input by the user.

the XamlReader.Load() method cannot be used; it will throw an exception (because they are unable to recognise Window as the root element). I'm using VS2013 and C#.

1

There are 1 best solutions below

0
On

XamlReader is the answer... just need to be aware of the trick to using it. See the answer to this question: Can I use XamlReader.Load or InitializeFromXaml from a WPF Window, for the Window definition?