I'm trying to use a DispatcherTimer
without WPF. It doesn't, the tick event is not triggered. See code sample below. Is there a way to make it work?
Why am I trying to do it? I am implementing a unit test for a class that hooks in my view model. That class uses the DispatcherTimer.
static void Main(string[] args)
{
DispatcherTimer timer;
timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromMilliseconds(50);
timer.Tick += (s, e) => Console.WriteLine("Hello");
timer.Start();
Console.Read();
}