Click here to Skip to main content
15,915,864 members
Everything / Dispatcher

Dispatcher

Dispatcher

Great Reads

by Swapnil Dhage
This is a helper/utility class that will add a layer of abstraction as well as separation for dispatcher related operations in WPF.

Latest Articles

by Swapnil Dhage
This is a helper/utility class that will add a layer of abstraction as well as separation for dispatcher related operations in WPF.

All Articles

Sort by Score

Dispatcher 

13 Jul 2015 by Wendelius
Inside the timer_Tick method you on each call you loop through the whole lotto array and you set all the objects to green. This is why all of them are changing at the same time.If you want them to change individually, you need to store for example a counter value outside the method and check...
10 Jul 2013 by berkayerdi
DispatcherTimer timer = new DispatcherTimer();timer.Interval = TimeSpan.FromSeconds(1);timer.Tick += timer_Tick; // i take some error here. "Doesn't exist in the current context"timer.Start();I take errors about "timer.Tick += timer_Tick". What should I make there? Add some "using"...
10 Jul 2013 by Thomas Daniels
Hi,You should create a timer_Tick method:private void timer_Tick(object sender, EventArgs e){ // your code here}If you add this method to your class, you don't longer get the "Doesn't exist in the current context" error.Hope this helps.
13 Jul 2015 by CBO1987
Hello,I am creating an application where I have 4 different textblocks. They are to randomly change from the color white to the color green 1 at a time for 1 second and then back to white. The textblock that is to flash is determined by a random number stored in the int[] lotto. The problem I...
23 Feb 2016 by Luiey Ichigo
Hi,I have a page of main screen(consist of video playing and image changing after video is finish so-called advertisement page). Currently my application facing hang or freeze if the main screen is left idle and loop more than 10 times.And while freeze, if public touch again the screen,...
23 Feb 2016 by NightWizzard
A timer event always starts into own thread - think this is the basic problem you ran into (thread in thread). Instead of the timer try to use an endless loop that does a sleep with the desired interval at start or end of the loop. Also use try/catch block inside the loop to intercept the...
6 Feb 2017 by Member 11320435
I'm trying to implement my own dispatch queue to dispatch tasks in the same order they are added to a queue. The motivation for this is due to the lack of C++/CX support for dispatch queues for Windows runtime components. (https://msdn.microsoft.com/en-us/library/hh771042.aspx) is the...
27 May 2017 by oronsultan
Hi friends, so after more than a week of trying to solve it on my own I officially give up and turn to your help. Basically, it should not be so complicated so I have no idea why it does not work. I have a WPF app which contains a Main Window called surprise surpise...: Main_Window. That window...
19 Oct 2017 by EasyHero
Hi, i am capturing image with Webcam. based on the device(laptop) used, the image capture either freezes at some point or not. What i want to achieve is to ensure that the capture does not freeze. Here is the function that captures the image. it uses Direct Show Library private void...
19 Oct 2017 by Bernhard Hiller
Learn the basics of MVVM. Bind properties of some controls (View) to properties of a ViewModel. The Binding engine takes care of the correct thread. In your model, run your thread for capturing the image, raise an event to the ViewModel for every new image.
14 Nov 2017 by Member 12699051
Hi, I think you take time to update the list of databases. You can use a backgroundworker to update this list. I will use this scenario: - delete the list of databases after selection of server and disable the control of database - launch the backgroundworker to get the new list that will be...
14 Nov 2017 by Graeme_Grant
Async...await TPL framework[^] is the answer. Spin a task off on another thread to release the UI thread and stop it from freezing. Multithreaded program is something that needs a n investment in learning. Best to check out the following resources from the TPL gurus before doing any work: *...
15 Nov 2017 by Pete O'Hanlon
If you are using .NET 4.5 and above, I would recommend that you take advantage of the new features for moving the ObservableCollection off the dispatcher. Basically, you want to start off with something like this:public class MyViewModel { private readonly object _lock = new object(); public...
13 Apr 2020 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
1 Apr 2013 by Sergey Alexandrovich Kryukov
You should never try to use System.Windows.Forms.Timer with WPF, and almost never even with Forms. The accuracy of this timer is prohibitively bad for most applications. There are (at least) three more timer types you can...
15 Nov 2017 by D-Kishore
Hi, I am implementing one application in WPF MVVM. I am having WPF application and DLL class library. For example in application I am having 2 combobox's I am binding database servers to the 1st combobox. based on the 1st combobox selection then I am binding the 2nd combobox with list of...
10 Apr 2017 by Swapnil Dhage
This is a helper/utility class that will add a layer of abstraction as well as separation for dispatcher related operations in WPF.
1 Apr 2013 by ShaketheDustOffMyFeet
I am needing help with the dispatcher class from WPF and would like it to function much like the Windows Forms Timer class example below. To see the Windows Form Application it would require you to copy the code into a new WForms app and place the code in a Form1.cs file. In the Form 1...
12 Apr 2016 by Member 8833981
Hello,I'm creating a new dialog box running with its own thread.In the constructor of the dialog box, some UI components will be allocated, which are hosted under a canvas.System.Threading.Thread thread = new System.Threading.Thread (() >{ Dlg dlg = new Dlg (); ...