0

It seems that holding method does not work since 2015:
Win10 App - Holding & Releasing the map to manipulate an element on the interface

or simply I don't know how to use it, anyway I need to manage a user holding on PC or mobile of a map.

My map is like a navigator, it follows the user position while it is moving, but when user use gesture to see the map around I have to stop the .center position of the user pushpin.

But I cannot find a way to understand when user move the map. The docs tell to use the holding event https://learn.microsoft.com/it-it/windows/uwp/maps-and-location/display-maps

but I've tried it on PC and my app doesnt enter in the holding event.

I've tried all the other events, only maptapped and actualcamerachanged works. but I don't know how to difference from a user move or a map .center move from the app.

Any help?

Thanks!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Uopo
  • 5
  • 2

2 Answers2

0

MapHolding doesn't fire immediately on Pointer down. It fires on a press and long hold after a delay, and only if the map isn't moved. It's intended for things like displaying a context menu (like right-click). The MapActualCameraChangingEventArgs for the ActualCameraChanging event should tell you if the map moved due to user interaction or due to being changed programmatically.

Duncan Lawler
  • 1,772
  • 8
  • 13
0

I resolved with a little of WinMerge and some try

you can find the FocusState.Pointer in sender when the user try to move the map, if not with the map.center you get a FocusState.Unfocused by the sender

private void Mappe_ActualCameraChanged(MapControl sender, MapActualCameraChangedEventArgs args)
         {
            if (sender.FocusState == FocusState.Pointer)
            {

            }

        }
Uopo
  • 5
  • 2