This is a mirror of official site: http://jasper-net.blogspot.com/

Resource in Silverlight , A Brief OverView – Part 1 (Resource Files)

| Wednesday, August 1, 2012
Resources are always a vital part for web application and here in Silverlight application too it plays an important role for creating Rich internet applications. In this context Resource means Images,audio,videos,object, which can be styles or datatemplete used for creating rich application. Silverlight does support various ways of storing resources and managing it. In this post, we will discover the different options available.

The complete information on resources will span across multiple posts ,where we will cover Binary Resource (Resource Files ) and XAML Resource .

Various Ways of managing Resources
In Silverlight Resources can be managed by following ways

Resource at server Side ,Loading on Demand
Resource embedded inside XAP/Assembly
Resources from external assemblies
The most important point ,we should not confuse over Assembly Resource and XAML Resource although both termed as resource .We can divide resource types in to two categories

Files other than executable or Binary/Assembly Resource (Managed through Resource Files)
Objects such as Styles,Templates etc.… or XAML Resource(Managed Through Resource Dictionary)
Basically the scope of this post is to give you a brief about Resource Files or Binary Resource or Assembly Resource .In this post we will explore how these resource files can be stored and managed from Silverlight .The subsequent post will focus on Resource Dictionary or XAML Resource.

Managing Resource Files
Before moving on the Resource Files lets have quick look into some important terminologies we will come across frequently

Application Package – The files packaged as a XAP file which includes the Silverlight assemblies and Application manifest files also Resources if any.

Application Root – The location where XAP files reside in the deployed solution most of the time ClientBin

URI - Stands for Uniform Resource Identifier , is the path to the the Resource.It can be either

...
...

Content:

Content option add the file to application package as loose resource .

Inline image 1

Here in the project Change the file BuildAction as Content and Rebuild the solution.The XAP file size is almost 42 KB which includes Image .

Inline image 2

Read more: ManasPatnak
QR: Inline image 3

Posted via email from Jasper-net

0 comments: