没有混合.NET 4的控制默认模板 [英] .NET 4 control default templates without Blend

查看:145
本文介绍了没有混合.NET 4的控制默认模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

人们如何找到.NET控件的默认模板时,他们不能使用防爆pression混合?

How do people find the default templates of .NET controls when they can't use Expression Blend?

到目前为止,当我需要的WPF控件我去上codePLEX的WPF项目页面模板,浏览源$ C ​​$ C,通常见于Generic.xaml文件的默认模板。

So far, when I needed the templates for WPF controls I went to the WPF project page on Codeplex, browsed the source code and usually found the default templates in "Generic.xaml" files.

但现在我要找的框架控件的默认模板。我找不到它在codePLEX,我没有看到它无论是在由微软提供的.NET Framework源(XAML文件没有提供,只有的.cs文件)。

But now I am looking for the default template for the "Frame" control. I can't find it on Codeplex, and I don't see it either in the .NET framework source provided by MS (XAML files are not provided, only .cs files).

样式工具Snooper的给出了默认的模板,但它似乎逆向工程(不必要的冗长和引用内部类),而不是原来的干净清晰。

The Style Snooper tool gives a default template but it seems reverse-engineered (unnecessary lengthy and referencing internal classes) rather than being the original clean definition.

那么,如何才能穷人获得这些模板?

So, how do poor people get those templates?

推荐答案

1),你可以得到默认的模板,并seriallize到文件。

1) you can get default template and seriallize it to file.

var resource = Application.Current.FindResource(typeof(Control_Under_Interest));
using (XmlTextWriter writer = new XmlTextWriter(file_name, System.Text.Encoding.UTF8))
{
    writer.Formatting = Formatting.Indented;
    XamlWriter.Save(resource, writer);
}

2)反射器采用 BAML浏览器可以被用来获取资源字典从程序集。

2) Reflector with Baml Viewer may be used to get resources dictionaries from assemblies.

3) dotPeek 1.1 支持BAML拆卸。

3) dotPeek 1.1 supports BAML disassembling.

这篇关于没有混合.NET 4的控制默认模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