我从MSDN Website
复制此代码string xaml = "<Ellipse Name=\"EllipseAdded\" Width=\"300.5\" Height=\"200\" Fill=\"Red\" \"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"/>";
object ellipse = XamlReader.Load(xaml);
但我抛出错误
The text associated with this error code could not be found. illegal
qualified name character [Line: 1 Position: 68]
请帮我修理一下。感谢
答案 0 :(得分:1)
请尝试以下XAML,似乎缺少xmlns。
string xaml = "<Ellipse Name=\"EllipseAdded\" Width=\"300.5\" Height=\"200\" Fill=\"Red\" xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"/>";