10 Rules for Building a Windows Phone App: Listing 2.
An example of UI thread blocking.
- By Max Zilberman
- 02/01/2012
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
this.Loaded += new System.Windows.RoutedEventHandler(MainPage_Loaded);
}
void MainPage_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
// Do something here that takes more than one second and you kill the experience
Model.GetData();
}
}
About the Author
Max Zilberman is an architect evangelist at Microsoft on the Developer andPlatform Evangelism team and is available at [email protected].