Jason
Jason

Reputation: 17099

Setting XAML at runtime?

Can I dynamically create an XAML and pop it into my app? How would it be done?

Upvotes: 3

Views: 2322

Answers (2)

Soviut
Soviut

Reputation: 91724

A few articles on dynamic XAML generation:

Upvotes: 1

Steven Robbins
Steven Robbins

Reputation: 26599

Yep, it's pretty simple:

XmlReader tXml = XmlReader.Create(myXamlString);
UIElement MyElement = (UIElement)XamlReader.Load(tXml);

Then you can do what you like with it.

Upvotes: 3

Related Questions