Example #1
0
        public async void Start(Assembly assembly)
        {
            Host   = Browser.Window.Location.Host;
            Port   = Browser.Window.Location.Port;
            Scheme = Browser.Window.Location.Protocol;

            Browser.Window.AddEventListener("popstate", evt => OnPopState(evt.As <PopStateEvent>()));

            var path = Browser.Window.Location.PathName;

            Console.WriteLine(path);

            ControllerFactory = new DefaultControllerFactory(DependencyResolver);

            var routeGenerator = new RouteGenerator();

            routeTree = routeGenerator.GenerateRoutes(assembly);

            await OnStarting();
            await OnStarted();
        }
Example #2
0
        public void Start(Assembly assembly)
        {
            Host   = Browser.Window.Location.Host;
            Port   = Browser.Window.Location.Port;
            Scheme = Browser.Window.Location.Protocol;

            Browser.Window.AddEventListener("popstate", evt => OnPopState(evt.As <PopStateEvent>()));

            var path = Browser.Window.Location.PathName;

            Console.WriteLine(path);

            ControllerFactory = new DefaultControllerFactory(DependencyResolver);

            var routeGenerator = new RouteGenerator();

            routeTree = routeGenerator.GenerateRoutes(assembly);

            OnStarting(() =>
            {
                Open(path + (!string.IsNullOrEmpty(Browser.Window.Location.Search) ? "?" + Browser.Window.Location.Search : ""), false, OnStarted);
            });
        }