コード例 #1
0
 private PopupService(IPopupNavigation popupNavigation = null)
 {
     s_popupNavigation          = popupNavigation ?? PopupNavigation.Instance;
     s_popupNavigation.Popping += RestrictPopAbility;
     s_popupNavigation.Popped  += ResetTopPopupPage;
     s_popupNavigation.Pushed  += ResetTopPopupPage;
 }
コード例 #2
0
        public WeatherInfoViewModel(INavigationService navigationService, IRestService restService,
                                    IQueryService queryService,
                                    ISettingsService settingsService, ILocationService locationService, IPopupNavigation popupNavigation)
        {
            Debug.WriteLine("GOT TO CON");
            CityWeatherViewModels = new ObservableCollection <CityWeatherViewModel>();

            _restService       = restService;
            _navigationService = navigationService;
            _queryService      = queryService;
            _settingsService   = settingsService;
            _locationService   = locationService;
            _popupNavigation   = popupNavigation;

            _getCurrentCityCommand = new Command(async() => await GetCurrentCity());

            GetWeatherCommand = new Command(async() => await GetWeatherInfo());

            MessagingCenter.Unsubscribe <string>(this, "NewAdded");
            MessagingCenter.Subscribe <string>(this, "NewAdded", AddCity);

            MessagingCenter.Unsubscribe <string>(this, "DeleteCity");
            MessagingCenter.Subscribe <string>(this, "DeleteCity", DeleteCity);

            Task.Run(async() => await CheckPermissionsAndContinue());
        }
コード例 #3
0
        public PopupBarcodeScannerService(IPopupNavigation popupNavigation)
        {
            PopupNavigation = popupNavigation;

            Padding = GetDefaultPadding();

            _scannerView = new ZXingScannerView
            {
                AutomationId      = "zxingScannerView",
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Options           = GetScanningOptions(),
            };

            var overlay = GetScannerOverlay();

            var grid = new Grid
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
            };

            grid.Children.Add(_scannerView);

            if (overlay != null)
            {
                grid.Children.Add(overlay);
            }

            _controller = new BarcodeScannerController(this);
            Content     = grid;
        }
コード例 #4
0
        public PackingListLandingInputPageViewModel(INavigationService navigationService,
                                                    IBarcodeReaderService barcodeReaderService,
                                                    IStatusBarService statusBarService,
                                                    INotificationService notificationService,
                                                    IPopupNavigation popupNavigation,
                                                    IUserService userService,
                                                    ICommonService commonService,
                                                    ILandingService landingService,
                                                    IWifiService wifiService,
                                                    ILabelValidationService labelValidationService)
            : base(navigationService, barcodeReaderService, statusBarService)
        {
            _notificationService    = notificationService;
            _popupNavigation        = popupNavigation;
            _userService            = userService;
            _commonService          = commonService;
            _landingService         = landingService;
            _wifiService            = wifiService;
            _labelValidationService = labelValidationService;

            Model = new PackingListLandingInputModel();
            MenuAdtionalButtons = new Dictionary <string, DelegateCommand>();

            CancelPackLanding         += ExecuteCancelPackLanding;
            CancelBillOfLadingLanding += ExecuteCancelBillOfLadingLanding;
            PauseLanding  += ExecutePauseLanding;
            EndingProcess += ExecuteEndingProcess;
        }
        public PackingListAccessoriesInputPageViewModel(INavigationService navigationService,
                                                        IBarcodeReaderService barcodeReaderService,
                                                        IStatusBarService statusBarService,
                                                        IUserService userService,
                                                        INotificationService notificationService,
                                                        IPopupNavigation popupNavigation,
                                                        ICommonService commonService,
                                                        IBoardingAccessoryService boardingAccessoryService,
                                                        IWifiService wifiService,
                                                        IBoardingService boardingService)
            : base(navigationService, barcodeReaderService, statusBarService)
        {
            _userService              = userService;
            _notificationService      = notificationService;
            _popupNavigation          = popupNavigation;
            _commonService            = commonService;
            _boardingAccessoryService = boardingAccessoryService;
            _wifiService              = wifiService;
            _boardingService          = boardingService;

            Model = new PackingListAccessoriesInputModel();

            ClosePackingListAccessory  += ExecuteClosePackingListAccessory;
            CancelPackBoarding         += ExecuteCancelPackBoarding;
            CancelBillOfLadingBoarding += ExecuteCancelBillOfLadingBoarding;
        }
