Monday 7 July 2014

Silverlight image is not coming in the Silverlight UI

Silverlight image is not coming in the Silverlight UI
Silverlight image is not working
Silverlight image is not coming

1. How Silverlight will work is, SL will place all the files in to xap file.
Xap path: C:\[Application folder Name]\ ClientBin\[SolutionName].xap
Just copy above .xap file and paste it some other path.
Now change the extention of the .xap to .zip.
Unzip above file, you can see all the dlls , AppManifest, images and icon.
Images and icons should be available in Resources\Images and Resources\Icons folders respectively.
Now check Resources\Images weather your image is there or not.
If your image is not there then it will not come in SL UI.
2. What to do: to get the image into Resources\Images.
3. Open Silverlight Application.
4. Go to Image which u r expecting.
5. Right click go to properties. Check Build Action should be “Content”.

6. Now build the SIlverLight Application and Run the application, your image will come in the SL UI.
Note: Your image will be available in Resources\Images folder.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Each file in a Silverlight project file has an associated BuildAction property that tells MSBuild what to do with it when your project is built
Certain file types are given default values for the BuildAction which make the most (only!) sense for certain file types:
“XAML type” files like UserControl and Page are given “Page” build action
Code Files (.cs and .vb) have “Compile”
App.XAML will has its BuildAction set to “Application Definition”. This defines the entry point of your application.
Although some values in the Build Action dropdown are not Silverlight related, they are not disabled, hidden or otherwise “grayed out” to prevent you form hurting yourself. You can set a bitmap resource file to “Entity Deploy” and all is fine – until you compile.
The “non-Silverlight” related BuildActions are:
SplashScreen: is for WPF applications and is explained perfectly here.
EntityDeploy: is used by the ADO.NET Entity Framework
Embedded Resource: This is a classic gotcha in that Silverlight resources must always use “Resource”, not “Embedded Resource” which is WPF related and the file format used can’t be understood by Silverlight.
Your first meeting with the BuildAction property value will probably be in relation to resource files that you want to make available to your application. The Three Silverlight related Resource BuildAction values are:
None: the resource file will not be a part of the application assembly or the XAP. It will be available on the server for specific access and use.
Resource: the file is embedded into the application assembly
Content: MSBuild will include the file in the application package without embedding it in the project assembly which is the choice if multiple assemblies need access to it.