This project is read-only.

about:error reroute?

Dec 6, 2010 at 12:41 PM

Hi,

is it possible to reroute "about:error" to a new NavigationContentHandler?

thanks,

helmut

Dec 8, 2010 at 8:25 AM

NavigationContainer has ErrorUrl property, that will be displayed when Navigate() failed.

Or do you want to do something different?

Dec 8, 2010 at 9:17 AM

Well, not out of hand - but if you change the association in the source then you can, as it's just a normal Map/DefineNavigationContainer type of declaration.

Rishi

Dec 8, 2010 at 2:29 PM

@sonicflare:

thanks for tip, but i want to overwrite the default error route... so that every navigation container uses the same localized error page out of the box...

@rishi

i'm careful with source code modifications, because then i have to apply them on every release and it could get complicated for me :)....

after digging through the source code i finally found a workaround (for anyone who's interested):

        void ReMapRoute(string uri, IRouteHandler handler)
        {
            Contract.Requires(!string.IsNullOrEmpty(uri));
            Contract.Requires(handler != null);

            var routeData = RouteTable.Routes.GetRouteData(new UrlRequest(uri));
            if (routeData != null)
            {
                RouteTable.Routes.Remove(routeData.Route);
            }

            RoutingService.MapRoute(uri, handler);
        }

            ReMapRoute("about:error", new NavigationContentHandler(p => new AboutError()));
            ReMapRoute("about:blank", new NavigationContentHandler(p => new AboutBlank()));

Thanks,
Helmut 

 

Dec 9, 2010 at 7:41 PM

Helmut, very cool - nice little trick.
Rishi