private static void SetupNavigation()
 {
     if (ViewModelBase.IsInDesignModeStatic)
     {
         SimpleIoc.Default.Register <IFrameNavigationService, FrameNavigationService>();
     }
     else
     {
         var navigationService = new FrameNavigationService();
         navigationService.Configure("Home", new Uri("../View/Home.xaml", UriKind.Relative));
         navigationService.Configure("PageOne", new Uri("../View/PageOne.xaml", UriKind.Relative));
         navigationService.Configure("Settings", new Uri("../View/Settings.xaml", UriKind.Relative));
         navigationService.Configure("Help", new Uri("../View/Help.xaml", UriKind.Relative));
         SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
     }
 }
        /// <summary>
        /// Configure and register NavigationService
        /// </summary>
        private void SetupNavigation()
        {
            if (SimpleIoc.Default.IsRegistered <IFrameNavigationService>())
            {
                //prevent from registering multiple times in Design mode
                return;
            }

            var navigationService = new FrameNavigationService();

            navigationService.Configure("Home", new Uri("../Views/HomePage.xaml", UriKind.Relative));
            navigationService.Configure("TextTokenizer", new Uri("../Views/TextTokenizerPage.xaml", UriKind.Relative));
            navigationService.Configure("FileSystemDiffSimulator", new Uri("../Views/FileSystemDiffSimulatorPage.xaml", UriKind.Relative));

            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
        }
Esempio n. 3
0
        internal static void SetAndReg()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            var navigationService = new FrameNavigationService();

            navigationService.Configure("Sign", new Uri("Views/Sign.xaml", UriKind.Relative));
            navigationService.Configure("Doctor", new Uri("Views/Doctor.xaml", UriKind.Relative));
            navigationService.Configure("Patient", new Uri("Views/Patient.xaml", UriKind.Relative));
            navigationService.Configure("NewPatient", new Uri("Views/NewPatient.xaml", UriKind.Relative));
            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);

            SimpleIoc.Default.Register <MainViewModel>();
            SimpleIoc.Default.Register <SignViewModel>();
            SimpleIoc.Default.Register <PatientViewModel>(true);
            SimpleIoc.Default.Register <DoctorViewModel>(true);
            SimpleIoc.Default.Register <NewPatientViewModel>(true);
        }
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            var navigationService = new FrameNavigationService();

            navigationService.Configure("Main", new Uri("../MainWindow.xaml", UriKind.Relative));
            navigationService.Configure("Start", new Uri("../Views/StartView.xaml", UriKind.Relative));
            navigationService.Configure("CurrentQuestion", new Uri("../Views/CurrentQuestionView.xaml", UriKind.Relative));
            navigationService.Configure("Summary", new Uri("../Views/SummaryView.xaml", UriKind.Relative));


            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);

            SimpleIoc.Default.Register <MainViewModel>(true);
            SimpleIoc.Default.Register <StartViewModel>(true);
            SimpleIoc.Default.Register <CurrentQuestionViewModel>(true);
            SimpleIoc.Default.Register <SummaryViewModel>(true);
        }
Esempio n. 5
0
        private static void ConfigureServices(IServiceCollection serviceCollection)
        {
            serviceCollection.AddSingleton <SettingsService>();

            serviceCollection.AddDbContext <TestDbContext>(options => options.UseSqlServer(new SettingsService().Settings.ConnectionString), ServiceLifetime.Transient);

            var navigationService = new FrameNavigationService();

            navigationService.Configure("Testing", new Uri("../Views/Testing/TestingPage.xaml", UriKind.Relative));
            navigationService.Configure("Protocols", new Uri("../Views/Protocols/ProtocolsPage.xaml", UriKind.Relative));
            navigationService.Configure("Protocol", new Uri("../Views/Protocols/ProtocolPage.xaml", UriKind.Relative));
            navigationService.Configure("Settings", new Uri("../Views/Settings/SettingsPage.xaml", UriKind.Relative));

            serviceCollection.AddSingleton <IFrameNavigationService>(navigationService);

            serviceCollection.AddSingleton <MainViewModel>();
            serviceCollection.AddTransient <TestingViewModel>();
            serviceCollection.AddTransient <SettingsViewModel>();
            serviceCollection.AddTransient <ProtocolViewModel>();
            serviceCollection.AddTransient <ProtocolsViewModel>();
        }
Esempio n. 6
0
        private INavigationService GetConfiguredNavigationService()
        {
            var navigationService = new FrameNavigationService();
            var pages             = AppDomain.CurrentDomain.GetAssemblies()
                                    .SelectMany(s => s.GetTypes())
                                    .Where(t => typeof(Page).IsAssignableFrom(t));

            foreach (var page in pages)
            {
                navigationService.Configure(page, page.Name);
            }
            return(navigationService);
        }
