I had previously posted that this was a bug I had confirmed myself, which remains true. The workaround however is easy and has desirable side effects in terms of design. The correct means / workaround of instantiating the outer most container for a full-page experience - for instance in the case where you have a page-like type which has some extensive base functionality, such as layout handling - you will want to insure that you are using the new Silverlight Xap architecture. So, you would:
-
Make sure you have added a System.Windows.Application derived Application object to your Silverlight application.
-
Then set the application as the startup object from the Silverlight Application properties pages (Silverlight tab, Startup Object dropdown)
-
The default application implementation supplied by Visual Studio will hook the Application event called "Startup" and provide you with an empty event handling method. The method will be named "Application_Startup".
-
In the code for this method, simply instantiate your strongly typed container class/control, assigning it to the Application's RootVisual property
-
Example:
public DemoApp()
{
this.Startup += this.Application_Startup;
this.Exit += this.Application_Exit;
this.UnhandledException += this.Application_UnhandledException;
InitializeComponent();
}
private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new DemoPage(); //This can be any type in the application assembly/project or any other referenced Silverlight assembly
}
This is a reasonable and desirable workaround, since you get the benefits of the Xaml Application, which provides the custom/stock splash screen feature. I am sure this parser issue was a side-effect of a "by design" decision, and/or the direct Xaml load case was not caught during unit testing. In any case, the alternative is more desirable in overall behavior. I hope this helps anyone who may be puzzled by the AG_E parser error from the previous loading technique typically used in Alpha 1.1.
-Rod Kestler
CTO, Hatch Innovations, LLC