简体   繁体   English

将wpf元素树序列化为Xaml的最佳方法是什么?

[英]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? 将wpf元素树序列化为xaml的最佳方法是什么,以便我可以获得设计时表示?

XamlWriter.Save is having serious limitations, and it can provide only the run-time representation XamlWriter.Save具有严重的局限性,它只能提供运行时表示

Probably Microsoft don't want any one to build a customized xaml designer with out much effort :( 可能微软不希望任何人用很多努力建立一个自定义的xaml设计师:(

As I understand, there is no direct way to get the design time representation of xaml from the visual tree. 据我所知,没有直接的方法从视觉树中获取xaml的设计时间表示。 :) :)

You can study the source code of Mole and create your own code that can do it for you. 您可以学习Mole的源代码并创建自己的代码,可以为您完成。

Mole For Visual Studio - With Editing - Visualize All Project Types 适用于Visual Studio的Mole - 使用编辑 - 可视化所有项目类型

We have a XAML designer product which emplores a custom XAML serializer. 我们有一个XAML设计器产品,它可以使用自定义XAML序列化器。 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. 但是,对于.Net 4,有很多很棒的选项(和助手)可以完成这项任务。 So, if you're not afraid of a little betaness, I would start looking there. 所以,如果你不害怕一点beta,我会开始寻找那里。

Check out what Guy Burstein has to say about it. 看看Guy Burstein对此有何看法。

Just un clip the xml unit eliminator and reroute both partial array procedures into the wpf tree. 只需取消剪辑xml单元消除器并将两个部分数组过程重新路由到wpf树中。 then create the object as a time line. 然后将对象创建为时间线。

simples simples

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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