Silverlight - Image URI From Application Root

烈酒焚心 提交于 2019-12-11 05:15:17

问题


I have many Images like this in my various views:

<Image Height="32" Width="32" Source="../../Img/TemplateImgs/Icon_299a.png"></Image>

Is there any way to tell SL to load the image from the root of the app—something like Source="/Img/Foo.png"

I know I could bind to a URI from my ViewModel, and use the Uri constructor to achieve this, but I'd really prefer something simpler.

Thanks


回答1:


I think you would want to do something like Source="/COMPONENTNAME;component/Img/TemplateImgs/Icon_299a.png"



来源:https://stackoverflow.com/questions/5889290/silverlight-image-uri-from-application-root

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!