locked
Make clickable UI-elements for windows Phone 8.1 apps maps RRS feed

  • Question

  • Windows Phone 8.1 App , C#

    I would like to let the user add Pushpins ( which apparently are called MapIcons ) to the map and when the user clicks the newly created Pushpin some other ui-elements should appear.

    But apparently MapIcons are not clickable and you can not inherit from them since they are sealed, so no luck in making them clickable.

    I tried to just extend from Windows.UI.Xaml.Controls.Button , but those have not Location, probably because the do not belong to the Windows.UI.Xaml.Controls.Maps-namespace. So I can not really add them to the Windows.UI.Xaml.Controls.Maps.MapControl.Children or Windows.UI.Xaml.Controls.Maps.MapControl.MapElements, since they will not be on the map where I would want them to be.

    So how do you make a clickable ui-element that I can give a location on the map?

    I already was here

    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn792121.aspx#showing_xaml_controls_and_shapes_on_the_map

    But I don't see how I can add clickable elements to my map

    I could write something like this of course

            <Maps:MapControl Grid.Row="1"
                x:Name="map"
                MapServiceToken="token"
                >
                <Maps:MapIcon>
                </Maps:MapIcon>
                
            </Maps:MapControl>

    But this MapIcon again is not clickable and it also staticly coded. I want to add mine dynamic.

    Wednesday, April 1, 2015 5:06 PM

Answers