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
2 answers

Update WPF Listview as db table updates

I'm using DispatcherTimer() to call update function to update listview from database where data is updated somewhere else. So, the listview is used as if dashboard. private void Update(){ DateTime d = DateTime.Today; items =…
icewall
  • 111
  • 6
0
votes
2 answers

Countdown timer stopping at random points

I have an application that requires multiple countdown timers to run (some simultaneously). They also update UI elements with the time remaining on the countdown. I have tried using DispatcherTimer for it's easy way to interact with UI elements.…
Radu Cojocaru
  • 238
  • 1
  • 2
  • 10
0
votes
1 answer

dispatch_source_set_cancel_handler and assigning nil to @property ivar

When you have a cancel_handler for a timer, can you directly reference and reset any ivars declared as a property with 'assign' attribute or do you have to first assign it as a __block? @interface SomeClass: NSObject { } @property (nonatomic,…
Jonas Gardner
  • 2,458
  • 5
  • 22
  • 28
0
votes
1 answer

Idle time using DispatcherTimer - Not Working

I have an application all done in WPF, using MvvM/Prism/Unity and Remote as datasource. I need a basic thing that on win forms is really easy, just check if the app is iddle after few minutes , and if is idle, lock the app and show the login…
2Fast4YouBR
  • 1,012
  • 1
  • 12
  • 22
0
votes
2 answers

DispatcherTimer not updating with AdControl running

I have a simple app that I am creating with a countdown timer that uses a DispatcherTimer for the time base. I have an event handler setup for On_Tick of the DispatcherTimer (set for 1 sec interval). I have three (3) pivot pages using three…
0
votes
1 answer

creating a delay on silverlight

I am making a turn based silverlight game(Cards game). and I want to delay between turns. I've tried the Thread.Sleep, but it halts my UI. I've tried to use DispatcherTimer, but it acts funny. sometimes it works, sometimes it skips. My code works…
Ateik
  • 2,458
  • 4
  • 39
  • 59
0
votes
5 answers

enumerate through a list or dict every x seconds with timer or dispatchertimer in C#

say i have a dictionary with 3 value/key pairs. private void someMethod() { Dictionary d = new Dictionary(); d.Add("cat", 22); d.Add("dog", 14); d.Add("llama", 2); d.Add("iguana", 6); …
darthwillard
  • 809
  • 2
  • 14
  • 28
0
votes
1 answer

Timer Concept in wp7?

I am using this Timer . but this timer not run perfectly. Example: DispatcherTimer starting_intervel = new DispatcherTimer(); starting_intervel.Interval = new TimeSpan(0, 0, 0, 0, 1500); starting_intervel.Tick +=…
Jeeva
  • 1,166
  • 4
  • 18
  • 39
0
votes
0 answers

WPF How to Update UI Correctly

I should refresh a 10 of controls on the Home page every 100ms. Right now I'm using the DispatcherTimer. The interface refreshes but occasionally some component gets stuck at the previous value. Here is the code I am using: private void…
0
votes
2 answers

How to unit test a SUT that depends on Dispatcher Timer

I have been searching for a solution for 3 days. I've got this one article but unfortunately, it uses a library that's no longer available (https://www.codeproject.com/Articles/19597/How-to-Test-a-Class-Which-Uses-DispatcherTimer). So I'm asking in…
0
votes
1 answer

DispatchTimer blocks UI

Hi All: I want to run a function to check internet connection and update the UI content, so i'm using a Dispatchtimer in the WPF loaded, during the intenet check if the ping is blocked by the local server or for some x reasons the UI is…
user838691
  • 320
  • 1
  • 5
  • 13
0
votes
1 answer

Why does my UWP DispatcherTimer tick method only fire when the Visual Studio debugger is attached?

I've observed a bug in my UWP application where a DispatcherTimer object no longer fires its tick method when I minimize the app (and still doesn't fire when the app is restored to focus as if the event handler has been unregistered), but only when…
ShrimpCrackers
  • 4,388
  • 17
  • 50
  • 76
0
votes
1 answer

How to count up by using Double Animation instead of by using Timer

The following code is counting up starting from 1 to forever by using Timer. XAML codes:
0
votes
0 answers

Why does my DispatcherTimer not fire it's "tick" event?

I (thought I) know how to use a DispatcherTimer in a WPF application: namespace TimerTestbed { public partial class MainWindow : Window { DispatcherTimer timer = new DispatcherTimer(); public MainWindow() { …
Dirty
  • 11
  • 2
0
votes
0 answers

Why my DispatcherTimer doesn't work C# WPF

how could I change my Label content to random letter by using DispatcherTimer C#? My DispatcherTimer doesn't execute Letter_Tick() function :| My MainWindow.xaml