Questions tagged [dispatchertimer]

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.

216 questions
0
votes
0 answers

No overload for "ProcessStateChangedQueue" matches delegate "System.EventHandler"

I am trying to set up a timer and for some reason I keep getting errors when I try to recursively call ProcessStateChangedQueue(). I originally tried using Timer instead of DispacherTimer, but this is a WPF application. I could have done…
developerME
  • 165
  • 1
  • 1
  • 7
0
votes
2 answers

How can i cooldown a loop in wpf ? Forest Fire Simulation

As a personnal work, i have to do a forest fire simulation in WPF. I created all the map with a grid, and using an array. The Fire is added through a random number ( in the array when ex : case = " Forest "). The Fire is burning all the " forest…
Karro
  • 111
  • 1
  • 9
0
votes
1 answer

C# Two Windows: First one for main UI, second one will be the background process (Serial.Read) (Active)

I'm new to C# WPF and I have a problem while running my program. My program freezes if my serial port (xbee on it) can't receive the required data in a specific time (Dispatcher). So, I am trying to solve it by making a second window that will be…
0
votes
0 answers

Can someone explain difference between dispatchTimer.Interval and real time?

dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal); // or .Release dispatcherTimer.Tick += f; dispatcherTimer.Interval = TimeSpan.FromMilliseconds(x); x => real time 11 => 15.9 ms 12 => 15.9 ms 13 => 17 ms 16 => 25 ms Above…
CoR
  • 3,826
  • 5
  • 35
  • 42
0
votes
0 answers

How to make a splash screen with loaded percentage

I have to do a lot of operations when I start my application. I have to show a splash screen with loaded percentage. The idea is the first time to record the time necessary to load, then serialize it with other data. The following times I have all…
Patrick
  • 3,073
  • 2
  • 22
  • 60
0
votes
1 answer

How can I continue time of the timer when I opening / closing the child window

I have a timer. in my form is still possible to open the child window. when I open and close this window, the timer starts again. How can I continue timer operation when I open and clos the child window??? I hope very much for your help! this is my…
Emma W.
  • 215
  • 1
  • 6
  • 20
0
votes
1 answer

UWP streamsocket ping networktimer issues

I have a StreamSocket in UWP and I send my messages like this using a DataWriter object using the StoreAsync() method: public static async Task SendNetworkMessage(NetworkMember member, NetworkMessage message) { DataWriter…
WJM
  • 1,137
  • 1
  • 15
  • 30
0
votes
1 answer

Accelerated game time with TimeSpan in C#

I need to create an accelerated game time (presumably using a DispatcherTimer). I want 1 minute of 'real time' to equal 10 minutes of 'game time'. Also, how would I set up gametime? Would this be a DateTime object? For example, let's say the game…
zetar
  • 1,225
  • 2
  • 20
  • 45
0
votes
0 answers

How to Stop/Remove all DispatcherTimers in the Dispatcher's internal List?

The Dispatcher class maintains an internal List for active timers. The internal Dispatcher.AddTimer() method adds it, called on the Start() method. RemoveTimer() is called by the Stop() method. I need to clear that internal…
Jakub
  • 285
  • 4
  • 21
0
votes
1 answer

DispatcherTimer does not showing UI manipulation in tick event - UWP

I have a DispatcherTimer in my UWP app for updating database from a web services. public DispatcherTimer SessionTimer { get; set; } Before updating the DB in the tick event of this timer, I collapse main grid and show updating message and after…
n.y
  • 3,343
  • 3
  • 35
  • 54
0
votes
1 answer

Async-Await function running on DispatcherTimer which accesses web resources fails periodically

I have an async lambda running on a DispatcherTimer to get data from a web API. My code is as follows: _timelineSeekTimer = new DispatcherTimer(); _timelineSeekTimer.Interval = TimeSpan.FromMilliseconds(500); _timelineSeekTimer.Tick += async (e, o)…
DeathTails
  • 468
  • 4
  • 12
0
votes
1 answer

Why custom control's timer was slow when main form event enter?

I was created custom timer control for time count that count time max to min.And add this control to main form.In main form Key Up event,Total mark add one by checking this timer count when user click enter.The problem is when user click enter…
user1859269
0
votes
2 answers

Dispatch timer won't work

I'm trying to figure out how a dispatch timer works so I can implement it into my program, I followed the exact instructions on a website and looked for answers on stack overflow. People said their problem was fixed but I have very similar code and…
mateos
  • 1,405
  • 1
  • 17
  • 26
0
votes
1 answer

Timer interval change event in C# in WPF

I want to adjust the value of the interval as a button event. When you click the button, the value increases by 1, then reducing to the interval want to calculate the value in seconds. This applies not adjust the interval. // Button click…
0
votes
1 answer

Timespan in a dispatcherTimer

I'm programing a WPF application in VS C# 2010 and I'm programming a simulation. This simulation can be either run automatically (by pressing the Auto button) or step by step (clicking the Step button). However, what I want to implement is a speed…
jquery_stack
  • 261
  • 4
  • 17