我想检测用户何时开始拖动MapControl
以从屏幕中心分离,但是Drag*
事件中没有一个被触发。
map.MapTapped += Map_MapTapped;
map.ActualCameraChanged += Map_ActualCameraChanged;
map.DragEnter += Map_DragEnter;
map.DragStarting += Map_DragStarting;
map.DragLeave += Map_DragLeave;
map.DragOver += Map_DragOver;
map.ManipulationStarted += Map_ManipulationStarted;
map.Tapped += Map_Tapped;
map.PointerPressed += Map_PointerPressed;
map.PointerMoved += Map_PointerMoved;
我看到的唯一事件是MapTapped
和ActualCameraChanged
,但是当我需要时,这些事件都不会触发。
答案 0 :(得分:0)
拖动时使用ActualCameraChanging
上升事件
<Maps:MapControl Name="MyMap" ActualCameraChanging="MyMap_ActualCameraChanging"/>
使用ChangeReason
检查拖动原因
private void MyMap_ActualCameraChanging(MapControl sender, MapActualCameraChangingEventArgs args)
{
if(args.ChangeReason == MapCameraChangeReason.UserInteraction)
{
//...
}
}