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
2 answers
Repeating BackgroundWorker task using DistpatcherTimer
I'm trying to figure out the best way to approach this.
I have a BackgroundWorker which is being used to make a socket connection on a timer.
Public Shared AllUsersWorker As New BackgroundWorker
Public Shared AllUsersWorkerTimer As New…

Ben
- 1,000
- 2
- 15
- 36
1
vote
1 answer
Maintaining 60 elements in a observablecollection
Hi I have a ObservableCollection getting data in every minute. When it reaches an hour, I would like to clear the first item and move all the items up then adding the new item, thus maintaining it at 60 elements. Does anyone have any idea how to do…

David Guetta
- 63
- 3
1
vote
0 answers
How to execute locally defined Powershell function inside DispatcherTimer Tick scriptblock?
I'm new on WPF/PowerShell and I'm trying to execute a locally defined Powershell function inside a DispatcherTimer Tick scriptblock but I get this error
My code is simply :
function Get-CurrentStorageJobs
{
My_Code
}
$MonitorTimer =…

Herunòla
- 13
- 2
1
vote
1 answer
DispatcherTimer behavior in WP7 application
I am writing an audio recording application for WP7. I have a DispatcherTimer object in my ViewModel class, that when the recording is happening, counts the elapsed seconds to show the length of the recording to a user. I have the following problem…

Maxim V. Pavlov
- 10,303
- 17
- 74
- 174
1
vote
1 answer
How to set timer in one vc and fire it in another vc
my goal is to set a timer in one vc when a firestore document is created and fire it in another vc when the timer is up to delete the firestore document.
In my vc where I create the document, I have this block of code in the button that creates the…

dsonawave
- 137
- 2
- 12
1
vote
1 answer
two dispatchertimer events at the same time?
i have a wpf app that is updating date/time in one dispatchertimer, another is for a mp3 player timer that tracks time and slidebar for playing time. is it possible to have 2 dispatchertimer's running?
that's dispatcherTimer.Tick += new…

darthwillard
- 809
- 2
- 14
- 28
1
vote
1 answer
Why does the DispatcherTimer start immediatly instead of waiting until the interval arise?
I wanted to use a DispatcherTimer to decide if a click with mouse is click or double click. I am using the solution by mm8 in this thread.
My test code is this one:
DispatcherTimer _myTimer = new DispatcherTimer();
public Constructor()
{
…

Álvaro García
- 18,114
- 30
- 102
- 193
1
vote
1 answer
How to use dynamic DispatcherTimer object in WPF?
I want to use dynamic DispatcherTimer object in my wpf project. I have a timer like below;
DispatcherTimer timer_log = new DispatcherTimer();
I have a list that name is log_durations. The list has durations. And I use this methods to manage timer…

Muammer
- 374
- 2
- 11
1
vote
2 answers
Periodically update silverlight view with MVVM
I am trying to use MVVM in Silverlight, but I am quite new to it so I am not quite sure on some things. I have a silverlight page which displays the progress of some server side operation. The current progress comes from a web service and should be…

aKzenT
- 7,775
- 2
- 36
- 65
1
vote
1 answer
How do I make a history array from a dispatcher Timer? C#
Basically I have to make a Dispatcher timer, store the variable in the array as it counts then display the history array in a text box when I click the rawDataButton. For some reason my array only shows the most recent ones and never stores in the…

CapitalistNick
- 11
- 2
1
vote
2 answers
DispatcherTimer in a new thread
I'm developing a c# application. I need 2 threads; the main one, and another that is continuously looking for information through my database.
I want to use Dispatcher Timer as:
dispatcherBd.Tick += (s,e) => CallPoll (s,e);
dispatcherBd.Interval =…

rosa.tarraga
- 145
- 1
- 2
- 10
1
vote
1 answer
C# WPF label not updating properly on (idle) GUI
So i'm trying to make a timer system but for whatever reason the label stops updating when you move your mouse over the GUI screen of the application.
Gif showing the issue:
https://i.imgur.com/Jvi1AgF.gifv
this is what happens on another example i…

DarkEyeDragon
- 320
- 5
- 15
1
vote
2 answers
Include hour in timer countdown
I am trying to create a countdown that includes hours.
private int time = 3660;
public MainWindow()
{
var vm = new TimerViewModel();
InitializeComponent();
// get display setting - 2 means extended
int displayType =…

CliveJ
- 27
- 1
- 8
1
vote
1 answer
Make Timer interval less than 1 ms .Net
I'm trying to make Timer with an Interval less than 1 Ms.
My Attempt:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Timer1.Interval = 0000001
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As…

James.Alocard
- 67
- 1
- 6
1
vote
1 answer
C# DispatcherTimer Issue
I have an issue with the WPF Timer.
Here's my code :
System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(DispatcherTimer_Tick);
dispatcherTimer.Interval…

DiSiZ
- 43
- 10