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();



Windiw_Loaded()

{

timer.Interval = TimeSpan.FromMilliseconds(1000);



timer.Tick += new EventHandler(timer_Tick);

timer.Start();

}



private void timer_Tick(object sender, EventArgs e)

{

FetchNewAttendence();

}

This code freezes my GUI. Please help.

Thanks,
Namrata