Is there a way to manipulate xaml file in c# programmatically at runtime? -


the aim of project manipulate xaml code convert existing xaml uwp code different platform xaml code. appreciated.

streamreader stream = new streamreader("path xaml file"); frameworkelement root = xamlreader.load(stream.basestream) frameworkelement; 

the issue here xaml file contains x:class apparently cannot load in runtime. there better way manipulate attributes.

you can combine xamlreader.load , xamlservices.parse load , parse xaml files programmatically:

https://msdn.microsoft.com/en-us/library/system.xaml.xamlservices.parse(v=vs.110).aspx

https://msdn.microsoft.com/en-us/library/ms590388(v=vs.110).aspx

how parse xaml file/string

https://github.com/dotnet/docs/blob/master/docs/framework/xaml-services/xamlservices-class-and-basic-xaml-reading-or-writing.md

https://blogs.msdn.microsoft.com/ashish/2007/08/14/dynamically-loading-xaml/


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -