public ViewModelLocator() { AppViewModel = new AppViewModel(); TacirViewModel = new Tacir_InfoViewModel(navigationService); navigationService.AddPage(AppViewModel, ViewType.AppView); navigationService.AddPage(TacirViewModel, ViewType.Tacir_Info); navigationService.NavigateTo(ViewType.Tacir_Info); }
public void LoadStartPage() { Resources = new DarkThemeResources(); var mainPage = new NavigationService(); mainPage.AddPage <StartPageModel>(AppResources.StartPageText); mainPage.AddPage <PropertyPageModel>(AppResources.PropertyPageText); mainPage.AddPage <LogPageModel>(AppResources.LogPageText); MainPage = mainPage; }
private INavigationService CreateNavigationService() { var navigationService = new NavigationService(); navigationService.AddPage(nameof(Flow), new Uri("/RPARobot;component/Pages/FlowPage.xaml", UriKind.Relative)); navigationService.AddPage(nameof(Task), new Uri("/RPARobot;component/Pages/TaskPage.xaml", UriKind.Relative)); navigationService.AddPage(nameof(Log), new Uri("/RPARobot;component/Pages/LogPage.xaml", UriKind.Relative)); navigationService.AddPage(nameof(UserPreferences), new Uri("/RPARobot;component/Pages/UserPreferencesPage.xaml", UriKind.Relative)); return(navigationService); }
public ViewModelLocator() { _db = new ProjectContext(); //Todo Remove after release FillDbWithFakeData(); LoadAllTables(); appViewModel = new AppViewModel(_db); mainViewModel = new MainViewModel(navigationService, _db); editProductViewModel = new EditProductViewModel(_db); navigationService.AddPage(mainViewModel, VM.Add); navigationService.AddPage(editProductViewModel, VM.EditProduct); navigationService.NavigateTo(VM.Add); }
public App() { //InitializeComponent(); var navigationService = new NavigationService(); var stockService = new StockService(); navigationService.AddPage(nameof(MainPage), typeof(MainPage)); navigationService.AddPage(nameof(DetailsPage), typeof(DetailsPage)); navigationService.AddPage(nameof(StockListPage), typeof(StockListPage)); navigationService.AddPage(nameof(MyStockListPage), typeof(MyStockListPage)); SimpleIoc.Default.Register <INavigationService>(() => navigationService, true); SimpleIoc.Default.Register <IStockService>(() => stockService, true); navigationService.Initialize( (MainPage = new NavigationPage(new MainPage())) as NavigationPage); }
public ViewModelLoactor() { try { var builder = new ContainerBuilder(); //builder.RegisterType<MoviesRepository>().As<IMoviesRepository>().InstancePerLifetimeScope(); builder.RegisterType <MainViewModel>(); builder.RegisterType <MainNavigationViewModel>(); builder.RegisterType <LoginViewModel>(); builder.RegisterType <LoadingViewModel>().SingleInstance(); builder.RegisterType <MessageBoxViewModel>().SingleInstance(); builder.RegisterType <RegistrationConfirmCodeViewModel>(); builder.RegisterType <SignUpViewModel>(); builder.RegisterType <Repo>(); builder.RegisterType <NavigationServiceInternal>().SingleInstance(); builder.RegisterInstance(navigationService).SingleInstance(); builder.RegisterInstance(navigationServiceInternal).SingleInstance(); builder.RegisterType <BoardViewModel>(); builder.RegisterType <ProjectConfigurationViewModel>(); builder.RegisterType <ProjectsListViewModel>(); builder.RegisterType <NotificationsViewModel>(); builder.RegisterType <ForgotPasswordViewModel>(); builder.RegisterType <EmailEnterViewModel>(); builder.RegisterType <LoginResponseHandler>().SingleInstance(); builder.RegisterType <SignUpResponseHandler>().SingleInstance(); Container = builder.Build(); using (var scope = Container.BeginLifetimeScope()) { MainViewModel = scope.Resolve <MainViewModel>(); MainNavigationViewModel = scope.Resolve <MainNavigationViewModel>(); LoadingViewModel = scope.Resolve <LoadingViewModel>(); LoginViewModel = scope.Resolve <LoginViewModel>(); RegistrationConfirmCodeViewModel = scope.Resolve <RegistrationConfirmCodeViewModel>(); SignUpViewModel = scope.Resolve <SignUpViewModel>(); MyRepo = scope.Resolve <Repo>(); InternalNavigationService = scope.Resolve <NavigationServiceInternal>(); BoardViewModel = scope.Resolve <BoardViewModel>(); ProjectConfigurationView = scope.Resolve <ProjectConfigurationViewModel>(); NotificationsViewModel = scope.Resolve <NotificationsViewModel>(); ProjectsListViewModel = scope.Resolve <ProjectsListViewModel>(); ForgotPasswordViewModel = scope.Resolve <ForgotPasswordViewModel>(); EmailEnterViewModel = scope.Resolve <EmailEnterViewModel>(); } navigationService.AddPage(LoginViewModel, VM.LoginViewModel); navigationService.AddPage(MainNavigationViewModel, VM.MainNavigationViewModel); navigationService.AddPage(SignUpViewModel, VM.SignUpViewModel); navigationService.AddPage(RegistrationConfirmCodeViewModel, VM.RegistrationConfirmCodeViewModel); navigationService.AddPage(ForgotPasswordViewModel, VM.ForgotPasswordViewModel); navigationService.AddPage(EmailEnterViewModel, VM.EmailEnterViewModel); navigationService.NavigateTo(VM.LoginViewModel); navigationServiceInternal.AddPage(ProjectsListViewModel, VM.ProjectsListViewModel); navigationServiceInternal.AddPage(BoardViewModel, VM.BoardViewModel); navigationServiceInternal.AddPage(ProjectConfigurationView, VM.ProjectConfigurationView); navigationServiceInternal.AddPage(NotificationsViewModel, VM.NotificationsViewModel); navigationServiceInternal.NavigateTo(VM.ProjectsListViewModel); } catch (Exception) { throw; } }
private void ConfigurateNavigationService(NavigationService navigationService, IServiceProvider serviceProvider) { navigationService.AddPage(PageEnum.galleryPage, serviceProvider.GetRequiredService <GalleryPageView>()); navigationService.AddPage(PageEnum.editorPage, serviceProvider.GetRequiredService <EditorPageView>()); }
public ViewModelLocator() { navigationService = new NavigationService(); appViewModel = new AppViewModel(); logInViewModel = new LogInViewModel(navigationService); registerEmailViewModel = new RegisterEmailViewModel(navigationService); forGetPassViewModel = new ForgetPassViewModel(navigationService); sendCodeEmailViewModel = new SendCodeEmailViewModel(navigationService); homeViewModel = new HomeViewModel(navigationService); confirmationCodeViewModel = new ConfirmCodeViewModel(navigationService); signUpViewModel = new SignUpViewModel(navigationService); createProjectViewModel = new CreateProjectViewModel(navigationService); projectPageViewModel = new ProjectPageViewModel(navigationService); listChannelsViewModel = new ListChannelsViewModel(navigationService); chatViewModel = new ChatViewModel(navigationService); accountViewModel = new AccountViewModel(navigationService); navigationService.AddPage(signUpViewModel, ViewType.SignUp); navigationService.AddPage(confirmationCodeViewModel, ViewType.ConfirmCode); navigationService.AddPage(registerEmailViewModel, ViewType.RegisterEmail); navigationService.AddPage(forGetPassViewModel, ViewType.ForgetPass); navigationService.AddPage(sendCodeEmailViewModel, ViewType.ForgotEmailCode); navigationService.AddPage(homeViewModel, ViewType.Home); navigationService.AddPage(logInViewModel, ViewType.LogIn); navigationService.AddPage(createProjectViewModel, ViewType.CreateProject); navigationService.AddPage(chatViewModel, ViewType.ChatView); navigationService.AddPage(projectPageViewModel, ViewType.ProjectPage); navigationService.AddPage(listChannelsViewModel, ViewType.ListChannels); navigationService.AddPage(accountViewModel, ViewType.Profile); userService = new UserService(); string user = CheckLoginLog.Load(); if (user != "" && userService.Select(user) != null) { CurrentUser.Instance.User = userService.Select(user); navigationService.NavigateTo(ViewType.Home); } else { navigationService.NavigateTo(ViewType.LogIn); } }