方法有使用xamlpadX,blend工具, 还有用程序:
privatestring GetDefinitionOfControlTemplate(ControlTemplate template)
{
XmlWriterSettings settings = newXmlWriterSettings();
settings.Indent = true;
StringBuilder sb = newStringBuilder();
XmlWriter writer = XmlWriter.Create(sb, settings);
XamlWriter.Save(template, writer);
return sb.ToString();
}
http://learnwpf.com/Posts/Post.aspx?postId=a3e4319b-b790-40b6-b92a-4b9b0b9d65b9