using System.Xml.Linq; public static void Serialize() { TextBlock tb =new TextBlock(); Grid container = new Grid(); container.Childen.Add(tb); try { [COLOR="Green"]//works just fine because it was created by my code[/COLOR] Print(XamlWriter.Save(container)); [COLOR="Green"]//works just fine because it was created from my xaml file[/COLOR] Print(XamlWriter.Save(containerFromXaml)); [COLOR="Green"] //works on many controls created by NinjaTrader.[/COLOR] Print(XamlWriter.Save(buttonBuyMkt)); [B][COLOR="Green"]//throws an exception for many UI controls created by the platform[/COLOR] [COLOR="Red"] //Error: "Constructor on type 'NinjaTrader.Core.CoreEnumConverter' not found."[/COLOR][/B] Print(XamlWriter.Save(existingContainer)); } catch(Exception e) { Print(e.Message); } }
Please help!
Thanks
Comment