Пример #1
0
        private void Activate()
        {
            segment.AddSegment("Today");
            segment.AddSegment("Tomorrow");
            segment.AddSegment("Week");
            segment.TintColor = AppSettings.Constants.DarkGrayBackgroundTintColor;
            segment.SelectedSegmentChanged += SelectedSegmentItemChanged;

            (segment.Content as StackLayout).Children [2].IsEnabled = false;             //The "Week" option is disabled for this release
            if (Device.OS == TargetPlatform.Android)
            {
                ((segment.Content as StackLayout).Children [2] as Button).TextColor = Color.FromHex("#cccccc");
                ((segment.Content as StackLayout).Children [2] as Button).Opacity   = .50;
            }

            this.GroomingSelectionViewContainer.Content = new StackLayout()
            {
                Children  = { segment },
                IsVisible = AppHelperFunctions.UserHasRegisteredPets()
            };
        }
Пример #2
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            if (!AppHelperFunctions.UserHasRegisteredPets())
            {
                this.PetGroomingServicesList.IsVisible = false;

                this.UnauthorizedText.IsVisible = true;
                await DisplayAlert("Feature Disabled",
                                   @"In order to use this feature, you must first create your pet's basic and grooming profile from the 'My Pets' tab.", "OK");

                return;
            }
            this.GroomingSelectionViewContainer.IsVisible =
                this.PetGroomingServicesList.IsVisible    = true;

            using (var l = App.GetLoadingDialog(AppSettings.Constants.LoaderText))
            {
                l.Show();
                try
                {
                    await viewModel.LoadGroomingSlots();

                    this.PetGroomingServicesList.ItemsSource = null;
                    this.PetGroomingServicesList.ItemsSource = viewModel.PetServicesGroomingSlots;

                    l.Hide();
                    if (viewModel.PetServicesGroomingSlots.Count == 0)
                    {
                        await DisplayAlert("Load Error", "There are no grooming appointments available for today.", "OK");
                    }
                } catch
                {
                    l.Hide();
                    await DisplayAlert(AppSettings.Constants.DisplayGeneralErrorDlgTitle, AppSettings.Constants.DisplayGeneralErrorDlgMessage, "OK");
                }
            }
        }