During the developement of the silverlight application we should conscious about the .xap file size because silverlight we used to create Rich internet application.
So if the .xap file size is more then it takes more time to download the .xap file to the users local machine ,which is not good for the user experience.
Generally in the web application we used some image file or some times video files or other files .So in the silvelright application if we are included some image,video files then it reallly increases the size of the .xap file significantly.So we should not included these files in the silverlight application.
Whenever we add some files in the silverlight application ,If we go to the properties of the included file then we find Build Action: Where we find values like content,Resource,None,embedded Resource etc. .So what does these values of build action mean for the application and how it affects the application.
1..If we select the Resource(default selected) then it is included in the dll that is created for the application , you see that by saving the .xap file as .zip file and extract the zip file then use the reflector to get the files.
so it is included in the xap file so it does not help so as it takes time.
2..If we select the Content then it is included in the .xap that is created for the application , you see that by saving the .xap file as .zip file and extract the zip file .So this way also we are not interested.
3..I think the best way :But in this way we need to move manually all files to the server,in the 1and 2 option we do not manually move the files as xap file itself contains all the files.
Put the file in the web project and user the below way to work it .
<Image x:Name="Images" Grid.Row="0" Tag="/Images/Animals/Koala.jpg"
Your image is inside "Images/Animals/Koala.jpg" folder of the web project .
public class PathToUriConverter:IValueConverter
object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
return new Uri(App.Current.Host.Source,value.ToString());
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
throw new NotImplementedException();
Hopes this will help you ,Happy coding