Can I set the base path outside of my application directory when binding an image source path to a r

Posted by zimmer62 on Stack Overflow See other posts from Stack Overflow or by zimmer62
Published on 2010-04-08T20:33:51Z Indexed on 2010/04/09 3:43 UTC
Read the original article Hit count: 446

Filed under:
|
|
|
|

So I'm trying to display an image that is ouside the path of my application. I only have a relative image path such as "images/background.png" but my images are somewhere else, I might want to choose that base location at runtime so that the binding maps to the proper folder. Such as "e:\data\images\background.png" or "e:\data\theme\images\background.png"

<Image Source="{Binding Path=ImagePathWithRelativePath}"/>

Is there any way to specify either in XAML or code behind a base directory for those images?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about c#