c# - is a Field but used like a Type error -
did miss "using"? because how see use instance not type.
the error appears first time use of "settings"
using system; using system.collections.generic; using system.linq; using system.text; using system.xml; using system.windows.markup; namespace ampelthingy { class save { stringbuilder outstr = new stringbuilder(); xmlwritersettings settings = new xmlwritersettings(); settings.indent = true; settings.omitxmldeclaration = true; settings.newlineonattributes = true; xamldesignerserializationmanager dsm = new xamldesignerserializationmanager(xmlwriter.create(outstr, settings)); dsm.xamlwritermode = xamlwritermode.expression; xamlwriter.save(wrappanel1, dsm); string savedcontrols = outstr.tostring(); file.writealltext(@"aa.xaml", savedcontrols); } }
theres lot more wrong code, please wrap code in method.
you have
namespace { class { /* code*/ } }
it should wrapped in method:
namespace { class { save() { //do thing. } } }
Comments
Post a Comment