Exemple #1
0
        public AttackAlertViewModel(AttackAlertCounterView view)
        {
            _time = TimeSpan.FromSeconds(60);

            _timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate
            {
                view.TimeCounterTB.Text = _time.ToString("c");
                if (_time == TimeSpan.Zero)
                {
                    _timer.Stop();
                }
                _time = _time.Add(TimeSpan.FromSeconds(-1));
            }, Application.Current.Dispatcher);

            _timer.Start();
        }
Exemple #2
0
        private void AttackAlertButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            AttackAlertCounterView altertCounter = new AttackAlertCounterView();

            altertCounter.Show();
        }