To create a shell from application
- Create a new Silverlight Composite Application (For more information please see
the
previous post)
- This is the first method of shell creation. Shell is the Page class initialized
in App.xaml.cs Application_Startup method
To create a shell from Scab module
- Create a new Silverlight Class Library project. It will contain your shell.
- Add reference to Elisy.Scab.dll assembly. The last version you can find at Downloads page.
- Create a new Silverlight User Control in the module assembly. It is a shell.
- Create a new class and inherit it from Elisy.Scab.Module. It is a module creating the shell.
- Override shell module ApplicationStarting method to create app.RootVisual like this:
app.RootVisual = new Shell();.
- Create a new Silverlight Composite Application. For more information please see the previous post.
- Add reference to shell module application.
- Remove Page.xaml / Page.xaml.cs files from application and remove the RootVisual creation from Application_Startup event handler.
- In App.xaml declare xmlns referring to shell module in shell module assembly and add the shell module into Application.Resources with x:Key value like:
<Application.Resources>
<shellmodule:ShellModule x:Key="ShellModule"/>
</Application.Resources>
- Run your application.
Example
ShellModule.zip (72.69 kb)
The following example contains application and shell module projects. Shell module assembly declares ShellModule class creating Shell user control. Application App.xaml declares ShellModule in Application.Resources with x:Key="ShellModule".
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5