Resource path in Silverlight

Source: Internet
Author: User

SilverlightResources in

1. Use resource files in the same component

1,XAMLFile and resource file directory are at the same level

UseImageExample

<Image X: Name = "image1" Source = "images/xxx.png"/>

 

ImagesFolder andMainpage. XAMLThe file is in the same-level directory.

 

2,XAMLDifferent levels of files and resource folders

<Image X: Name = "image1" Source ="../Images/xxx.png"/>

 

ImagesFolder andRollingtire. XAMLDifferent file levels

 

ImagesSet the image attribute in the fileResource

 

 

 

2. Use resource files from other components

Format:/Component name; Component/Resource file relative path and file name

For example:

<Image X: Name = "image1" Source = "/silverlightassetresourceclasslibrary; component/images/limingch.png"/>

UsedSilverlightassetresourceclasslibraryIn this componentImages/limingch.pngThis file

 

3. Use content files in the same encapsulation and Other encapsulation

 

Set the attribute of the resource file to content

 

1, Same Encapsulation

ImagesFolder andMainpage. XAMLFile level

Use content filesImages/podium.pngAs the image source, be sureUriAdd a slash (/)

<Image X: Name = "podium" Source = "/images/xxx.png"/>

 

2Different packages

Use content filesImages/podium.pngAs the image source, you do not haveUriAdd a slash (/)

<Image X: Name = "podium" Source = "images/xxx.png"/>

 

4. Use the website source file

<Image X:Name= "Large"Source= "/Images/xxx.png"/>

ImagesFolder can only be placed inClientbinFolder, that is, andXapPackage level

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.