How can I set a timer to run from code? I can't find any control named timer
.
What are the steps needed to do this?
You're looking for the DispatcherTimer
class.
DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromSeconds(10);
dt.Tick += delegate { ... };
dt.Start();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With