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
2
votes
1 answer

DispatcherTimer Keeps Firing After Stop() in Win 2k8 SP2

I got an interesting bug report today. I have a DispatcherTimer whose Tick calls an EventHandler which contains a Stop() method call. This stops the timer on the platforms we use in development (Windows XP SP3 and Windows 7), but the timer does not…
Drew Wiens
  • 124
  • 1
  • 8
2
votes
1 answer

Start DispatcherTimer from N seconds, minutes, hours

I have been searching for information and couldn't find any. My question is how to start DispatcherTimer from N seconds or minutes or hours. I mean currently it starts from 00:00:00 (also displayed in CurrentTime Label) but if I would like to start…
10101
  • 2,232
  • 3
  • 26
  • 66
2
votes
3 answers

How to stop DispatcherTimer in c# WPF

I am checking the time and when is equal to something I want to stop the dispatcher. But it doesn't work. Timer is still working after calling Stop(). private void startTime(bool what) { vartimer = new DispatcherTimer(); if (!what) { …
fullje
  • 81
  • 1
  • 10
2
votes
1 answer

DispatcherTimer stacking - UWP

I'm currently working on a project in UWP and I have a CommandBar that I want to go from Hidden to Compact if the mouse moves. After five seconds (If the mouse dont move) the CommandBar should go back to Hidden again. I dont get any errors, but when…
luddep
  • 219
  • 1
  • 2
  • 14
2
votes
2 answers

BackgroundWorker or (Dispatcher)operation already completed when doing ReportProgress

I use DispatcherTimer because I need to do an operation every couple of minutes. Inside this I call a BackgroundWorker to do my work, and then use the dispatcher attached to the timer to update my UI. I'm thinking the error I'm getting has to do…
LobalOrning
  • 107
  • 2
  • 4
  • 13
2
votes
1 answer

Windows Phone - Application Level DispatcherTimer

My Requirement : Need a session timer for every page(Except login page). If timer exceeded 60 seconds with no user actions performed, it should redirect to the login page. I have successfully done the above requirement for one page with below code…
Ramin
  • 71
  • 1
  • 4
2
votes
2 answers

C# client : how to get current datetime from SQL Server?

I have used a date time in my project. My project is client server and developed with c#. Now, I want to get date time clients from SQL Server on server, that when the system date time client was in trouble, Application get current date time from…
2
votes
1 answer

WPF DispatcherTimer does not fire

I have a class with RefreshAsync method which can take a long time to execute. I am using Mvvm light framework. I need to call it after object created but not everytime when I get it's instance from servicelocator var vm =…
Anton
  • 339
  • 2
  • 15
2
votes
0 answers

c# how to play sound at specific time during countdown

I've been teaching myself c# and trying to create a program, so far everything I've researched and found has been working except the sound. The program counts down from 60 minutes, and when the dispatchertimer reaches the 15 minute, 10 minute and 5…
Jzilbek
  • 21
  • 4
2
votes
4 answers

Unable to correctly restart my DispatcherTimer

I am trying to implement a timer in my application with three buttons - Start, Stop and Restart. The timer starts and stops fine. However, when I click on the restart button it starts from the previous value of seconds and minutes instead of…
Naaz
  • 91
  • 1
  • 10
2
votes
3 answers

How to check every 30seconds with dispatchertimer without affect the UI in c#?

I hav tried the below code for checking reports from server in every 30seconds,but after 30seconds tick,The application hangs for several seconds.How to avoid the Hanging problem. The below code am tried,what change want to given in…
NvadeepKumar
  • 25
  • 1
  • 7
2
votes
3 answers

Add additional string parameter into DispatcherTimer EventHandler

How can I add extra string parameter into Dispatchertimer Eventhandler ?. I would like achieve something like this: string ObjectName = "SomeObjectName"; System.Windows.Threading.DispatcherTimer dispatcherTimer = new…
Shagohad
  • 365
  • 1
  • 7
  • 23
2
votes
2 answers

DispatcherTimer updating TextBlock with MVVM

apologies if this isn't worth asking a question about but I'm puzzled as to why what I'm doing isn't working. I'm making a WP8 app and I want to display the current date and time (which will refresh each minute) on the screen. I've managed to get…
user4490184
2
votes
1 answer

Using dispatchertimer in combination with an asynchroneous call

We have an issue in our Silverlight application which uses WCF and Entity Framework, where we need to trap the event whenever a user shuts down the application by closing the web page or the browser instead of closing the silverlight application.…
user338310
2
votes
1 answer

The DispatcherTimer still tick event after Stop() and set to null

I'm writing an app to listen music and watch video. In app, I have these 2 pages: 1 to play the audio playback agent (APA) - Page A, and one to play the video (using MediaElement) - Page B. While WP8 has an bug with the APA ( which I've asked here…
1 2
3
14 15