Esempio n. 1
0
        public App()
        {
            InitializeComponent();

            var currentAssembly = Assembly.GetExecutingAssembly();

            var navigationHelper = new ShellNavigationHelper();

            navigationHelper.RegisterViewsInAssembly(currentAssembly);

            var containerBuilder = new ContainerBuilder();

            containerBuilder.RegisterInstance <INavigationHelper>(navigationHelper);

            var appAssembly = typeof(App).GetTypeInfo().Assembly;

            containerBuilder.RegisterAssemblyTypes(appAssembly)
            .Where(x => x.IsSubclassOf(typeof(Page)));

            containerBuilder.RegisterAssemblyTypes(appAssembly)
            .Where(x => x.IsSubclassOf(typeof(ViewModelBase)));

            var container = containerBuilder.Build();

            Resolver.SetResolver(new AutofacResolver(container));

            TinyMvvm.Forms.TinyMvvm.Initialize();


            MainPage = new AppShell();
        }
Esempio n. 2
0
        public App()
        {
            InitializeComponent();

            var assembly = Assembly.GetExecutingAssembly();

            var navigation = new ShellNavigationHelper();

            navigation.RegisterViewsInAssembly(assembly);

            var containerBuilder = new ContainerBuilder();

            containerBuilder.RegisterAssemblyTypes(assembly)
            .Where(x => x.IsSubclassOf(typeof(Page)));

            containerBuilder.RegisterAssemblyTypes(assembly)
            .Where(x => x.IsSubclassOf(typeof(ViewModelBase)));

            containerBuilder.RegisterInstance <INavigationHelper>(navigation);

            var container = containerBuilder.Build();

            Resolver.SetResolver(new AutofacResolver(container));



            MainPage = new AppShell();
        }
Esempio n. 3
0
        public App()
        {
            InitializeComponent();

            var navigationHelper = new ShellNavigationHelper();

            navigationHelper.RegisterRoute("about/contact", typeof(ContactView));

            navigationHelper.RegisterViewsInAssembly(Assembly.GetExecutingAssembly());

            TinyMvvm.Forms.TinyMvvm.Initialize();

            MainPage = new MainShell();
        }