System.Windows.Threading.DispatcherTimer.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
		public void Start ()
		{
			if (!started) {
				started = true;
				Mono.NativeMethods.dispatcher_timer_start (internalTimer.native);
			}

		}

Usage Example

        public MainWindow()
        {
            InitializeComponent();


            DispatcherTimer timer = new DispatcherTimer();
            Random rnd = new Random();
            timer.Interval = TimeSpan.FromSeconds(1.0);
            timer.Tick += (s, e) =>
                {
                    TestTimer++;

                    TestBackground = new SolidColorBrush(Color.FromRgb(
                        (byte)rnd.Next(0, 255), (byte)rnd.Next(0, 255), (byte)rnd.Next(0, 255)));

                    FocusedElement = Keyboard.FocusedElement == null ? string.Empty : Keyboard.FocusedElement.ToString();
                    //Debug.WriteLine(string.Format("ActiveContent = {0}", dockManager.ActiveContent));

                };
            timer.Start();

            this.DataContext = this;

            winFormsHost.Child = new UserControl1();

        }
All Usage Examples Of System.Windows.Threading.DispatcherTimer::Start