Esempio n. 7
0
        private static void SetupNavigation()
        {
            var navigationService = new FrameNavigationService();

            navigationService.Configure("Login", new Uri("../Views/LoginView.xaml", UriKind.Relative));
            navigationService.Configure("CustomerDetails", new Uri("../Views/CustomerDetailsView.xaml", UriKind.Relative));
            navigationService.Configure("AddLines", new Uri("../Views/AddLinesView.xaml", UriKind.Relative));
            navigationService.Configure("ManageLines", new Uri("../Views/ManageLinesView.xaml", UriKind.Relative));
            navigationService.Configure("Simulator", new Uri("../Views/SimulatorView.xaml", UriKind.Relative));
            navigationService.Configure("ChooseReceipts", new Uri("../Views/ChooseReceiptsView.xaml", UriKind.Relative));
            navigationService.Configure("Receipts", new Uri("../Views/ReceiptsView.xaml", UriKind.Relative));
            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
        }
Esempio n. 8
0
        public static void setupNavigation()
        {
            var navigationService = new FrameNavigationService();

            navigationService.Configure("HomeView", new System.Uri("/View/StandardModelView/HomeView.xaml", UriKind.Relative));
            navigationService.Configure("SupervisorView", new System.Uri("/View/StandardModelView/SupervisorView.xaml", UriKind.Relative));
            navigationService.Configure("ManagerView", new System.Uri("/View/StandardModelView/ManagerView.xaml", UriKind.Relative));

            navigationService.Configure("EngineeredHomeView", new System.Uri("/View/EngineeredModelView/EngineeredHomeView.xaml", UriKind.Relative));
            navigationService.Configure("EngineeredSupervisorView", new System.Uri("/View/EngineeredModelView/EngineeredSupervisorView.xaml", UriKind.Relative));
            navigationService.Configure("EngineeredManagerView", new System.Uri("/View/EngineeredModelView/EngineeredManagerView.xaml", UriKind.Relative));

            navigationService.Configure("RouteQueueView", new System.Uri("/View/RouteQueueView.xaml", UriKind.Relative));

            navigationService.Configure("LoginView", new System.Uri("/View/UserControlView/LoginView.xaml", UriKind.Relative));
            navigationService.Configure("AddUserView", new System.Uri("/View/UserControlView/AddUserView.xaml", UriKind.Relative));

            SimpleIoc.Default.Unregister <IFrameNavigationService>();
            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
        }
Esempio n. 9
0
        private static void InitNavigation()
        {
            var navigationService = new FrameNavigationService();

            navigationService.Configure("MainView", new Uri("../View/MainView.xaml", UriKind.Relative));
            navigationService.Configure("LoginView", new Uri("../View/LoginView.xaml", UriKind.Relative));
            navigationService.Configure("RegisterView", new Uri("../View/RegisterView.xaml", UriKind.Relative));
            navigationService.Configure("StockView", new Uri("../View/StockView.xaml", UriKind.Relative));
            navigationService.Configure("SpotView", new Uri("../View/SpotView.xaml", UriKind.Relative));
            navigationService.Configure("AccountView", new Uri("../View/AccountView.xaml", UriKind.Relative));
            navigationService.Configure("SettingsView", new Uri("../View/SettingsView.xaml", UriKind.Relative));

            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
        }
