Example #1
0
        private NavigationServiceEx InitializeNavigationService()
        {
            NavigationServiceEx navService = new NavigationServiceEx();

            navService.Configure(nameof(MainPage), typeof(MainPage));
            navService.Configure(nameof(SettingsPage), typeof(SettingsPage));
            return(navService);
        }
Example #2
0
        private void ConfigureNavigationService(NavigationServiceEx navigationService)
        {
            navigationService.Configure(NavigationSource.MainView.ToString(), typeof(MainView));

            navigationService.Configure(NavigationSource.PhotoView.ToString(), typeof(PhotoView));

            navigationService.Configure(NavigationSource.DocumentView.ToString(), typeof(DocumentView));

            navigationService.Configure(NavigationSource.CurrentCategoryView.ToString(), typeof(CurrentCategoryView));

            navigationService.Configure(NavigationSource.PostProccesView.ToString(), typeof(PostProccesView));
        }
Example #3
0
        static ViewModelLocator()
        {
            NavigationServiceEx _navigationService = new NavigationServiceEx();

            void Register <VM, V>(IServiceCollection services) where VM : class
            {
                //services.AddTransient<VM>();
                _navigationService.Configure(typeof(VM).FullName, typeof(V));
            }

            ServiceCollection services = new ServiceCollection();

            services.AddSingleton <IDialogService, DialogService>();
            services.AddSingleton(s => _navigationService);
            services.AddSingleton(s => ResourceHelper.AppSettings);
            services.AddSingleton(s => new NativeInterop(Utils.CanvasDevice));
            services.AddSingleton <UserCollectionsService>();
            services.AddSingleton <MainViewModel>();
            Register <MainViewModel, MainPage>(services);
            Ioc.Default.ConfigureServices(services.BuildServiceProvider());
        }
        public void Register <VM, V>() where VM : class
        {
            SimpleIoc.Default.Register <VM>();

            _navigationService.Configure(typeof(VM).FullName, typeof(V));
        }
Example #5
0
 public void Register <TVm, TV>() where TVm : class
 {
     SimpleIoc.Default.Register <TVm>();
     _navigationService.Configure(typeof(TVm).FullName, typeof(TV));
 }