//从[ActivityBuilder]移除[ViewState] public static string removeViewState(ActivityBuilder activityBuilder) { string xamlString = ""; XmlWriterSettings writerSettings = new XmlWriterSettings { Indent = true }; StringBuilder stringBuilder = new StringBuilder(); XmlWriter xmlWriter = XmlWriter.Create(stringBuilder, writerSettings); XamlXmlWriter xamlXmlWriter = new XamlXmlWriter(xmlWriter, new XamlSchemaContext()); XamlWriter xamlWriter = ActivityXamlServices.CreateBuilderWriter(xamlXmlWriter); viewStateXamlWriter wfViewStateControl = new viewStateXamlWriter(xamlWriter); XamlServices.Save(wfViewStateControl, activityBuilder); xamlString = stringBuilder.ToString(); return(xamlString); }
//从[ActivityBuilder]移除[ViewState] public static string removeViewState(ActivityBuilder activityBuilder) { string xamlString = ""; XmlWriterSettings writerSettings = new XmlWriterSettings { Indent = true }; StringBuilder stringBuilder = new StringBuilder(); XmlWriter xmlWriter = XmlWriter.Create(stringBuilder, writerSettings); XamlXmlWriter xamlXmlWriter = new XamlXmlWriter(xmlWriter, new XamlSchemaContext()); XamlWriter xamlWriter = ActivityXamlServices.CreateBuilderWriter(xamlXmlWriter); viewStateXamlWriter wfViewStateControl = new viewStateXamlWriter(xamlWriter); XamlServices.Save(wfViewStateControl, activityBuilder); xamlString = stringBuilder.ToString(); return xamlString; }