private PopupService(IPopupNavigation popupNavigation = null) { s_popupNavigation = popupNavigation ?? PopupNavigation.Instance; s_popupNavigation.Popping += RestrictPopAbility; s_popupNavigation.Popped += ResetTopPopupPage; s_popupNavigation.Pushed += ResetTopPopupPage; }
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()); }
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; }
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; }
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()); }
public MainPageViewModel() { _popupNavigation = PopupNavigation.Instance; _navigationService = DependencyService.Get<INavigationService>(); NotificationsCommand = new DelegateCommand(async ()=>await NotificationsCommandExecute()); MenuRedirectCommand = new DelegateCommand<string>(async (x) => await MenuRedirectCommandExecute(x)); }
public MainPageViewModel(INavigationService navigationService, IPopupNavigation popupNavigation) : base(navigationService, popupNavigation) { Title = "Main Page"; OpenPopupCommand = new DelegateCommand(OpenPopup); }
public PopupPageNavigationService(IPopupNavigation popupNavigation, IContainerExtension container, IApplicationProvider applicationProvider, IPageBehaviorFactory pageBehaviorFactor, ILoggerFacade logger) : base(container, applicationProvider, pageBehaviorFactor, logger) { _popupNavigation = popupNavigation; }
/// <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); }
public ListsPageModel(IToDoService toDoService, IPopupNavigation popupNavigation) { _toDoService = toDoService; _popupNavigation = popupNavigation; CreateCommand = new Command(Create); DeleteCommand = new Command <ToDoList>(Delete); }
public static async Task PopAllPopupAsyncSafe(this INavigation sender, IPopupNavigation popupNavigation, bool animate = true) { if (Device.RuntimePlatform == "Test") { return; } await popupNavigation.PopAllAsync(animate); }
public NewItemViewModel() { _popupNavigation = Locator.Current.GetService <IPopupNavigation>(); _drinkService = Locator.Current.GetService <IDrinkService>(); Save = ReactiveCommand.CreateFromObservable(ExecuteSave).DisposeWith(Garbage); Cancel = ReactiveCommand.CreateFromObservable(ExecuteCancel).DisposeWith(Garbage); }
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); }
public void MockPopupNavigation_IsSet() { IPopupNavigation popupNavigation = null; var ex = Record.Exception(() => popupNavigation = PopupNavigation.Instance); Assert.Null(ex); Assert.NotNull(popupNavigation); Assert.IsType <PluginNavigationMock>(popupNavigation); }
public NavigationService(INavigation navigation, IPopupNavigation popupNavigation, IPageResolver pageResolver, INavigationPageFactory navigationPageFactory) { this.navigation = navigation; this.popupNavigation = popupNavigation; this.pageResolver = pageResolver; this.navigationPageFactory = navigationPageFactory; }
/** * 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); }
/// <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); }
/** * 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); }
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); }
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); }
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); }
public PopupWithPickerPageViewModel(INavigationService navigationService, IPopupNavigation popupNavigation) : base(navigationService, popupNavigation) { ItemList = new List <string> { "One", "Two", "Three", "Four", }; ClosePopupCommand = new DelegateCommand(ClosePopup); }
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; }
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(); }
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); }
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(); }
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(); }