DispatcherTimer is a .Net class that provides timers that are integrated into the Dispatcher queue which is processed at a specified interval of time and at a specified priority.
Questions tagged [dispatchertimer]
216 questions
1
vote
1 answer
Fade with a DispatcherTimer
In my uwp project i have 3 different color overlays on pictures (Green, yellow and red). These colors are supposed to indicate if a Room (In this case the room is a picture) is booked or not.
If the room is booked it should fade out the green color…

luddep
- 219
- 1
- 2
- 14
1
vote
1 answer
how to unsubscribe an event with parameter(s)?
In my WPF program, I need to set aircraft failure for a flight simulation software. For example, if I click "Fire Engine 1" button on MainWindow,
private DispatcherTimer DT;
private void button_Engine_1_On_Fire(object sender,…

Jeff
- 27
- 7
1
vote
1 answer
Wpf Dispatcher timer going erratic
I have a dispatcher timer which has to act like a heartbeat every 500ms and write on a register on an anybus. I have set it with maximal priority:
m_HeartBeatTimer = new DispatcherTimer(DispatcherPriority.Render);
the problem is that when program…

Luca
- 918
- 2
- 13
- 30
1
vote
0 answers
Dispatcher Timer hangs the UI of WPF Application
From the MainWindow I launch another window with two buttons and a label.
The purpose is to use the label as a time counter from 30 to 0. Basically the application waits for user to press any of the buttons within 30 seconds. If any of them is…

The King
- 833
- 1
- 15
- 41
1
vote
1 answer
Dispatchtimer between buttonpresses
I'm working on school project with the windows iot C# development sdk, everything is working great so far but now i have two events that need to be triggered after 3seconds and 7seconds. But i can't get it to work, i've been breaking my head over…

Jeroen
- 105
- 6
1
vote
3 answers
How to execute certain function for every 5 minutes?
I'm building a EA (Expert Advisory) for my trading, i wonder how can i set the function to execute the order 5 minutes later if the 1st order is executed.
The problem in my current code is, once it meet the requirement, it will keep placing the same…

DouglasQ
- 33
- 1
- 9
1
vote
1 answer
WPF control retained in memory due to DispatcherTimer EventHandler
Yo
One of my WPF control is retained in memory due to one of its private member. The incriminate member is a DispatcherTimer and the retention is because of the Tick event handler. (This leak was detected with help of the tool ANTS Memory…

Patrick
- 119
- 10
1
vote
1 answer
Using ThreadPoolTimer with Background Audio UWP
I am making a UWP app using the BackgroundAudioTask. My app is working very well. Now I want to add in a TextBlock the Current position of the Audio played.
I was doing this method before implementing the audio Task:
private TimeSpan TotalTime;
…

yalematta
- 1,389
- 1
- 21
- 36
1
vote
1 answer
New DispatcherTimer gets created alongside old one, only new one should run
I ran into a problem the other day. I have found out why it's happening, but I've never had a run in with such a problem so I don't know how to solve it.
I have an application where in the DashboardView (the main view) a DispatcherTimer is started…

Kailayla
- 323
- 5
- 15
1
vote
1 answer
WPF app inactivity
I want my app do something when it is idling. For that I wrote this code, which works properly only when DispatcherTimer interval is less than 30 seconds, or my app is not active window.
static DispatcherTimer mIdle;
public static void…

Aagha
- 61
- 8
1
vote
2 answers
Binding to property not working with DispatcherTimer
I have some TextBlock bound to a property with DependencyProperty. When a DispatcherTimer changes this property, the TextBlock does not update. Even in debugging, I can see that the property get updated, but TextBlock remains unchanged.
Details:
I…

omarmallat
- 694
- 2
- 9
- 20
1
vote
3 answers
Showing a label for 3/5 seconds in wpf C# but after some click it doesn't stay that longer
I'm trying to show text in a label in wpf when a button is pressed and then hide after couple of seconds. I know there are answers of this, but my problem is different.
I used these 2 ways for hiding the label:
One
//When the button is pressed
…
user4962680
1
vote
2 answers
how to show label for couple of seconds in wpf?
I want to show a label for 3 seconds only and then disappear it.
I am working on a WPF application.
public DispatcherTimer timer = new DispatcherTimer();
timer.Tick += new EventHandler(timer_Tick);
I started timer from the function
timer.Start();…

Dhaval Tejlavwala
- 355
- 4
- 17
1
vote
1 answer
C# Reset a countdown timer-DispatcherTimer- in windows store app
I'm a C# newbie_and in programming in general_ and Ι'm trying to build a math quiz app with a countdown timer.
I generate an equation each time the user clicks the start button and I give him a max 60 seconds to answer. The user answers -whether his…

D3v
- 305
- 1
- 2
- 16
1
vote
1 answer
WPF DispatcherTimer skips in intervals when restarted
I've been struggling with this for the last few days and am hoping that you all can help me out. I'm creating a WPF timer application and am using DispatcherTimer in order to count upwards in minutes to track time. When I start the timer initally,…

Atarinerd80
- 87
- 2
- 8