10 Rules for Building a Windows Phone App: Listing 3.

Changing the Loaded event to offload data.

BackgroundWorker getDataWorker = null;
void MainPage_Loaded(object sender, System.Windows.RoutedEventArgs e)
  getDataWorker = new BackgroundWorker();
  getDataWorker.DoWork += GetData_DoWork;
  getDataWorker.RunWorkerCompleted +=new

  private void GetData_DoWork(object sender, DoWorkEventArgs e)

// Here call to get data


About the Author

Max Zilberman is an architect evangelist at Microsoft on the Developer andPlatform Evangelism team and is available at mazilber@microsoft.com.