diff --git a/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml.cs
index 1f4457ac..34a3edb2 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/PlaceNews/PlaceNews.xaml.cs
@@ -57,6 +57,8 @@ namespace CampusAppWP8.Pages.PlaceNews
/// Ein Objekt, das die Ereignisdaten enthält.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
+ base.OnNavigatedTo(e);
+ this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
if (NavigationMode.Back == e.NavigationMode && this.places == null)
{
this.places = new PlacesFile();
@@ -65,7 +67,13 @@ namespace CampusAppWP8.Pages.PlaceNews
}
else
{
- this.InitializeApi();
+ Thread thread = new Thread(delegate()
+ {
+ this.InitializeApi();
+
+ });
+ thread.Start();
+
}
}
@@ -102,7 +110,6 @@ namespace CampusAppWP8.Pages.PlaceNews
this.spsApi.OnLoaded += new SpsApi.OnIO(this.SpsApiIsReady);
this.spsApi.OnFailedLoad += new SpsApi.OnFailed(this.ApiIsFail);
this.spsApi.SetupCurrentPlaceRequest(Constants.SpsDomain_Buildings);
- this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
if (this.places.Model != null)
{
this.spsApi.LoadData();
@@ -159,7 +166,14 @@ namespace CampusAppWP8.Pages.PlaceNews
if (this.waitForApi < 1)
{
- this.SetupResultBox();
+ if (this.Dispatcher != null)
+ {
+ this.Dispatcher.BeginInvoke(new Action(() => this.SetupResultBox()));
+ }
+ else
+ {
+ this.SetupResultBox();
+ }
}
}
@@ -172,7 +186,14 @@ namespace CampusAppWP8.Pages.PlaceNews
if (this.waitForApi < 1)
{
- this.SetupResultBox();
+ if (this.Dispatcher != null)
+ {
+ this.Dispatcher.BeginInvoke(new Action(() => this.SetupResultBox()));
+ }
+ else
+ {
+ this.SetupResultBox();
+ };
}
}
@@ -197,8 +218,6 @@ namespace CampusAppWP8.Pages.PlaceNews
List infoNames = new List() { Constants.PisInformationName_Name };
List serviceNames = new List() { Constants.PssServiceName_PlaceNews };
- this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
-
// load from pis api
if (this.forceReqest || !this.places.Model.ContainsInformationNames(pidlist, infoNames))
{
@@ -217,7 +236,14 @@ namespace CampusAppWP8.Pages.PlaceNews
if (this.waitForApi < 1)
{
- this.SetupResultBox();
+ if (this.Dispatcher != null)
+ {
+ this.Dispatcher.BeginInvoke(new Action(() => this.SetupResultBox()));
+ }
+ else
+ {
+ this.SetupResultBox();
+ }
}
}
@@ -249,7 +275,7 @@ namespace CampusAppWP8.Pages.PlaceNews
{
Utilities.DetermineAndStoreCurrentPositionForce();
this.forceReqest = true;
- this.Dispatcher.BeginInvoke(new Action(() => this.InitializeApi()));
+ this.InitializeApi();
}
/// Event handler. Called by ApplicationBarMenuItem for click events.