コード例 #6
0
        public static Page TopPage(IPopupNavigation popupNavigation, IApplicationProvider applicationProvider)
        {
            Page page       = null;
            var  popupStack = popupNavigation.PopupStack.Where(x => !(x is PopupDialogContainer));

            if (popupStack.Count() > 0)
            {
                page = popupStack.LastOrDefault();
            }
            else if (applicationProvider.MainPage.Navigation.ModalStack.Count > 0)
            {
                page = applicationProvider.MainPage.Navigation.ModalStack.LastOrDefault();
            }
            else
            {
                page = applicationProvider.MainPage.Navigation.NavigationStack.LastOrDefault();
            }

            if (page == null)
            {
                page = applicationProvider.MainPage;
            }

            return(page.GetDisplayedPage());
        }
コード例 #7
0
 public MainPageViewModel()
 {
     _popupNavigation = PopupNavigation.Instance;
     _navigationService = DependencyService.Get<INavigationService>();
     NotificationsCommand = new DelegateCommand(async ()=>await NotificationsCommandExecute());
     MenuRedirectCommand = new DelegateCommand<string>(async (x) => await MenuRedirectCommandExecute(x));
 }
コード例 #8
0
        public MainPageViewModel(INavigationService navigationService, IPopupNavigation popupNavigation)
            : base(navigationService, popupNavigation)
        {
            Title = "Main Page";

            OpenPopupCommand = new DelegateCommand(OpenPopup);
        }
コード例 #9
0
 public PopupPageNavigationService(IPopupNavigation popupNavigation, IContainerExtension container,
                                   IApplicationProvider applicationProvider, IPageBehaviorFactory pageBehaviorFactor,
                                   ILoggerFacade logger)
     : base(container, applicationProvider, pageBehaviorFactor, logger)
 {
     _popupNavigation = popupNavigation;
 }
コード例 #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PopupViewStackServiceBase"/> class.
        /// </summary>
        /// <param name="view">The view.</param>
        /// <param name="popupNavigation">The popup navigation.</param>
        /// <param name="viewLocator">The view locator.</param>
        /// <param name="viewModelFactory">The view model factory.</param>
        protected PopupViewStackServiceBase(IView view, IPopupNavigation popupNavigation, IViewLocator viewLocator, IViewModelFactory viewModelFactory)
            : base(view, viewModelFactory)
        {
            _popupNavigation = popupNavigation;
            _viewLocator = viewLocator;
            PopupSubject = new BehaviorSubject<IImmutableList<IViewModel>>(ImmutableList<IViewModel>.Empty);

            Pushing = Observable.FromEvent<EventHandler<PopupNavigationEventArgs>, PopupNavigationEventArgs>(
                eventHandler =>
                {
                    void Handler(object? sender, PopupNavigationEventArgs args) => eventHandler(args);

                    return Handler;
                },
                x => _popupNavigation.Pushing += x,
                x => _popupNavigation.Pushing -= x)
                .Select(x => new PopupNavigationEvent((IViewFor)x.Page, x.IsAnimated));

            Pushed = Observable.FromEvent<EventHandler<PopupNavigationEventArgs>, PopupNavigationEventArgs>(
                eventHandler =>
                {
                    void Handler(object? sender, PopupNavigationEventArgs args)
                        => eventHandler(args);

                    return Handler;
                },
                x => _popupNavigation.Pushed += x,
                x => _popupNavigation.Pushed -= x)
                .Select(x => new PopupNavigationEvent((IViewFor)x.Page, x.IsAnimated));

            Popping = Observable.FromEvent<EventHandler<PopupNavigationEventArgs>, PopupNavigationEventArgs>(
                eventHandler =>
                {
                    void Handler(object? sender, PopupNavigationEventArgs args)
                        => eventHandler(args);

                    return Handler;
                },
                x => _popupNavigation.Popping += x,
                x => _popupNavigation.Popping -= x)
                .Select(x => new PopupNavigationEvent((IViewFor)x.Page, x.IsAnimated));

            Popped = Observable.FromEvent<EventHandler<PopupNavigationEventArgs>, PopupNavigationEventArgs>(
                eventHandler =>
                {
                    void Handler(object? sender, PopupNavigationEventArgs args) => eventHandler(args);

                    return Handler;
                },
                x => _popupNavigation.Popped += x,
                x => _popupNavigation.Popped -= x)
                .Select(x => new PopupNavigationEvent((IViewFor)x.Page, x.IsAnimated));

            Popped
                .Subscribe(popped => popped.ViewModel.InvokeViewModelAction<IDestructible>(x => x.Destroy()))
                .DisposeWith(NavigationDisposables);

            PopupSubject.DisposeWith(NavigationDisposables);
        }
