void OnRotaryChanged(ERotaryEventArgs args) { _rotated?.Invoke(this, new RotaryEventArgs() { IsClockwise = args.IsClockwise }); }
/// <summary> /// Handles execution of Rotated event /// </summary> /// <param name="args">RotaryEvent Args</param> private void RotaryEventManager_Rotated(ElmSharp.Wearable.RotaryEventArgs args) { _currentMoveTime = DateTime.Now; var span = _currentMoveTime - _lastMoveTime; _lastMoveTime = _currentMoveTime; if (span.TotalMilliseconds <= 4) { return; } if (args.IsClockwise) { if (_currentScreen == 3) { return; } SwitchScreen(_currentScreen + 1); } else { if (_currentScreen == 0) { return; } SwitchScreen(_currentScreen - 1); } }
/// <summary> /// Rotated event handler /// </summary> /// <param name="args">Rotary event arguments.</param> private void OnRotated(ElmSharp.Wearable.RotaryEventArgs args) { if (args.IsClockwise) { ZoomLevel++; } else { ZoomLevel--; } }