Bing Maps on WPF and custom PushPin tutorial for PixelSense

You may also like...

4 Responses

  1. Bruce says:

    Hey this was a great tutorial and much more valuable than anything that I have found to date. However, I am looking for a solution to a couple of different scenarios. The first, rather than defining a rectangle, I would like to define a custom image for the pushpin. The second, I would like to use what you have but modify the size of the rectangle based on the content (e.g. pushpin.content = “one” will require less space than pushpin.content = “five hundred and twenty”). Not really using those values but you get what I mean.

    Any pointers would be much appreciated!

  2. Dennis van der Stelt says:

    How to do an image can be found on many places, for example the answer on this question on Stackoverflow

    The size of the pin can also be adjusted by building another IValueConverter. Remember not to animate/adjust the size, but use transform to make it bigger. That’s performance wise much better.

  3. Faro says:

    Hi Dennis,

    do you know any way that the map can recognize an object when I put a tagged object on it?

  4. DanDes says:

    Thanks – I got this to work as a <UserControl.Resources> in my WPF Map UserControl. This made it possible to then reference the template in a Winforms application – which was my goal.
    The changes were, instead of <Windows.Resources>…</Windows.Resources> I put the template inside of a <UserControl.Resources>…</UserControl.Resources> block.
    Then in the Winforms application I used the resource template as follows…
    Dim custPinTemplate as System.Windows.Controls.ControlTemplate = [MyWPFUserControl].FindResource(“CustomPushpinTemplate”)
    I was then able to assign the template to the pushpin with
    MyPushpin.Tempate = custPinTemplate

    Now – if anyone has a hint on how I might use a small pushpin png file instead of all the drawing instructions, that would be helpful…

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *