This article contains the information you need to know about Silverlight Composite Application Creation. The example containing complex application definition is included.
To create a simple application
This approach allows you to create simple Scab application fast.
- Create a new Silverlight Application
- Add reference to Elisy.Scab.dll assembly. The last version you can find at Downloads page.
- Inherit your App application class from ScabApplication. It declared in App.cs file.
- For Silverlight 2 beta 2 edit App.g.cs file to inherit App class from ScabApplication.
To create a more complex application
Scab Application.zip (42.80 kb)
This approach extracts App.xaml configuration file into the Xap package. Later it
can be configured on server side.
- Create a new Silverlight Application.
- Add reference to Elisy.Scab.dll assembly.
- Rename App.xaml file to App1.xaml in your solution.
- Create new class App.cs and copy App1.xaml.cs content into App.cs file.
- Inherit App class from Elisy.Scab.ScabApplication.
- Replace
InitializeComponent(); in App constructor by the System.Windows.Application.LoadComponent(this,
new System.Uri("App.xaml", System.UriKind.Relative));
- Create a new XML file item in your solution and name it "App.xaml".
- Copy App1.xaml content into App.xaml.
- Change App.xaml file Build Action to "Content"
- Delete App1.xaml and App1.xaml.cs files.
Optional step. To create a common assembly.
You can create optional common assembly to distribute it to module developers. It
can contain interface definitions, constants, shell x:Name names, common resource
x:Key names etc. All application modules will reference it and all application elements
will work in single environment. The example of shell x:Name name definitions is:
public class Shell
{
//Level 0 Control
public static readonly string ROOT = "ShellRoot";
//Level 1 Controls
public static readonly string LEFT_PLACEHOLDER = "ShellLeftPlaceholder";
public static readonly string TOP_PLACEHOLDER = "ShellTopPlaceholder";
public static readonly string RIGHT_PLACEHOLDER = "ShellRightPlaceholder";
public static readonly string BOTTOM_PLACEHOLDER = "ShellBottomPlaceholder";
public static readonly string OVERLAYS = "ShellOverlays";
//Level 2 Controls
public static readonly string FRONT_OVERLAY = "ShellFrontOverlay";
public static readonly string LAYERS_OVERLAY = "ShellLayersOverlay";
public static readonly string COPYRIGHTS_STACK_PANEL = "FrontOverlayCopyrightsStackPanel";
}
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5