private async void Instance_ShakeGesture(object sender, ShakeGestures.ShakeGestureEventArgs e)
 {
     await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
     {
         await vm.FetchTasksAsync();
     });
 }
Esempio n. 2
0
 private void ResetOnShake(object sender, ShakeGestureEventArgs e)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         abacus.Reset();
     });
 }
Esempio n. 3
0
 private void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
        drawCanvas.Children.Clear();
     });
 }
 private void OnShakeOnShakeGesture(object sender, ShakeGestureEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         VibrationDevice.GetDefault().Vibrate(TimeSpan.FromSeconds(0.5));
         ShakeDaruma(2000);
     });
 }
 private void Perform_Shakeevent(object sender, ShakeGestureEventArgs e)
 {
     //Enclose the task you need to perform in the following dispatcher code
     Dispatcher.BeginInvoke(() =>
     {
        // displayblock.Text = DateTime.Now.ToLongTimeString();
         Media.Play();
     });
 }
 private void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
 {
     _lastUpdateTime.Dispatcher.BeginInvoke(
         () =>
         {
             _lastUpdateTime.Text = DateTime.Now.ToString();
             CurrentShakeType = e.ShakeType;
         });
     System.Diagnostics.Debug.WriteLine(DateTime.Now.Minute + ":" + DateTime.Now.Second + ":" + DateTime.Now.Millisecond + "  " + e.ShakeType);
 }
 private void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         if (mainView != null)
         {
             mainView.ShakeReceived();
         }
     });
 }
Esempio n. 8
0
 // Set the data context of the TextBlock to the answer.
 void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
 {
     try
     {
         // Cancel any speech in progress
         _Synthesizer.CancelAll();
     }
     catch
     {
         // Eat it
     }
 }
        private void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
            {
                double h = WaveImg.Height;

                //Calculate progress in percent
                int progress = (int)(((h - 20) / BarRect.Height) * 100);
                ProgressTxt.Text = progress.ToString() + " %";

                //Stop the animation
                FillStoryboard.Stop();
                //Full Shake
                if (h >= BarRect.Height)
                {
                    WaveImg.Height = BarRect.Height;
                    ProgressTxt.Text = "100 %";
                    ShakeGesturesHelper.Instance.Active = false;

                    //Wait about 400ms more and raise Full Shake event
                    DispatcherTimer timer = new DispatcherTimer();
                    timer.Interval = TimeSpan.FromMilliseconds(400);
                    timer.Tick += timer_Tick;
                    timer.Start();

                    return;
                }
                //Setup and start animation
                FillAnimation.From = h;
                FillAnimation.By = NumofFillperShake;
                FillStoryboard.Begin();
            });
        }
 private void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
 {
     // Because this is on a diffrent thread or something
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         // Clear Canvas
         drawCanvas.Children.Clear();
     });
 }
Esempio n. 11
0
        void shake_ShakeGesture(object sender, ShakeGestureEventArgs e)
        {
            VibrateController vc = VibrateController.Default;
            vc.Start(TimeSpan.FromMilliseconds(1000));

        }
Esempio n. 12
0
 private void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
 {
     randomizeCarts();
 }
Esempio n. 13
0
        /* SHAKE GESTURES */

        // Set the data context of the TextBlock to the answer.
        void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
        {      
            // Use BeginInvoke to write to the UI thread.
            quoteBlock.Dispatcher.BeginInvoke(() =>
            {
                // Write the answer into the quoteBlock
                quoteBlock.DataContext = GetAnswer();
                quoteBlock.Text = GetAnswer();
            });
        }
        /// <summary>
        /// Update the <see cref="IsShaken"/> property when the device is shaken.
        /// </summary>
        /// <param name="sender">Sender details.</param>
        /// <param name="e">Shake gesture event arguments.</param>
        /// <remarks>
        /// Set the <see cref="GrowthRate"/> property 1 or less, to always reset the <see cref="IsShaken"/> property to its original state.
        /// </remarks>
        private async void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
        {
            await ThreadPool.RunAsync(
                p => UIDispatcher.Execute(() =>
                {
                    IsShaken = true;

                    if (GrowthRate <= 1)
                        IsShaken = false;
                })
            );
        }
Esempio n. 15
0
 private void Instance_ShakeGesture(object sender, ShakeGestureEventArgs e)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() => { Shake(); });
 }