private async Task RefreshDataASync()
        {
            NoConnection.Visibility    = Visibility.Hidden;
            RefreshDataIcon.Visibility = Visibility.Visible;
            svm = new ParkingDataViewModel();

            bool status = await Task.Run(() => svm.IsServerConnected());

            if (status == true) //Connection Established
            {
                pk = await Task.Run(() => svm.GetParkingLots());

                FillInfoASync();
                RefreshDataIcon.Visibility = Visibility.Hidden;
            }
            else //No Connection
            {
                NoConnection.Visibility    = Visibility.Visible;
                RefreshDataIcon.Visibility = Visibility.Hidden;
                Console.WriteLine("Not Connected");
            }
        }
Example #2
0
 private void ParkingDataView_Clicked(object sender, RoutedEventArgs e)
 {
     //Initialize
     DataContext = new ParkingDataViewModel();
 }