Mark's profileMarx SpacePhotosBlogLists Tools Help

Marx Space

Marx MSN Space

Mark Woodlief

Occupation
Location
Interests
Trying to find that slow country lifestyle I so much desire. Dream of moving to Monterey or Carmel and surfing the days away or I was on horseback, riding a trail, and well you know the rest. :) "Efficiency is intelligent laziness"
Photo 1 of 20
July 25

Update UI from different Thread

Constant battle with this especially for progress bars, etc.  I recently was working on a project where I had to call out to Chiron.exe to build a .xap file and when it was done wanted to launch the Silverlight app in a custom WPF Frame...

 

Code below works great!!!

 

void ProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
      this.Dispatcher.Invoke(DispatcherPriority.Normal, new System.Windows.Forms.MethodInvoker(delegate()
      {
           this.ProgressBar.Value = e.ProgressPercentage;
      }));

I cant take credit for it, came from

 

http://thispointer.spaces.live.com/blog/cns!74930F9313F0A720!252.entry?_c11_blogpart_blogpart=blogview&_c=blogpart&wa=wsignin1.0