Esempio n. 1
0
        /// <summary>
        /// Sets text on the CountdownDialog as well as text color
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Timer_Tick(object sender, object e)
        {
            DispatcherTimer timer = (DispatcherTimer)sender;

            numTicks--;

            if (numTicks == 0)
            {
                // Turn off grinder
#if HARDWARE
                App.arduino.digitalWrite(13, PinState.LOW);
#endif
                timer.Stop();
                CountDownDialog.Hide();
                Frame.Navigate(typeof(MainPage));
            }
            else
            {
                //update timer UI
                countdownTimerText.Text = numTicks.ToString();
                if (numTicks <= 15)
                {
                    countdownTimerText.Foreground = new SolidColorBrush(Colors.Orange);
                }
                if (numTicks <= 5)
                {
                    countdownTimerText.Foreground = new SolidColorBrush(Colors.Red);
                }
            }
        }
Esempio n. 2
0
 private async void Countdown()
 {
     await CountDownDialog.ShowAsync();
 }