protected override async void OnPause() { base.OnPause(); // on pause turn off the flash _isFlashOn = await CameraActions.TurnOffFlash(_isFlashOn); }
protected override async void OnResume() { base.OnResume(); // on resume turn on the flash if (_isFlashOn) { _isFlashOn = await CameraActions.TurnOnFlash(_isFlashOn); } }
public async void OnClick() { if (_isFlashOn) { _isFlashOn = await CameraActions.TurnOffFlash(_isFlashOn); ImageActions.SwitchImage(_switchButton, _isFlashOn); } else { SoundActions.PlaySound(this, MediaPlayer); _isFlashOn = await CameraActions.TurnOnFlash(_isFlashOn); ImageActions.SwitchImage(_switchButton, _isFlashOn); } }