I have a multi project solution in which there is a project holding all the views and one holding the view models. In the project holding the views I have a folder (imaginatively called 'Images') which contains all of the images used in the various views.
Within one particular view I wish to have an image change dynamically at runtime so I have created a property of type System.Windows.Media.Imaging.BitmapImage in that view's view model and bound the imagesource of a button in the view to that property in xaml.
<!-- Login Button -->
<ribbon:Button ImageSourceSmall="{Binding Path=SecurityImage}" />
in the constructor of the viewmodel I have the following:
SecurityImage = New BitmapImage(New Uri("/FtpViews/Images/security_lock16.png",UriKind.Relative))
FtpViews is the name of the project containing the views.
If I have the Images folder in the same project as the view model referecing it I can get this to work, but I can't seem to get the uri reference to work correctly if the images folder is in another project in the solution. Either I have the notation of the Uri completely wrong (which is more that possible as I always seem to find that they are often a case of trial and error) or you can't actually reference resources in linked projects in this way.
I'd welcome any thoughts on this.
Thanks