Inheritance: INavigationService, INavigationService2
Exemplo n.º 1
0
        static ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            // TODO - setup your models, views and viewmodels

            // setup app services
            SimpleIoc.Default.Register<INavigationService2>(() =>
            {
                var nav = new SKELETON.Service.NavigationService();
                nav.Configure("Home", typeof(HomePage));
                nav.Configure("Settings", typeof(SettingsPage));

                return nav;
            });
            SimpleIoc.Default.Register<IDialogService, DialogService>();

            // setup models
            SimpleIoc.Default.Register<IAbout, About>();
            SimpleIoc.Default.Register<ISettings>(() => new Settings(ApplicationData.Current.LocalSettings));


            // setup view models
            SimpleIoc.Default.Register<MainViewModel>();
            SimpleIoc.Default.Register<AboutViewModel>();
            SimpleIoc.Default.Register<SettingsViewModel>();
        }
Exemplo n.º 2
0
        static ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            // TODO - setup your models, views and viewmodels

            // setup app services
            SimpleIoc.Default.Register <INavigationService2>(() =>
            {
                var nav = new SKELETON.Service.NavigationService();
                nav.Configure("Home", typeof(HomePage));
                nav.Configure("Settings", typeof(SettingsPage));

                return(nav);
            });
            SimpleIoc.Default.Register <IDialogService, DialogService>();

            // setup models
            SimpleIoc.Default.Register <IAbout, About>();
            SimpleIoc.Default.Register <ISettings>(() => new Settings(ApplicationData.Current.LocalSettings));


            // setup view models
            SimpleIoc.Default.Register <MainViewModel>();
            SimpleIoc.Default.Register <AboutViewModel>();
            SimpleIoc.Default.Register <SettingsViewModel>();
        }