Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

FrameworkSupported
WPF
Silverlight 45Silverlight 5
Windows Phone 8.0Image Modified
Windows Phone 78.1
Windows Phone RT 8.0Image Modified
Windows RT 8.1
Test/emulation service

Starting vibration

To start the vibration, use the following code (will vibrate for 250 ms). Note that the time span must be between 0 and 5 seconds.

Code Block
var dependencyResolver = this.GetDependencyResolver();
var vibrateService = GetService<IVibrateService>dependencyResolver.Resolve<IVibrateService>();
vibrateService.Start(new TimeSpan(0, 0, 0, 0, 250);

...

By default, the vibration stops automatically after the specified time span has passed. However, it is possible to stop the vibration manually.

Code Block
var dependencyResolver = this.GetDependencyResolver();
var vibrateService = GetService<IVibrateService>dependencyResolver.Resolve<IVibrateService>();
vibrateService.Stop();