Esempio n. 10
0
        private static void SetupNavigation()
        {
            var navigationService = new FrameNavigationService();

            navigationService.Configure("LoginView", new Uri("../Views/LoginView.xaml", UriKind.Relative));
            navigationService.Configure("AdresView", new Uri("../Views/AdresView.xaml", UriKind.Relative));
            navigationService.Configure("PodsumowanieView", new Uri("../Views/PodsumowanieView.xaml", UriKind.Relative));
            navigationService.Configure("ResignView", new Uri("../Views/ResignView.xaml", UriKind.Relative));
            navigationService.Configure("TaxiView", new Uri("../Views/TaxiView.xaml", UriKind.Relative));
            navigationService.Configure("ThankYouView", new Uri("../Views/ThankYouView.xaml", UriKind.Relative));
            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
        }
        private static void SetupNavigation()
        {
            var navigationService = new FrameNavigationService();

            navigationService.Configure("Home", new Uri("../Views/HomeViewUC.xaml", UriKind.Relative));
            navigationService.Configure("UitgavenLijst", new Uri("../Views/UitgavenLijstViewUC.xaml", UriKind.Relative));
            navigationService.Configure("UitgavenNieuw", new Uri("../Views/UitgavenNieuwViewUC.xaml", UriKind.Relative));
            navigationService.Configure("UitgavenWijzigen", new Uri("../Views/UitgavenWijzigenViewUC.xaml", UriKind.Relative));
            navigationService.Configure("TeBetalenOverzicht", new Uri("../Views/TeBetalenOverzichtViewUC.xaml", UriKind.Relative));
            navigationService.Configure("PersoonOverzicht", new Uri("../Views/PersoonOverzichtViewUC.xaml", UriKind.Relative));

            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
        }
        /// <summary>
        /// Initializes a new instance of the ViewModelLocator class.
        /// </summary>
        public ViewModelLocator()
        {
            SimpleIoc.Default.Reset();

            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            // Register navigation service (path to 'user control' by key):
            var navigationService = new FrameNavigationService();

            navigationService.Configure(Resources.CashierViewKey, new Uri("../View/CashierView.xaml", UriKind.RelativeOrAbsolute));
            navigationService.Configure(Resources.NewTicketViewKey, new Uri("../View/NewTicketView.xaml", UriKind.RelativeOrAbsolute));
            navigationService.Configure(Resources.FlightsViewKey, new Uri("../View/FlightsView.xaml", UriKind.RelativeOrAbsolute));
            navigationService.Configure(Resources.TariffsViewKey, new Uri("../View/TariffsView.xaml", UriKind.RelativeOrAbsolute));
            navigationService.Configure(Resources.BoughtTicketViewKey, new Uri("../View/BoughtTicketView.xaml", UriKind.RelativeOrAbsolute));
            navigationService.Configure(Resources.AllPassengerViewKey, new Uri("../View/AllPassengerView.xaml", UriKind.RelativeOrAbsolute));
            navigationService.Configure(Resources.NewPassengerViewKey, new Uri("../View/NewPassengerView.xaml", UriKind.RelativeOrAbsolute));

            // Register services and repositories:
            SimpleIoc.Default.Register <IMainNavigationService>(() => navigationService);
            SimpleIoc.Default.Register <IDialogMessage, DialogAbout>();
            SimpleIoc.Default.Register <ITicketRepository, AllTicketsModelRepository>();
            SimpleIoc.Default.Register <ICashierRepository, CashierRepository>();
            SimpleIoc.Default.Register <IPassengerRepository, PassengerModelRepository>();
            SimpleIoc.Default.Register <IBoughtTicketRepository, BoughtTicketRepository>();
            SimpleIoc.Default.Register <IFlightRepository, FlightModelRepository>();
            SimpleIoc.Default.Register <IPlaceInFlightRepository, PlaceInFlightRepository>();
            SimpleIoc.Default.Register <IPlaceInAircraftRepository, PlaceInAircraftRepository>();
            SimpleIoc.Default.Register <ITariffsRepository, TariffsRepository>();
            SimpleIoc.Default.Register <IPdfFileDialogService, PdfFileDialogService>();
            SimpleIoc.Default.Register <IWordFileDialogService, WordFileDialogService>();
            SimpleIoc.Default.Register <IXmlDialogService, XmlDialogService>();
            SimpleIoc.Default.Register <INewProcessGo, NewProcessGo>();

            // Register view model:
            SimpleIoc.Default.Register <MainViewModel>();
            SimpleIoc.Default.Register <NewTicketVM>();
            SimpleIoc.Default.Register <FlightsVM>();
            SimpleIoc.Default.Register <TariffsVM>();
            SimpleIoc.Default.Register <BoughtTicketVM>();
            SimpleIoc.Default.Register <AllPassengersVM>();
            SimpleIoc.Default.Register <NewPassengerVM>();
            SimpleIoc.Default.Register <CashierVM>();
        }
Esempio n. 13
0
        private static void SetupNavigation()
        {
            SimpleIoc.Default.Unregister <IFrameNavigationService>();
            var navigationService = new FrameNavigationService();

            navigationService.Configure("SummaryPage", new Uri("../Pages/SummaryPage.xaml", UriKind.Relative));
            navigationService.Configure("UserPage", new Uri("../Pages/UserPage.xaml", UriKind.Relative));
            navigationService.Configure("DepartmentPage", new Uri("../Pages/DepartmentPage.xaml", UriKind.Relative));
            navigationService.Configure("DevicePage", new Uri("../Pages/DevicePage.xaml", UriKind.Relative));
            navigationService.Configure("DeviceRolePage", new Uri("../Pages/DeviceRolePage.xaml", UriKind.Relative));
            navigationService.Configure("TimeSegmentPage", new Uri("../Pages/TimeSegmentPage.xaml", UriKind.Relative));
            navigationService.Configure("TimeGroupPage", new Uri("../Pages/TimeGroupPage.xaml", UriKind.Relative));
            navigationService.Configure("TimeZonePage", new Uri("../Pages/TimeZonePage.xaml", UriKind.Relative));
            navigationService.Configure("DeviceTrafficLogPage", new Uri("../Pages/DeviceTrafficLogPage.xaml", UriKind.Relative));
            navigationService.Configure("DeviceOperationLogPage", new Uri("../Pages/DeviceOperationLogPage.xaml", UriKind.Relative));
            navigationService.Configure("SysDictionaryPage", new Uri("../Pages/SysDictionaryPage.xaml", UriKind.Relative));
            navigationService.Configure("SysRolePage", new Uri("../Pages/SysRolePage.xaml", UriKind.Relative));
            navigationService.Configure("SysOperatorPage", new Uri("../Pages/SysOperatorPage.xaml", UriKind.Relative));
            navigationService.Configure("FloorPage", new Uri("../Pages/FloorPage.xaml", UriKind.Relative));
            navigationService.Configure("FloorMonitorPage", new Uri("../Pages/FloorMonitorPage.xaml", UriKind.Relative));
            navigationService.Configure("SysOperationLogPage", new Uri("../Pages/SysOperationLogPage.xaml", UriKind.Relative));
            navigationService.Configure("DataSyncPage", new Uri("../Pages/DataSyncPage.xaml", UriKind.Relative));
            navigationService.Configure("DataCleanPage", new Uri("../Pages/DataCleanPage.xaml", UriKind.Relative));

            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
        }
