public void ExecuteSubStatusSelectedItemsCommand(PropertyDetailViewModel viewModel)
 {
     IsSubStatus = false;
     IsBlur      = BackColor;
     NavigateOnSummaryPage(viewModel);
     IsBusy = false;
 }
Exemple #2
0
 public SummaryViewModel(PropertyDetailViewModel viewModel)
 {
     manager               = PropertyUserStatusService.DefaultManager;
     propertyService       = PropertiesService.DefaultManager;
     SubmitCommand         = new Command(() => OnSubmit(), () => !IsBusy);
     CancelCommand         = new Command(async() => await OnCancel(), () => !IsBusy);
     PropertyModel         = viewModel;
     IsSubStatus           = (PropertyModel.SubStatus == null ? false : true);
     this.PropertyChanged += SummaryViewModel_PropertyChanged;
 }
        public async void ExecuteSubStatusLoadItemsCommand(PropertyDetailViewModel viewModel)
        {
            try
            {
                IsStatus = false;
                IsBlur   = BlurColor;
                //  StatusService service = new StatusService();
                substatusList.Clear();
                // var temp = await service.GetSubStatusList( viewModel.Status.Id);
                var GetSubStatus = await propertySubStatusMstrService.GetPropertySubStatusItemsAsync(viewModel.Status.Id);

                //Check Permissions 401 && 403
                IsCheckPermissions();
                //if (GetSubStatus.Count == 0)
                //{
                //    networkAccess = Connectivity.NetworkAccess;
                //    if (networkAccess == NetworkAccess.Internet)
                //    {
                //        GetSubStatus =
                //            await propertySubStatusMstrService.GetPropertySubStatusItemsAsync(viewModel.Status.Id,
                //                true);

                //    }

                //}

                if (GetSubStatus.Count == 0)
                {
                    viewModel.SubStatus = null;
                    NavigateOnSummaryPage(viewModel);
                    IsSubStatus = false;
                    IsBusy      = false;
                    IsBlur      = BackColor;
                }
                else
                {
                    foreach (var item in GetSubStatus)
                    {
                        substatusList.Add(item);
                    }

                    IsSubStatus = true;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
            finally
            {
            }
        }
 async void NavigateOnSummaryPage(PropertyDetailViewModel viewModel)
 {
     await Application.Current.MainPage.Navigation.PushAsync(new SummaryPage(viewModel));
 }