DispatcherTimer never works without a UI thread

I am finding that the DispatcherTimer never fires unless you have a GUI based app. I have a program that has no LCD, only a set of NIXIE tubes for a clock.

None of the timers fire. :frowning:

Is there any way around this?

We will look into it soon.

1 Like

Hi,

What you’re seeing is expected behavior. DispatcherTimer depends on the UI dispatcher loop, so in applications without a UI (no Application.Run()), the dispatcher never processes events and the timer will not fire.

the recommended approach is to use System.Threading.Timer, which works independently of the UI:

new Timer(callback, null, 0, 1000);

This is the proper timer to use in non-GUI scenarios.

1 Like