开发者

Silverlight - Image URI From Application Root

开发者 https://www.devze.com 2023-03-03 02:13 出处:网络
I have many Images like this in my various views: <Image Height=\"32\" Width=\"32\" Source=\"../../Img/TemplateImgs/Icon_299a.png\"></Image>

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消