zoukankan      html  css  js  c++  java
  • GetTemplateXamlCode

    转载在: http://www.cnblogs.com/zhouyinhui/archive/2007/03/28/690993.h

    string GetTemplateXamlCode(Control ctrl)
            {
    
                FrameworkTemplate template = ctrl.Template;
    
                string xaml = "";
    
                if (template != null)
                {
                    
                    XmlWriterSettings settings = new XmlWriterSettings();
                    settings.Indent = true;
                    settings.IndentChars = new string(' ', 4);
                    settings.NewLineOnAttributes = true;
    
                    StringBuilder strbuild = new StringBuilder();
                    XmlWriter xmlwrite = XmlWriter.Create(strbuild, settings);
    
                    try
                    {
                        XamlWriter.Save(template, xmlwrite);
                        xaml = strbuild.ToString();
                    }
                    catch (Exception exc)
                    {
                        xaml = exc.Message;
                    }
                }
                else
                {
                    xaml = "no template";
                }
    
                return xaml;
            }
    

  • 相关阅读:
    SQLI DUMB SERIES-12
    SQLI DUMB SERIES-11
    SQLI DUMB SERIES-9&&10
    SQLI DUMB SERIES-8
    SQLI DUMB SERIES-7
    XXS level10
    XXS level9
    XXS level8
    XXS level7
    XXS level6
  • 原文地址:https://www.cnblogs.com/xiaokang088/p/2000722.html
Copyright © 2011-2022 走看看