Esempio n. 14
0
        private static void SetupNavigation()
        {
            var navigationService = new FrameNavigationService();

            navigationService.Configure("Home", new Uri("../Views/HomePage.xaml", UriKind.Relative));
            navigationService.Configure("ManageUsers", new Uri("../Views/ManageUsersPage.xaml", UriKind.Relative));
            navigationService.Configure("DatabaseReset", new Uri("../Views/DatabaseResetPage.xaml", UriKind.Relative));

            navigationService.Configure("NewProject", new Uri("../Views/NewProjectPage.xaml", UriKind.Relative));
            navigationService.Configure("BrowseProjects", new Uri("../Views/BrowseProjectsPage.xaml", UriKind.Relative));
            navigationService.Configure("Project", new Uri("../Views/ProjectPage.xaml", UriKind.Relative));

            navigationService.Configure("NewReaction", new Uri("../Views/NewReactionPage.xaml", UriKind.Relative));
            navigationService.Configure("BrowseReactions", new Uri("../Views/BrowseReactionsPage.xaml", UriKind.Relative));
            navigationService.Configure("Reaction", new Uri("../Views/ReactionPage.xaml", UriKind.Relative));

            navigationService.Configure("AddNewMolecule", new Uri("../Views/AddNewMoleculePage.xaml", UriKind.Relative));
            navigationService.Configure("ManualInventoryUpdate", new Uri("../Views/ManualInventoryUpdatePage.xaml", UriKind.Relative));
            navigationService.Configure("ExportExcel", new Uri("../Views/ExportExcelPage.xaml", UriKind.Relative));

            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
        }
Esempio n. 15
0
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
            SimpleIoc.Default.Register <LoginViewModel>();
            SimpleIoc.Default.Register <MainPageViewModel>();
            SimpleIoc.Default.Register <ClubsViewModel>();
            SimpleIoc.Default.Register <AddMembreViewModel>();
            SimpleIoc.Default.Register <MembresModelView>();
            SimpleIoc.Default.Register <TournamentViewModel>();
            SimpleIoc.Default.Register <AddTournamentViewModel>();
            SimpleIoc.Default.Register <AddClubViewModel>();
            SimpleIoc.Default.Register <MatchsViewModel>();
            SimpleIoc.Default.Register <AddMatchViewModel>();
            SimpleIoc.Default.Register <RegisterViewModel>();



            FrameNavigationService navigationPages = new FrameNavigationService();


            navigationPages.Configure("Home", typeof(View.Clubs.Clubs), 2);
            navigationPages.Configure("Clubs", typeof(View.Clubs.Clubs), 2);
            navigationPages.Configure("AddClub", typeof(View.Clubs.AddClub), 3);
            navigationPages.Configure("Membres", typeof(View.Membres.Membres), 2);
            navigationPages.Configure("AddMembre", typeof(View.Membres.AddMembre), 3);
            navigationPages.Configure("Tournaments", typeof(View.Tournaments.Tournaments), 2);
            navigationPages.Configure("AddMatch", typeof(View.Tournaments.AddMatch), 3);
            navigationPages.Configure("AddTournament", typeof(View.Tournaments.AddTournament), 3);
            navigationPages.Configure("SelectTournament", typeof(View.Tournaments.Matchs), 3);
            navigationPages.Configure("Login", typeof(View.Login), 0);
            navigationPages.Configure("Register", typeof(View.Register), 1);
            SimpleIoc.Default.Register <INavigationService>(() => navigationPages);
        }
