private Interop.ViewOnEventCallback _viewReadyEventCallback;
private event EventHandler<MapGestureEventArgs> _scrolledEventHandler;
- private event EventHandler<MapGestureEventArgs> _zoomedEventHandler;
- private event EventHandler<MapGestureEventArgs> _tappedEventHandler;
- private event EventHandler<MapGestureEventArgs> _doubleTappedEventHandler;
- private event EventHandler<MapGestureEventArgs> _twoFingerTappedEventHandler;
- private event EventHandler<MapGestureEventArgs> _rotatedEventHandler;
+ private event EventHandler<MapGestureEventArgs> _twoFingerZoomedEventHandler;
+ private event EventHandler<MapGestureEventArgs> _clickedEventHandler;
+ private event EventHandler<MapGestureEventArgs> _doubleClickedEventHandler;
+ private event EventHandler<MapGestureEventArgs> _twoFingerClickedEventHandler;
+ private event EventHandler<MapGestureEventArgs> _twoFingerRotatedEventHandler;
private event EventHandler<MapGestureEventArgs> _longPressedEventHandler;
private event EventHandler _viewReadyEventHandler;
this.Resize(1, 1);
// We need to keep Gesture Tap event enabled for object event to work
- handle.SetGestureEnabled(Interop.ViewGesture.Tap, true);
+ handle.SetGestureEnabled(Interop.ViewGesture.Click, true);
SetObjectEventCallback();
}
/// </summary>
/// <value>Event handlers to get zoomed gesture event</value>
/// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception>
- public event EventHandler<MapGestureEventArgs> ZoomChanged
+ public event EventHandler<MapGestureEventArgs> TwoFingerZoomed
{
add
{
SetGestureEventCallback();
handle.SetGestureEnabled(Interop.ViewGesture.Zoom, true);
- _zoomedEventHandler += value;
- Log.Info(string.Format("ZoomChanged event handler is added"));
+ _twoFingerZoomedEventHandler += value;
+ Log.Info(string.Format("TwoFingerZoomed event handler is added"));
}
remove
{
- _zoomedEventHandler -= value;
- Log.Info(string.Format("ZoomChanged event handler is removed"));
- if (_zoomedEventHandler == null)
+ _twoFingerZoomedEventHandler -= value;
+ Log.Info(string.Format("TwoFingerZoomed event handler is removed"));
+ if (_twoFingerZoomedEventHandler == null)
{
handle.SetGestureEnabled(Interop.ViewGesture.Zoom, false);
UnsetGestureEventCallback();
add
{
SetGestureEventCallback();
- //handle.SetGestureEnabled(Interop.ViewGesture.Tap, true);
- _tappedEventHandler += value;
+ //handle.SetGestureEnabled(Interop.ViewGesture.Click, true);
+ _clickedEventHandler += value;
Log.Info(string.Format("Clicked event handler is added"));
}
remove
{
- _tappedEventHandler -= value;
+ _clickedEventHandler -= value;
Log.Info(string.Format("Clicked event handler is removed"));
- if (_tappedEventHandler == null)
+ if (_clickedEventHandler == null)
{
- //handle.SetGestureEnabled(Interop.ViewGesture.Tap, false);
+ //handle.SetGestureEnabled(Interop.ViewGesture.Click, false);
UnsetGestureEventCallback();
}
}
add
{
SetGestureEventCallback();
- handle.SetGestureEnabled(Interop.ViewGesture.DoubleTap, true);
- _doubleTappedEventHandler += value;
+ handle.SetGestureEnabled(Interop.ViewGesture.DoubleClick, true);
+ _doubleClickedEventHandler += value;
Log.Info(string.Format("DoubleClicked event handler is removed"));
}
remove
{
- _doubleTappedEventHandler -= value;
+ _doubleClickedEventHandler -= value;
Log.Info(string.Format("DoubleClicked event handler is removed"));
- if (_doubleTappedEventHandler == null)
+ if (_doubleClickedEventHandler == null)
{
- handle.SetGestureEnabled(Interop.ViewGesture.DoubleTap, false);
+ handle.SetGestureEnabled(Interop.ViewGesture.DoubleClick, false);
UnsetGestureEventCallback();
}
}
/// </summary>
/// <value>Event handlers to get clicked gesture event</value>
/// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception>
- public event EventHandler<MapGestureEventArgs> TwoFingerPressed
+ public event EventHandler<MapGestureEventArgs> TwoFingerClicked
{
add
{
SetGestureEventCallback();
- handle.SetGestureEnabled(Interop.ViewGesture.TwoFingerTap, true);
- _twoFingerTappedEventHandler += value;
- Log.Info(string.Format("TwoFingerPressed event handler is added"));
+ handle.SetGestureEnabled(Interop.ViewGesture.TwoFingerClick, true);
+ _twoFingerClickedEventHandler += value;
+ Log.Info(string.Format("TwoFingerClicked event handler is added"));
}
remove
{
- _twoFingerTappedEventHandler -= value;
- Log.Info(string.Format("TwoFingerPressed event handler is removed"));
- if (_twoFingerTappedEventHandler == null)
+ _twoFingerClickedEventHandler -= value;
+ Log.Info(string.Format("TwoFingerClicked event handler is removed"));
+ if (_twoFingerClickedEventHandler == null)
{
- handle.SetGestureEnabled(Interop.ViewGesture.TwoFingerTap, false);
+ handle.SetGestureEnabled(Interop.ViewGesture.TwoFingerClick, false);
UnsetGestureEventCallback();
}
}
/// </summary>
/// <value>Event handlers to get rotated gesture event</value>
/// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception>
- public event EventHandler<MapGestureEventArgs> Rotated
+ public event EventHandler<MapGestureEventArgs> TwoFingerRotated
{
add
{
SetGestureEventCallback();
- handle.SetGestureEnabled(Interop.ViewGesture.Rotate, true);
- _rotatedEventHandler += value;
+ handle.SetGestureEnabled(Interop.ViewGesture.Rotation, true);
+ _twoFingerRotatedEventHandler += value;
Log.Info(string.Format("Rotated event handler is added"));
}
remove
{
- _rotatedEventHandler -= value;
+ _twoFingerRotatedEventHandler -= value;
Log.Info(string.Format("Rotated event handler is removed"));
- if (_rotatedEventHandler == null)
+ if (_twoFingerRotatedEventHandler == null)
{
- handle.SetGestureEnabled(Interop.ViewGesture.Rotate, false);
+ handle.SetGestureEnabled(Interop.ViewGesture.Rotation, false);
UnsetGestureEventCallback();
}
}
switch (eventArg.GestureType)
{
case GestureType.Scroll: _scrolledEventHandler?.Invoke(this, eventArg); break;
- case GestureType.Zoom: _zoomedEventHandler?.Invoke(this, eventArg); break;
- case GestureType.Tap: _tappedEventHandler?.Invoke(this, eventArg); break;
- case GestureType.DoubleTap: _doubleTappedEventHandler?.Invoke(this, eventArg); break;
- case GestureType.TwoFingerTap: _twoFingerTappedEventHandler?.Invoke(this, eventArg); break;
- case GestureType.Rotate: _rotatedEventHandler?.Invoke(this, eventArg); break;
+ case GestureType.Zoom: _twoFingerZoomedEventHandler?.Invoke(this, eventArg); break;
+ case GestureType.Click: _clickedEventHandler?.Invoke(this, eventArg); break;
+ case GestureType.DoubleClick: _doubleClickedEventHandler?.Invoke(this, eventArg); break;
+ case GestureType.TwoFingerClick: _twoFingerClickedEventHandler?.Invoke(this, eventArg); break;
+ case GestureType.Rotation: _twoFingerRotatedEventHandler?.Invoke(this, eventArg); break;
case GestureType.LongPress: _longPressedEventHandler?.Invoke(this, eventArg); break;
}
};
private void UnsetGestureEventCallback()
{
- if (_scrolledEventHandler != null || _zoomedEventHandler != null
- || _tappedEventHandler != null || _doubleTappedEventHandler != null
- || _twoFingerTappedEventHandler != null || _rotatedEventHandler != null
+ if (_scrolledEventHandler != null || _twoFingerZoomedEventHandler != null
+ || _clickedEventHandler != null || _doubleClickedEventHandler != null
+ || _twoFingerClickedEventHandler != null || _twoFingerRotatedEventHandler != null
|| _longPressedEventHandler != null)
{
return;
var eventArg = new Interop.ObjectEventDataHandle(eventData);
switch (eventArg.GestureType)
{
- case Interop.ViewGesture.Tap:
- {
- var mapObject = _handleToObjectTable[eventArg.ViewObject];
- mapObject?.HandleClickedEvent();
- break;
- }
+ case Interop.ViewGesture.Click:
+ {
+ var mapObject = _handleToObjectTable[eventArg.ViewObject];
+ mapObject?.HandleClickedEvent();
+ break;
+ }
}
};
handle.SetEventCb(Interop.ViewEventType.Object, _objectEventCallback, IntPtr.Zero);