开发者

.NET 4 control default templates without Blend

开发者 https://www.devze.com 2023-03-29 22:44 出处:网络
How do people find the default templates of .NET controls when they can\'t use Expression Blend? So far, when I needed the templates for WPF controls I went to the WPF project page on Codeplex, brows

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

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.

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 framew开发者_如何学JAVAork source provided by MS (XAML files are not provided, only .cs files).

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) 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) Reflector with Baml Viewer may be used to get resources dictionaries from assemblies.

3) dotPeek 1.1 supports BAML disassembling.


here is the link from zebi for .Net4.0.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号