Exemple #1
0
 private void GetMyApps()
 {
     if (_dataService.GetIsNetWorkAvailable())
     {
         DispatcherHelper.UIDispatcher.BeginInvoke(async() =>
         {
             IsMyAppsLoading = true;
             if (ListOfMyApps == null)
             {
                 ListOfMyApps = new ObservableCollection <MyApp>();
             }
             if (ListOfMyApps.Count == 0)
             {
                 var myApps = await _dataService.GetMyAppsAsync();
                 if (myApps != null)
                 {
                     foreach (var myapp in myApps)
                     {
                         ListOfMyApps.Add(myapp);
                     }
                 }
             }
             IsMyAppsLoading = false;
         });
     }
     else
     {
         MessageBox.Show("Sorry, There is some problem with internet connectivity");
     }
 }
Exemple #2
0
        private async void GetMyApps()
        {
            if (_dataService.NetWorkAvailable())
            {
                IsMyAppsLoading = true;
                if (ListOfMyApps == null)
                {
                    ListOfMyApps = new ObservableCollection <MyApp>();
                }
                if (ListOfMyApps.Count == 0)
                {
                    var myApps = await _dataService.LoadMyAppsAsync();

                    if (myApps != null)
                    {
                        foreach (var myapp in myApps)
                        {
                            ListOfMyApps.Add(myapp);
                        }
                    }
                }
                IsMyAppsLoading = false;
            }
            else
            {
                App.RootFrame.Navigate(new Uri("/Views/NetworkError.xaml", UriKind.Relative));
            }
        }