September 23rd, 2010, 02:02 AM
Issue With Dispatch Timer
I have a WPF application. I have a panel that I want to repopulate every 1 minute getting data from the network. I know that I can use the DispatcherTimer class to set the timespan for ticks and make my code execute in every 1 minute.
The problem here is the my GUI freezes and becomes unresponsive as my code is busy fetching data from the network. I would like to know that is there any way in WPF to get rid of it as this is a new World for me.
I am doing it like this:
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromMilliseconds(1000);
timer.Tick += new EventHandler(timer_Tick);
private void timer_Tick(object sender, EventArgs e)
This code freezes my GUI. Please help.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!