コード例 #11
0
ファイル: ListsPageModel.cs プロジェクト: Jhultink/ToDoDemo
        public ListsPageModel(IToDoService toDoService, IPopupNavigation popupNavigation)
        {
            _toDoService     = toDoService;
            _popupNavigation = popupNavigation;

            CreateCommand = new Command(Create);
            DeleteCommand = new Command <ToDoList>(Delete);
        }
コード例 #12
0
 public static async Task PopAllPopupAsyncSafe(this INavigation sender, IPopupNavigation popupNavigation, bool animate = true)
 {
     if (Device.RuntimePlatform == "Test")
     {
         return;
     }
     await popupNavigation.PopAllAsync(animate);
 }
コード例 #13
0
        public NewItemViewModel()
        {
            _popupNavigation = Locator.Current.GetService <IPopupNavigation>();
            _drinkService    = Locator.Current.GetService <IDrinkService>();

            Save   = ReactiveCommand.CreateFromObservable(ExecuteSave).DisposeWith(Garbage);
            Cancel = ReactiveCommand.CreateFromObservable(ExecuteCancel).DisposeWith(Garbage);
        }
コード例 #14
0
        public void IPopupNavigation_IsRegistered()
        {
            var app = GetApp();
            IPopupNavigation popupNavigation = null;
            var ex = Record.Exception(() => popupNavigation = app.Container.Resolve <IPopupNavigation>());

            Assert.Null(ex);
            Assert.NotNull(popupNavigation);
        }
コード例 #15
0
        public void MockPopupNavigation_IsSet()
        {
            IPopupNavigation popupNavigation = null;
            var ex = Record.Exception(() => popupNavigation = PopupNavigation.Instance);

            Assert.Null(ex);
            Assert.NotNull(popupNavigation);
            Assert.IsType <PluginNavigationMock>(popupNavigation);
        }
コード例 #16
0
 public NavigationService(INavigation navigation,
                          IPopupNavigation popupNavigation,
                          IPageResolver pageResolver,
                          INavigationPageFactory navigationPageFactory)
 {
     this.navigation            = navigation;
     this.popupNavigation       = popupNavigation;
     this.pageResolver          = pageResolver;
     this.navigationPageFactory = navigationPageFactory;
 }
コード例 #17
0
        /**
         * intancia de la clase
         * retorana un folio result, muestra el modal.
         */
        public static async Task <bool> Show(IPopupNavigation navigator, List <string> phrases, string FOLIO)
        {
            var view = new vwPopupCOVIDSurvey(phrases, FOLIO);
            await navigator.PushAsync(view);

            var result = await view.GetResult();

            await navigator.PopAsync();

            return(true);
        }
コード例 #18
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="navigator"></param>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public static async Task <bool> Show(IPopupNavigation navigator, string username, string password, bool multiple = false)
        {
            var view = new PayNotificationView(username, password, multiple);
            await navigator.PushAsync(view);

            var result = await view.GetResult();

            await navigator.PopAsync();

            return(true);
        }
コード例 #19
0
        /**
         * intancia de la clase
         * retorana un folio result, muestra el modal.
         */
        public static async Task <FolioResult> Show(IPopupNavigation navigator)
        {
            var view = new vwPopupFolio();
            await navigator.PushAsync(view);

            var result = await view.GetResult();

            await navigator.PopAsync();

            return(result);
        }
コード例 #20
0
        public static async Task <PromotionalCodeResult> Show(IPopupNavigation navigator, InternetService internetService, double Total)
        {
            var view = new PromotionalCodeView(internetService, Total);
            await navigator.PushAsync(view);

            var result = await view.GetResult();

            await navigator.PopAsync();

            return(result);
        }
コード例 #21
0
        public static async Task <EditQuantityResponse> Show(IPopupNavigation navigator, int Current, int Min = 1, int Max = 300)
        {
            var view = new EditQuantityView(Current, Min, Max);
            await navigator.PushAsync(view);

            var result = await view.GetResult();

            await navigator.PopAsync();

            return(result);
        }
コード例 #22
0
        public ItemsPageModel(IToDoService toDoService, IPopupNavigation popupNavigation)
        {
            _toDoService     = toDoService;
            _popupNavigation = popupNavigation;

            CreateCommand     = new Command(Create);
            EditListCommand   = new Command(EditList);
            DeleteListCommand = new Command(DeleteList);
            EditItemCommand   = new Command <ToDoItem>(EditItem);
            DeleteItemCommand = new Command <ToDoItem>(DeleteItem);
        }