Esempio n. 16
0
        private static void SetupNavigation()
        {
            var navigationService = new FrameNavigationService();

            navigationService.Configure(nameof(Accueil), new Uri("../Views/Accueil.xaml", UriKind.Relative));
            navigationService.Configure(nameof(Menu), new Uri("../Views/Menu.xaml", UriKind.Relative));
            navigationService.Configure(nameof(QuestionJeu), new Uri("../Views/QuestionJeu.xaml", UriKind.Relative));
            navigationService.Configure(nameof(MieuxVousConnaitre), new Uri("../Views/MieuxVousConnaitre.xaml", UriKind.Relative));
            navigationService.Configure(nameof(QuestionOrientationView), new Uri("../Views/QuestionOrientationView.xaml", UriKind.Relative));
            navigationService.Configure(nameof(ResultatOrientation), new Uri("../Views/ResultatOrientation.xaml", UriKind.Relative));
            navigationService.Configure(nameof(Login), new Uri("../Views/Login.xaml", UriKind.Relative));
            navigationService.Configure(nameof(MenuAdmin), new Uri("../Views/MenuAdmin.xaml", UriKind.Relative));
            navigationService.Configure(nameof(OrientationAdmin), new Uri("../Views/OrientationAdmin.xaml", UriKind.Relative));
            navigationService.Configure(nameof(ModiferOrientation), new Uri("../Views/ModiferOrientation.xaml", UriKind.Relative));
            navigationService.Configure(nameof(JeuAdmin), new Uri("../Views/JeuAdmin.xaml", UriKind.Relative));
            navigationService.Configure(nameof(ModifierJeu), new Uri("../Views/ModifierJeu.xaml", UriKind.Relative));
            navigationService.Configure(nameof(MieuxVousConnaitreAdmin), new Uri("../Views/MieuxVousConnaitreAdmin.xaml", UriKind.Relative));
            navigationService.Configure(nameof(ModifierMieuxVousConnaitre), new Uri("../Views/ModifierMieuxVousConnaitre.xaml", UriKind.Relative));
            navigationService.Configure(nameof(ResultatJeu), new Uri("../Views/ResultatJeu.xaml", UriKind.Relative));
            navigationService.Configure(nameof(Classement), new Uri("../Views/Classement.xaml", UriKind.Relative));


            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
        }
        static ViewModelLocator()
        {
            IContainer container;

            // base init
            var builder = new ContainerBuilder();

            // register module
            builder.RegisterModule <DomainModule>();

            // register views
            builder.RegisterType <ShellView>().SingleInstance();
            builder.RegisterType <MainView>();
            builder.RegisterType <GroupWindow>();
            builder.RegisterType <GroupEditView>();
            builder.RegisterType <GroupAddListView>();
            builder.RegisterType <PreferenceWindow>();

            // register library window
            builder.RegisterType <LibraryWindow>();
            builder.RegisterType <LibraryWindowViewModel>();
            builder.RegisterType <LibraryView>();
            builder.RegisterType <LibraryViewModel>();
            builder.RegisterType <LibraryAddStickerView>();
            builder.RegisterType <LibraryAddStickerViewModel>();
            builder.RegisterType <LibraryAddStickerListView>();
            builder.RegisterType <LibraryAddStickerListViewModel>();
            builder.RegisterType <LibraryBackupView>();
            builder.RegisterType <LibraryBackupViewModel>();

            // register view models
            builder.RegisterType <ShellViewModel>();
            builder.RegisterType <MainViewModel>();
            builder.RegisterType <GroupEditViewModel>();
            builder.RegisterType <PreferenceViewModel>();

            // dialog
            builder.RegisterType <DialogService>().As <IDialog>();
            builder.RegisterType <AlertDialogView>();
            builder.RegisterType <QuestionDialogView>();
            builder.RegisterType <LoadingContentVIew>();
            builder.RegisterType <ContentDialogView>();
            builder.RegisterType <PreviewContentView>();

            // register navigation
            var rootNavigationService = new FrameNavigationService("RootFrame");

            rootNavigationService.Configure("main", new Uri("..\\Views\\Pages\\MainView.xaml", UriKind.Relative));
            builder.Register(c => rootNavigationService).Named <IFrameNavigationService>("Root");

            // group navigation service
            var groupNavigationService = new FrameNavigationService("GroupFrame");

            groupNavigationService.Configure("groupEdit", new Uri("..\\Views\\Pages\\Group\\GroupEditView.xaml", UriKind.Relative));
            groupNavigationService.Configure("groupList", new Uri("..\\Views\\Pages\\Group\\GroupAddListView.xaml", UriKind.Relative));
            builder.Register(c => groupNavigationService).Named <IFrameNavigationService>("Group");

            // library navigation service
            var libraryNavigationService = new FrameNavigationService("LibraryFrame");

            libraryNavigationService.Configure("library", new Uri("..\\Views\\Pages\\Library\\LibraryView.xaml", UriKind.Relative));
            libraryNavigationService.Configure("add", new Uri("..\\Views\\Pages\\Library\\LibraryAddStickerView.xaml", UriKind.Relative));
            libraryNavigationService.Configure("addList", new Uri("..\\Views\\Pages\\Library\\LibraryAddStickerListView.xaml", UriKind.Relative));
            libraryNavigationService.Configure("backup", new Uri("..\\Views\\Pages\\Library\\LibraryBackupView.xaml", UriKind.Relative));
            builder.Register(c => libraryNavigationService).Named <IFrameNavigationService>("Library");

            // register ioc
            container = builder.Build();
            ServiceLocator.SetLocatorProvider(() => new AutofacServiceLocator(container));
        }
