How to control MapControl pushpin text from click events

Apptacular Apps 386 Reputation points
2020-07-19T00:04:16.907+00:00

I'm trying to use some pushpins I've added to my MapControl to be manipulated as desired but for some reason, my pushpin marker is not found despite being declared in XAML.

In this instance, what would be the correct way to find the relevant items to achieve the following?:

  • Show text above pushpin (if collapsed) when the pushpin is clicked
  • Hide text label above pushpin (if visible) when the pushpin is clicked, or, if any other area of the MapControl is clicked (both outside the pushpin and text label)
  • Ensure only 1 pushpin text label is visible at anytime (to prevent overlapping labels)

XAML

https://pastebin.com/pWQigeUt

C#

https://pastebin.com/ihQTaczU

Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Fay Wang - MSFT 5,191 Reputation points
    2020-07-20T02:52:02.663+00:00

    Hello,

    Welcome to Microsoft Q&A!

    For your requirement, you can simply use flyout to achieve it. Flyouts can be attached to Button, when you click the Button, it will appear above the button by default and when you click the Button again or other places, the Flyout will display. For more information about how to achieve it, you can check the following txt file which contains the xaml layout.

    Thanks.

    0 comments No comments