public RouteStack(ObservableCollection <Route> menuRoutes, IRouteFactory routeFactory, IRouteErrorListener routeErrorListener, IContext synchronizationContext) { if (routeFactory == null || routeErrorListener == null || synchronizationContext == null) { throw new ArgumentNullException(); } this.MenuRoutes = menuRoutes ?? new ObservableCollection <Route>(); this.RouteFactory = routeFactory; this.RouteErrorListener = routeErrorListener; this.SynchronizationContext = synchronizationContext; this.stack = new Stack <RouteItem>(); }
public static void TryOnRouteEventException(this IRouteErrorListener listener, Route route, RouteEventType eventType, Exception exception) { if (listener == null) { return; } try { listener.OnRouteEventException(route, eventType, exception); } catch { // ignored } }