Пример #1
0
        public App(IConfigProvider configProvider)
        {
            InitializeComponent();
            Locator.CurrentMutable.RegisterConstant(this, typeof(IScreen));
            Locator.CurrentMutable.Register(() => new SearchPage(), typeof(IViewFor <SearchViewModel>));
            Locator.CurrentMutable.RegisterLazySingleton(
                () => RestService.For <IStationSearchApi>(Constants.SearchEndpoint),
                typeof(IStationSearchApi));

            Router.Navigate.Execute(new SearchViewModel(Locator.Current.GetService <IStationSearchApi>()));
            MainPage            = new ReactiveUI.XamForms.RoutedViewHost();
            this.configProvider = configProvider;
        }
Пример #2
0
        public MainView()
        {
            Router = new RoutingState();
            Router.NavigationStack.Add(new HomeViewModel());
            Locator.CurrentMutable.RegisterConstant(this, typeof(IScreen));

            InitializeComponent();

            var viewHost = new ReactiveUI.XamForms.RoutedViewHost {
                Router = this.Router
            };

            NavigationPage.SetHasNavigationBar(this, true);
            Detail = viewHost as NavigationPage;
        }
Пример #3
0
        public App()
        {
            InitializeComponent();

            RxApp.DefaultExceptionHandler = new ObservableExceptionHandler();

            AppBootstrapper = new AppBootstrapper();

            AppBootstrapper
            .Router
            .NavigateAndReset
            .Execute(new HomeViewModel())
            .Subscribe();

            MainPage = new ReactiveUI.XamForms.RoutedViewHost();
        }