コード例 #23
0
        public PopupWithPickerPageViewModel(INavigationService navigationService, IPopupNavigation popupNavigation)
            : base(navigationService, popupNavigation)
        {
            ItemList = new List <string>
            {
                "One",
                "Two",
                "Three",
                "Four",
            };

            ClosePopupCommand = new DelegateCommand(ClosePopup);
        }
コード例 #24
0
        public CityWeatherViewModel(WeatherModel weather, bool newSlide, IPopupNavigation popupNavigation)
        {
            _popupNavigation = popupNavigation;

            Location          = weather.Title;
            Temperature       = weather.Main.Temperature;
            WindSpeed         = weather.Wind.Speed;
            Humidity          = weather.Main.Humidity;
            Sunrise           = weather.Sys.Sunrise;
            Sunset            = weather.Sys.Sunset;
            WeatherConditions = Constants.Constants.GetWeatherConditions(weather.Weather[0].Id);
            IsAddNewSlide     = newSlide;
        }
コード例 #25
0
 public static PopupService GetInstance(IPopupNavigation popupNavigation = null)
 {
     if (s_popupNavigation == null)
     {
         lock (s_threadPadlock)
         {
             if (s_popupNavigation == null)
             {
                 s_internalPopupService = new PopupService(popupNavigation);
             }
         }
     }
     return(s_internalPopupService);
 }
        public BillOfLadingInformationsPageViewModel(INavigationService navigationService,
                                                     IBarcodeReaderService barcodeReaderService,
                                                     IStatusBarService statusBarService,
                                                     INotificationService notificationService,
                                                     IPopupNavigation popupNavigation,
                                                     IBillOfLadingService billOfLadingService)
            : base(navigationService, barcodeReaderService, statusBarService)
        {
            _notificationService = notificationService;
            _popupNavigation     = popupNavigation;
            _billOfLadingService = billOfLadingService;

            Model = new BillOfLadingInformationsModel();
        }
コード例 #27
0
        public async Task ExecuteAndWait(Action action, View view)
        {
            var popup = new PopupPage()
            {
                CloseWhenBackgroundIsClicked = false,
                Content         = view,
                BackgroundColor = Color.Transparent,
                IsBusy          = true,
            };
            IPopupNavigation ipn = PopupNavigation.Instance;
            await ipn.PushAsync(popup);

            action.Invoke();
            await ipn.RemovePageAsync(popup);
        }
コード例 #28
0
        public PopupViewStackServiceFixture()
        {
            _view             = Substitute.For <IView>();
            _popupNavigation  = Substitute.For <IPopupNavigation>();
            _viewLocator      = Substitute.For <IViewLocator>();
            _viewModelFactory = Substitute.For <IViewModelFactory>();

            _view
            .PushPage(Arg.Any <INavigable>(), Arg.Any <string>(), Arg.Any <bool>(), Arg.Any <bool>())
            .Returns(Observable.Return(Unit.Default));
            _view.PopPage().Returns(Observable.Return(Unit.Default));
            _viewLocator.ResolveView(Arg.Any <IViewModel>()).Returns(new PopupMock {
                ViewModel = new NavigableViewModelMock()
            });
            _viewModelFactory.Create <NavigableViewModelMock>(Arg.Any <string>()).Returns(new NavigableViewModelMock());
        }
        public MaintenanceSealsInputPageViewModel(INavigationService navigationService,
                                                  IBarcodeReaderService barcodeReaderService,
                                                  IStatusBarService statusBarService,
                                                  INotificationService notificationService,
                                                  IPopupNavigation popupNavigation,
                                                  IBoardingAccessoryService boardingAccessoryService,
                                                  IWifiService wifiService)
            : base(navigationService, barcodeReaderService, statusBarService)
        {
            _notificationService      = notificationService;
            _popupNavigation          = popupNavigation;
            _boardingAccessoryService = boardingAccessoryService;
            _wifiService = wifiService;

            Model = new MaintenanceSealsInputModel();
        }
コード例 #30
0
        public PacksDetailViewPageViewModel(INavigationService navigationService,
                                            IBarcodeReaderService barcodeReaderService,
                                            IStatusBarService statusBarService,
                                            INotificationService notificationService,
                                            IPopupNavigation popupNavigation,
                                            IBillOfLadingService billOfLadingService,
                                            IWifiService wifiService)
            : base(navigationService, barcodeReaderService, statusBarService)
        {
            _notificationService = notificationService;
            _popupNavigation     = popupNavigation;
            _billOfLadingService = billOfLadingService;
            _wifiService         = wifiService;

            Model = new PacksDetailViewModel();
        }