Compile time error1. Does not contain a definition for InitializeFromXaml
//Beta 1
System.IO.Stream s = this.GetType().Assembly.GetManifestResourceStream("MyNamespace.UserControl1.xaml");
FrameworkElement control = this.InitializeFromXaml(new System.IO.StreamReader(s).ReadToEnd());
//Beta 2
Application.LoadComponent(control, new Uri(";component/ .xaml", UriKind.Relative));
OR
//Beta 2
System.IO.Stream s = this.GetType().Assembly.GetManifestResourceStream("MyNamespace.UserControl1.xaml");
FrameworkElement control = XamlReader.Load(new System.IO.StreamReader(s).ReadToEnd()) as Control;
Please note that <projectname> should be replaced by the VS 2008 project name or assembly dll name. component is a constant word and <classname> should be replaced by your .NET Class name of the User Control
Compile time error
2. No overload for method Load takes 2 arguments
//Beta 1
XamlReader.Load(string,boolean)
This function parses a well-formed XAML fragment and creates a corresponding Silverlight object tree, and returns the root of the object tree.
//Beta 2
XamlReader.Load(string)
No comments:
Post a Comment