void HandleButtonClick() { ClicksNumber++; ClicksLeft = ClicksLimit - ClicksNumber; if (ClicksNumber >= ClicksLimit) // Alarm kapa { DependencyService.Get <IAudio>().Stop(); _stopped = true; vibrator.Cancel(); OnAlarmTurnedOff?.Invoke(this, new EventArgs()); } }
public void AddShake(object sender, EventArgs args) { ShakeCount++; ShakesLeft = _shakeLimit - ShakeCount; if (ShakeCount == _shakeLimit) { // alarm stopped DependencyService.Get <IAudio>().Stop(); _stopped = true; // Rotation = 0; manager.UnregisterListener(ss); manager.Dispose(); ss.Dispose(); OnAlarmTurnedOff?.Invoke(this, new EventArgs()); } }