Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting XAML at runtime?

Tags:

xaml

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

like image 683
Jason Avatar asked Sep 15 '26 18:09

Jason


1 Answers

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.

like image 88
Steven Robbins Avatar answered Sep 18 '26 20:09

Steven Robbins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!