简体   繁体   中英

Best way to serialize a wpf element tree to Xaml?

What is the best way to serialize a wpf element tree to xaml so that I can get a design time representation?

XamlWriter.Save is having serious limitations, and it can provide only the run-time representation

Probably Microsoft don't want any one to build a customized xaml designer with out much effort :(

As I understand, there is no direct way to get the design time representation of xaml from the visual tree. :)

You can study the source code of Mole and create your own code that can do it for you.

Mole For Visual Studio - With Editing - Visualize All Project Types

We have a XAML designer product which emplores a custom XAML serializer. As it is, that is the most useful solution for us. However, with .Net 4, there are a lot of great options (and helpers) for doing exactly that task. So, if you're not afraid of a little betaness, I would start looking there.

Check out what Guy Burstein has to say about it.

Just un clip the xml unit eliminator and reroute both partial array procedures into the wpf tree. then create the object as a time line.

simples

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM