Tutorials
SilverlightWhile one application assembly could be useful for certain Silverlight programs, Silverlight allows applications to be comprise many library assemblies. There are a number of reasons why you will want to consider using library assemblies within Silverlight.
Some of them include allowing developers to create factored and reusable units for UI or functionality which can be distributed via numerous applications, allowing third party developers to distribute or sell customized controls, and factor the application's US or code through the use of on-demand or in-package files. This can enhance download speed and application start up time. Additionally, a positive effect may be gained in terms of performance.
The Silverlight library assembly is largely composed of code and UI. You also have the option of implementing the UserControl, and this can be done with the code as well as the UI. Along with the application assemblies, you have the option of utilizing MSBuild to create the library assembly which holds both the functionality as well as the UI.
You should never create the application package simply because it forms the library assembly. The library assembly may either be deployed on-demand or in-package, but the choice is largely made by the developer. After you have generated the deployment for the library assembly, you will need to reference it via the application assembly.
You will need to either configure it on-demand or in-package when it comes to deployment. If you want to make use of in-package deployment, then you will need to put in a reference for the library assembly via the use of the Reference property inside the MSBuild project.
The configuration may cause the library assembly that has been referenced to be placed within the application package whenever it is constructed. Additionally, the SilverlightLibrary and SilverlightApplication will be downloaded after the application package has been downloaded. The UI as well as functionality may be encapsulated via the library assembly, and you may program against it through the use of code which is managed.
The deployment of library assemblies on-demand can lower the cost of downloading the application. To define the on demand deployment for the library assemblies, you will need to put in the MSBuild code along with the project configurations.
When it comes to the in-package library assembly, you will want to configure the application project file through the addition of a reference within the library package. At the same time, it will be necessary for you to designate the library assembly which will be referenced via the application project, and which may not be found within the application package once the assembly for the application is built.
By doing this, you will have the ability to generate code which is capable of using types via the library assembly as well as compiling it. As with the library assemblies which are in-package, you may program against the UI for the library assembly along with the functionality via the application assembly through the markup or code which is behind. At the same time, without requiring you to do larger amounts of work, the application will add an exception when it attempts to utilize any class via the library assembly.
First Page: Developing Applications in Silverlight