Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
Sample code for "Add and Image using Map Elements"
posted

I have several questions on this one:

1.  Again, I can't get the example code to work.  I know about that problem with the order of the worldrect code and fixed that.  But I am not seeing an image show up.

2.  I don't understand the mapping between the value property in the element and the data template in the XAML.  Is there a way to add and delete an image using only C#?  I would like to dynamically add and delete images at high speed on the fly.

thanks,

Roger

  • 28496
    Suggested Answer
    Offline posted

    RogerFeeley said:
    I am not seeing an image show up.

    it worked okay for me.  did you copy a file called pizza.png to your ClientBin folder?  i have attached the sample project i used, perhaps it will work for you...

    RogerFeeley said:
    I don't understand the mapping between the value property in the element and the data template in the XAML

    The Value property can be displayed anywhere in the ValueTemplate, e.g.

    <DataTemplate>
       <TextBlock Text="{Binding Value}" />
    </DataTemplate>

    in order for the ValueTemplate to be displayed, a value must be set on each MapElement.

    RogerFeeley said:
    Is there a way to add and delete an image using only C#?  I would like to dynamically add and delete images at high speed on the fly.

    unfortunately not at this time; at least not through the map's API.

    SilverlightApplication51.zip