Map Tips and Images

620
3
02-07-2011 05:43 AM
MeConfused
New Contributor
I can display an image like this in a Maptip

<StackPanel Orientation="Horizontal">
         <Image x:Name="MyImage" Source="/Assets/images/i_zoomin.png" Stretch="None"></Image>
</StackPanel>


But I want to display an image reference from a field in the feature in the maptip
Field: ImageField
Value: Image.jpg

If I add all the images to the project I should be able to display them in the maptip, well thats what I am thinking....
I assume that I would have to bind the Field with the image name but then confused on how to get that image to show up and not the value in the field (imagename.jpg).

Any thoughts....

<Image x:Name="MyImage" Source=""/Assets/images/" & BIND: ImageField" Stretch="None"></Image>
0 Kudos
3 Replies
AliMirzabeigi
New Contributor
Try this:

<Image x:Name="MyImage" Source="{Binding ImageField, StringFormat='/Assets/images/{0}'}" />
0 Kudos
MeConfused
New Contributor
Thank you very much...although I had to put [] around the field name

<Image x:Name="MyImage" Source="{Binding [Image] , StringFormat='/Assets/images/{0}'}" Stretch="None"></Image>


Very appreciated.
0 Kudos
AliMirzabeigi
New Contributor
Correct! And I'm glad that you figured it out already 🙂
0 Kudos