private void TryLogin(IServiceApi rmnet) { try { // Schedule the update function in the UI thread. LayoutRoot.Dispatcher.BeginInvoke( System.Windows.Threading.DispatcherPriority.Normal, new PostLoginDelegate(UpdatePostLoginInterface), rmnet.Login()); } catch (WebException ex) { App.Logger.Error("There was a problem logging in Renmei.",ex); MessageBox.Show("There was a problem logging in to Renmei. " + ex.Message); } }