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

C# DispatcherTimer will not update my labels

I have four tabs at the top in WinForm. If you click on "Fahrt", the DispatcherTimer is executed, continues to run normally in the background and the labels etc from the function are updated. However, if I click up a second, third ... time, he…
DerJustin
  • 19
  • 4
0
votes
0 answers

WPF - Stop Dispatcher Timer with a Button

I have this WPF application. The start button starts a dispatcher timer to perform several sequential tasks. Each task can be time consuming. What I want is to manually stop the dispatcher timer when a current task is taking too long (or actually…
0
votes
1 answer

WPF application, "clock textbox" freezes after some hours

I made a simple WPF full screen and always on top window, which has a clock with dddd dd MMMM yyyy HH:mm:ss timestamp. The application is open 24/24 on a always on touch-screen, the problem is that after some time I see the clock freezed at a…
Francesco Bonizzi
  • 5,142
  • 6
  • 49
  • 88
0
votes
0 answers

Can I call Win API functions from a WPF application

I have a WPF application that controls a robot arm. It's also a human-in-the-loop system. So I would like it to be as close to real time as possible. I am using a DispatcherTimer to generate a "tick" regularly to update the robot arm. Sort of like a…
Dirty
  • 11
  • 2
0
votes
1 answer

Change messageTimer.Interval at runtime even if the messageTimer is in another method

I want to change the interval of my dispatcher time in run time here is my code : InitializeComponent(); DispatcherTimer messageTimer = new DispatcherTimer(); messageTimer.Tick += new EventHandler(messageTimer_Tick); …
ELDONXP
  • 11
  • 2
0
votes
1 answer

Error when dealing with DispatcherTimer.Tick method

I need a simple timer that prints the countdown in a TextBlock in my UWP app. I was suggested to use DispatcherTimer. That's my code. private void MainButton_Click(object sender, RoutedEventArgs e) { dispatcherTimer = new…
MarcAnt01
  • 75
  • 8
0
votes
1 answer

Wpf DispatcherTimer.Tick interupted by mouse hook event in same thread

I have a created a thread that has a dispatcher run for processing low level mouse hook events, and created a DispatcherTimer based on this dispatcher. When DispatcherTimer.Tick() was fired, I simulated another mouse down message. Then something…
cuiliang
  • 81
  • 1
  • 9
0
votes
1 answer

DispatcherTimer and WebClient.DownloadStringAsync throw "WebClient does not support concurrent I/O operations" exception

I need help with this code WebClient client = new WebClient(); string url = "http://someUrl.com" DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(Convert.ToDouble(18.0)); …
christiangobo
  • 520
  • 1
  • 7
  • 19
0
votes
0 answers

How do I check an instance variable from a MVVM DispatchTimer class?

So, I have this class for dealing with timers in MVVM: class RecognitionProcessTimer { DispatcherTimer analysisProcessTimer; public int Duration { get; set; } public RecognitionProcessTimer() { …
dydx
  • 157
  • 15
0
votes
1 answer

Stop a DispatcherTimer instance or change its value

My app works like this: I choose a point in time in the past, choose an amount of time from that point onward ("Within 3 hours...") and click "Add Timer". That creates a new stackpanel which includes a timer which counts down how much time is left…
ProudRambo
  • 15
  • 2
0
votes
0 answers

Handle Dispatcher Timer Within UnitTest

I have a dispatch timer in my application.It is called in an event, but here we are not calling it. I need to get that from unit test. When i went through google, I got as "It's best if you can avoid Dispatcher Timer in your system under test". Can…
0
votes
0 answers

Dispatcher timer tick event not working properly

I attached one delegate to Dispatcher timer Tick event which runs in every 500 ms its Working fine on my computer but when I run same application on another computer it's start for first time but never gets a hit on tick event again. it's just…
0
votes
1 answer

Stopping DispatcherTimer with a button click

When I click my stop button, my timer is still counting down, even though I tell it to stop. My current relevant code: I'm naming the timers here, as I need to access them for a stop/start all button as well. namespace Row_Interface { public…
0
votes
0 answers

C# DispatcherTimer exact length

I have strange problem. I am trying to fast generate data (later, I will use input from I/O) and then draw them. Because drawing is time consuming, I will add data to other array, to not block generating new ones. public MainWindow() { …
110mat110
  • 564
  • 6
  • 26
0
votes
1 answer

C#/WPF How to wait between loops but still allow user button click (not required)

I'm creating a card game, Slap Jack, that has 1 user and 3 commputer "players". When the user clicks a button to flip a card, the computers will go one by one and flip a card as well. I'm struggling with how to get the computers to run with a delay…
user6492738