Esempio n. 18
0
        private static void SetupNavigation()
        {
            var navigationService = new FrameNavigationService();

            navigationService.Configure("AdminPanel", new Uri("../View/AdminPanelView.xaml", UriKind.Relative));
            navigationService.Configure("CreateGroup", new Uri("../View/CreateGroupView.xaml", UriKind.Relative));
            navigationService.Configure("CreateProject", new Uri("../View/CreateProjectView.xaml", UriKind.Relative));
            navigationService.Configure("CreateTask", new Uri("../View/CreateTaskView.xaml", UriKind.Relative));
            navigationService.Configure("CreateUser", new Uri("../View/CreateUserView.xaml", UriKind.Relative));
            navigationService.Configure("FindUser", new Uri("../View/FindUserView.xaml", UriKind.Relative));
            navigationService.Configure("Login", new Uri("../View/LoginView.xaml", UriKind.Relative));
            navigationService.Configure("Mailbox", new Uri("../View/MailboxView.xaml", UriKind.Relative));
            navigationService.Configure("Messages", new Uri("../View/MessagesView.xaml", UriKind.Relative));
            navigationService.Configure("ProjectManagerPanel", new Uri("../View/ProjectManagerPanelView.xaml", UriKind.Relative));
            navigationService.Configure("SelectProjects", new Uri("../View/SelectProjectsView.xaml", UriKind.Relative));
            navigationService.Configure("SendMessage", new Uri("../View/SendMessageView.xaml", UriKind.Relative));
            navigationService.Configure("UserInfo", new Uri("../View/UserInfoView.xaml", UriKind.Relative));
            navigationService.Configure("WorkerPanel", new Uri("../View/WorkerPanelView.xaml", UriKind.Relative));
            navigationService.Configure("UserTasks", new Uri("../View/UserTasksView.xaml", UriKind.Relative));
            navigationService.Configure("AvailableTasksView", new Uri("../View/AvailableTasksView.xaml", UriKind.Relative));
            navigationService.Configure("CreateWorkItem", new Uri("../View/CreateWorkItemView.xaml", UriKind.Relative));
            navigationService.Configure("Message", new Uri("../View/MessageView.xaml", UriKind.Relative));
            navigationService.Configure("Statistics", new Uri("../View/StatisticsView.xaml", UriKind.Relative));
            //SimpleIoc.Default.Register<IFrameNavigationService>();

            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
            ServiceLocator.Current.GetInstance <IFrameNavigationService>();
        }
        private static FrameNavigationService RegisterRoutes()
        {
            var navigationService = new FrameNavigationService();

            // Register your routes here

            #region Festival Routes

            navigationService.Configure("FestivalInfo",
                                        new Uri("../Views/Festival/FestivalPage.xaml", UriKind.Relative));
            navigationService.Configure("CreateFestival",
                                        new Uri("../Views/Festival/CreateFestivalPage.xaml", UriKind.Relative));
            navigationService.Configure("UpdateFestival",
                                        new Uri("../Views/Festival/UpdateFestivalPage.xaml", UriKind.Relative));
            navigationService.Configure("FestivalList",
                                        new Uri("../Views/Festival/FestivalListPage.xaml", UriKind.Relative));

            #endregion

            #region inspection route

            navigationService.Configure("Inspection",
                                        new Uri("../Views/Inspection/InspectionPage.xaml", UriKind.Relative));

            #endregion

            #region Questionnaire Routes

            navigationService.Configure("Questionnaire",
                                        new Uri("../Views/Questionnaire/QuestionnairePage.xaml", UriKind.Relative));

            #endregion

            #region Customer Routes

            navigationService.Configure("CustomerList",
                                        new Uri("../Views/Customer/CustomerListPage.xaml", UriKind.Relative));
            navigationService.Configure("CreateCustomer",
                                        new Uri("../Views/Customer/CreateCustomerPage.xaml", UriKind.Relative));
            navigationService.Configure("UpdateCustomer",
                                        new Uri("../Views/Customer/UpdateCustomerPage.xaml", UriKind.Relative));
            navigationService.Configure("CustomerInfo",
                                        new Uri("../Views/Customer/CustomerPage.xaml", UriKind.Relative));

            #endregion

            #region Employee Routes

            navigationService.Configure("EmployeeInfo",
                                        new Uri("../Views/Employee/EmployeePage.xaml", UriKind.Relative));
            navigationService.Configure("CreateEmployee",
                                        new Uri("../Views/Employee/CreateEmployeePage.xaml", UriKind.Relative));
            navigationService.Configure("UpdateEmployee",
                                        new Uri("../Views/Employee/UpdateEmployeePage.xaml", UriKind.Relative));
            navigationService.Configure("EmployeeList",
                                        new Uri("../Views/Employee/EmployeeListPage.xaml", UriKind.Relative));

            navigationService.Configure("UpdateAccount",
                                        new Uri("../Views/Employee/UpdateAccountPage.xaml", UriKind.Relative));

            navigationService.Configure("CertificateList",
                                        new Uri("../Views/Employee/CertificateListPage.xaml", UriKind.Relative));
            navigationService.Configure("UpdateCertificate",
                                        new Uri("../Views/Employee/UpdateCertificatePage.xaml", UriKind.Relative));
            navigationService.Configure("CreateCertificate",
                                        new Uri("../Views/Employee/CreateCertificatePage.xaml", UriKind.Relative));

            #endregion


            #region Login Routes

            navigationService.Configure("LoginPageEmployee",
                                        new Uri("../Views/Login/LoginPageEmployee.xaml", UriKind.Relative));

            #endregion

            #region Home Routes

            navigationService.Configure("HomePage", new Uri("../Views/Home/HomePage.xaml", UriKind.Relative));

            #endregion


            navigationService.Configure("GenerateReport",
                                        new Uri("../Views/RapportPreviewPage.xaml", UriKind.Relative));
            navigationService.Configure("MapPage", new Uri("../Views/Map/MapPage.xaml", UriKind.Relative));


            return(navigationService);
        }
        /// <summary>
        /// Initializes a new instance of the ViewModelLocator class.
        /// </summary>
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            SimpleIoc.Default.Register <IDispatcherService>(() => new DispatcherService(Application.Current.Dispatcher));
            SimpleIoc.Default.Register <IWinBiometricService, WinBiometricService>();
            SimpleIoc.Default.Register <IBiometricIdentityRepositoryViewModel, BiometricIdentityRepositoryViewModel>();
            SimpleIoc.Default.Register <IHandleRepositoryViewModel <ISessionHandleViewModel>, SessionHandleRepositoryViewModel>();
            SimpleIoc.Default.Register <IHandleRepositoryViewModel <IFrameworkHandleViewModel>, FrameworkHandleRepositoryViewModel>();

            var navigationService = new FrameNavigationService();
            var winBio            = typeof(IWinBioViewModel);

            foreach (var type in Assembly.GetExecutingAssembly()
                     .GetTypes()
                     .Where(type => type != winBio && !type.IsAbstract && !type.IsInterface && type.GetInterfaces().Contains(winBio))
                     .Where(type => type.IsSubclassOf(typeof(ViewModelBase)))
                     .OrderBy(type => type.FullName)
                     .Select(Activator.CreateInstance)
                     .Where(type => type is ViewModelBase)
                     .Cast <IWinBioViewModel>())
            {
                navigationService.Configure(type.Name, new Uri($"pack://application:,,,/Views/{type.Name}.xaml", UriKind.Absolute));
            }

            SimpleIoc.Default.Register <IFrameNavigationService>(() => navigationService);
            SimpleIoc.Default.Register <IMainViewModel, MainViewModel>();

            SimpleIoc.Default.Register <IWinBioAcquireFocusViewModel>(() => new WinBioAcquireFocusViewModel(), true);
            SimpleIoc.Default.Register <IWinBioAsyncEnumBiometricUnitsViewModel>(() => new WinBioAsyncEnumBiometricUnitsViewModel(), true);
            SimpleIoc.Default.Register <IWinBioAsyncEnumDatabasesViewModel>(() => new WinBioAsyncEnumDatabasesViewModel(), true);
            SimpleIoc.Default.Register <IWinBioAsyncEnumServiceProvidersViewModel>(() => new WinBioAsyncEnumServiceProvidersViewModel(), true);
            SimpleIoc.Default.Register <IWinBioAsyncMonitorFrameworkChangesViewModel>(() => new WinBioAsyncMonitorFrameworkChangesViewModel(), true);
            SimpleIoc.Default.Register <IWinBioAsyncOpenFrameworkViewModel>(() => new WinBioAsyncOpenFrameworkViewModel(), true);
            SimpleIoc.Default.Register <IWinBioAsyncOpenSessionViewModel>(() => new WinBioAsyncOpenSessionViewModel(), true);
            SimpleIoc.Default.Register <IWinBioCancelViewModel>(() => new WinBioCancelViewModel(), true);
            SimpleIoc.Default.Register <IWinBioCaptureSampleViewModel>(() => new WinBioCaptureSampleViewModel(), true);
            SimpleIoc.Default.Register <IWinBioCaptureSampleWithCallbackViewModel>(() => new WinBioCaptureSampleWithCallbackViewModel(), true);
            SimpleIoc.Default.Register <IWinBioCloseFrameworkViewModel>(() => new WinBioCloseFrameworkViewModel(), true);
            SimpleIoc.Default.Register <IWinBioCloseSessionViewModel>(() => new WinBioCloseSessionViewModel(), true);
            SimpleIoc.Default.Register <IWinBioControlUnitViewModel>(() => new WinBioControlUnitViewModel(), true);
            SimpleIoc.Default.Register <IWinBioControlUnitPrivilegedViewModel>(() => new WinBioControlUnitPrivilegedViewModel(), true);
            SimpleIoc.Default.Register <IWinBioDeleteTemplateViewModel>(() => new WinBioDeleteTemplateViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnrollBeginViewModel>(() => new WinBioEnrollBeginViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnrollCaptureViewModel>(() => new WinBioEnrollCaptureViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnrollCaptureWithCallbackViewModel>(() => new WinBioEnrollCaptureWithCallbackViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnrollCommitViewModel>(() => new WinBioEnrollCommitViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnrollDiscardViewModel>(() => new WinBioEnrollDiscardViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnrollSelectViewModel>(() => new WinBioEnrollSelectViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnumBiometricUnitsViewModel>(() => new WinBioEnumBiometricUnitsViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnumDatabasesViewModel>(() => new WinBioEnumDatabasesViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnumEnrollmentsViewModel>(() => new WinBioEnumEnrollmentsViewModel(), true);
            SimpleIoc.Default.Register <IWinBioEnumServiceProvidersViewModel>(() => new WinBioEnumServiceProvidersViewModel(), true);
            SimpleIoc.Default.Register <IWinBioGetCredentialStateViewModel>(() => new WinBioGetCredentialStateViewModel(), true);
            SimpleIoc.Default.Register <IWinBioGetDomainLogonSettingViewModel>(() => new WinBioGetDomainLogonSettingViewModel(), true);
            SimpleIoc.Default.Register <IWinBioGetEnabledSettingViewModel>(() => new WinBioGetEnabledSettingViewModel(), true);
            SimpleIoc.Default.Register <IWinBioGetEnrolledFactorsViewModel>(() => new WinBioGetEnrolledFactorsViewModel(), true);
            SimpleIoc.Default.Register <IWinBioGetLogonSettingViewModel>(() => new WinBioGetLogonSettingViewModel(), true);
            SimpleIoc.Default.Register <IWinBioGetPropertyViewModel>(() => new WinBioGetPropertyViewModel(), true);
            SimpleIoc.Default.Register <IWinBioIdentifyViewModel>(() => new WinBioIdentifyViewModel(), true);
            SimpleIoc.Default.Register <IWinBioIdentifyWithCallbackViewModel>(() => new WinBioIdentifyWithCallbackViewModel(), true);
            SimpleIoc.Default.Register <IWinBioLocateSensorViewModel>(() => new WinBioLocateSensorViewModel(), true);
            SimpleIoc.Default.Register <IWinBioLocateSensorWithCallbackViewModel>(() => new WinBioLocateSensorWithCallbackViewModel(), true);
            SimpleIoc.Default.Register <IWinBioLockUnitViewModel>(() => new WinBioLockUnitViewModel(), true);
            SimpleIoc.Default.Register <IWinBioLogonIdentifiedUserViewModel>(() => new WinBioLogonIdentifiedUserViewModel(), true);
            SimpleIoc.Default.Register <IWinBioMonitorPresenceViewModel>(() => new WinBioMonitorPresenceViewModel(), true);
            SimpleIoc.Default.Register <IWinBioOpenSessionViewModel>(() => new WinBioOpenSessionViewModel(), true);
            SimpleIoc.Default.Register <IWinBioReleaseFocusViewModel>(() => new WinBioReleaseFocusViewModel(), true);
            SimpleIoc.Default.Register <IWinBioRemoveAllCredentialsViewModel>(() => new WinBioRemoveAllCredentialsViewModel(), true);
            SimpleIoc.Default.Register <IWinBioRemoveAllDomainCredentialsViewModel>(() => new WinBioRemoveAllDomainCredentialsViewModel(), true);
            SimpleIoc.Default.Register <IWinBioRemoveCredentialViewModel>(() => new WinBioRemoveCredentialViewModel(), true);
            SimpleIoc.Default.Register <IWinBioSetCredentialViewModel>(() => new WinBioSetCredentialViewModel(), true);
            SimpleIoc.Default.Register <IWinBioSetPropertyViewModel>(() => new WinBioSetPropertyViewModel(), true);
            SimpleIoc.Default.Register <IWinBioUnlockUnitViewModel>(() => new WinBioUnlockUnitViewModel(), true);
            SimpleIoc.Default.Register <IWinBioVerifyViewModel>(() => new WinBioVerifyViewModel(), true);
            SimpleIoc.Default.Register <IWinBioVerifyWithCallbackViewModel>(() => new WinBioVerifyWithCallbackViewModel(), true);
        }