This commit is contained in:
stubbfel
2013-09-10 10:28:44 +02:00
parent 60e4adf264
commit 220fe3daed

View File

@@ -57,6 +57,8 @@ namespace CampusAppWP8.Pages.PlaceNews
/// <param name="e">Ein Objekt, das die Ereignisdaten enthält.</param>
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<string> infoNames = new List<string>() { Constants.PisInformationName_Name };
List<string> serviceNames = new List<string>() { 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();
}
/// <summary>Event handler. Called by ApplicationBarMenuItem for click events.</summary>