public ShakeViewModel() { service = new MulticastService(); service.StartService(); Accelerometer.ShakeDetected += ShakeDetected; if (Accelerometer.IsMonitoring) { Accelerometer.Stop(); } else { Accelerometer.Start(SensorSpeed.UI); } }