获得default control template of a control

  方法有使用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

posted on 2008-11-30 14:11  oyl  阅读(175)  评论(0编辑  收藏  举报

导航