void MainPivotViewmodel_GetBalanceInfoFinished(object sender, VikingApi.ApiTools.GetInfoCompletedArgs args) { if (!args.Canceled) { Bundle.Visibility = Visibility.Visible; Bonus.Visibility = Visibility.Visible; Loading.Begin(); } if ((bool)IsolatedStorageSettings.ApplicationSettings["login"]) IsolatedStorageSettings.ApplicationSettings["login"] = false; _loading = false; }
async void MainPivotViewmodel_GetSimInfoFinished(object sender, VikingApi.ApiTools.GetInfoCompletedArgs args) { if (App.Viewmodel.MainPivotViewmodel.Sims != null && App.Viewmodel.MainPivotViewmodel.Sims.Any() && !args.Canceled && !(bool)IsolatedStorageSettings.ApplicationSettings["login"]) { if (IsolatedStorageSettings.ApplicationSettings.Contains("sim")) { SimBox.Text = CheckDefaultSimValue((bool)IsolatedStorageSettings.ApplicationSettings["login"]); } if (string.IsNullOrEmpty((string)IsolatedStorageSettings.ApplicationSettings["sim"])) IsolatedStorageSettings.ApplicationSettings["sim"] = SimBox.Text; App.Viewmodel.MainPivotViewmodel.StartPeriodicAgent(); App.Viewmodel.MainPivotViewmodel.RenewToken(); await App.Viewmodel.MainPivotViewmodel.GetData(SimBox.Text); } else if (!args.Canceled) { Message.ShowToast(AppResources.ToastNoSim); } _loading = false; }