title: Disable DispatcherTimer while a phone call is active on WP7
body: <p>My WP7 (silverlight) app keeps getting rejected because it "should not continue vibrating in the case of an incoming phone call". However, just reacting on the <code>Applicaton_Deactivated</code> event does not allow me to fix the problem since this method is not called on an incoming phone call...</p>
  
  <p>The problematic vibration is done through a <code>DispatcherTimer</code>, which keeps running in the background behind a phone call. Moving the execution to the main thread didn't change anything.</p>
  
  <p>Do apps just continue running normally behind phone calls? Or is there any way to stop the vibration?</p>
  
  <p><strong>Initialization of vibrator and timer:</strong></p>
  
  <pre><code>vibrator = VibrateController.Default;
  vibratorTimer = new DispatcherTimer();
  vibratorTimer.Tick += new EventHandler(vibrateRepatedly);
  vibratorTimer.Interval = new TimeSpan(0, 0, 0, 0, UIConstants.VIBRATION_INTERVAL);
  vibrationSpan = new TimeSpan(0, 0, 0, 0, UIConstants.VIBRATION_DURATION);
  </code></pre>
  
  <p><strong>Tick method:</strong></p>
  
  <pre><code>private void vibrateRepatedly(object sender, EventArgs e)
  {
      vibrator.Start(vibrationSpan);
  }
  </code></pre>