public static VibrationDevice GetDefault() { if (!_initializationAttempted && _instance == null) { var command = $"{JsType}.initialize()"; var initialized = Uno.Foundation.WebAssemblyRuntime.InvokeJS(command); if (bool.Parse(initialized) == true) { _instance = new VibrationDevice(); } _initializationAttempted = true; } return(_instance); }
public static VibrationDevice GetDefault() => _instance ?? (_instance = new VibrationDevice());
private void Btn_Vibrate_Click(object sender, RoutedEventArgs e) { Windows.Phone.Devices.Notification.VibrationDevice vd = VibrationDevice.GetDefault(); vd.Vibrate(TimeSpan.FromMilliseconds(500)); }