问题
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