Exemplo n.º 1
0
        public void Build()
        {
            InsertPageBeforeDelegate insertPageBeforeDelegate = ctx => { };
            PushDelegate pushDelegate = ctx => Task.CompletedTask;
            PopDelegate popDelegate = ctx => Task.CompletedTask;
            PushModalDelegate pushModalDelegate = ctx => Task.CompletedTask;
            PopModalDelegate popModalDelegate = ctx => Task.CompletedTask;
            PopToRootDelegate popToRootDelegate = ctx => Task.CompletedTask;
            RemovePageDelegate removePageDelegate = ctx => { };

            foreach (var @delegate in _insertBeforePageDelegates.Reverse())
                insertPageBeforeDelegate = (ctx) => @delegate(insertPageBeforeDelegate, ctx);
            foreach (var @delegate in _pushDelegates.Reverse())
                pushDelegate = (ctx) => @delegate(pushDelegate, ctx);
            foreach (var @delegate in _popDelegates.Reverse())
                popDelegate = (ctx) => @delegate(popDelegate, ctx);
            foreach (var @delegate in _pushModalDelegates.Reverse())
                pushModalDelegate = (ctx) => @delegate(pushModalDelegate, ctx);
            foreach (var @delegate in _popModalDelegates.Reverse())
                popModalDelegate = (ctx) => @delegate(popModalDelegate, ctx);
            foreach (var @delegate in _popToRootDelegates.Reverse())
                popToRootDelegate = (ctx) => @delegate(popToRootDelegate, ctx);
            foreach (var @delegate in _removePageDelegates.Reverse())
                removePageDelegate = (ctx) => @delegate(removePageDelegate, ctx);

            _xamarinNavigationProxy.Initialize(_xamarinNavigationDelegate());
            _xamarinNavigationProxy.InsertPageBeforeDelegate = insertPageBeforeDelegate;
            _xamarinNavigationProxy.PushDelegate = pushDelegate;
            _xamarinNavigationProxy.PopDelegate = popDelegate;
            _xamarinNavigationProxy.PushModalDelegate = pushModalDelegate;
            _xamarinNavigationProxy.PopModalDelegate = popModalDelegate;
            _xamarinNavigationProxy.PopToRootDelegate = popToRootDelegate;
            _xamarinNavigationProxy.RemovePageDelegate = removePageDelegate;
        }
Exemplo n.º 2
0
 public Task OnPopAsync(NavigationContext ctx, PopDelegate pop)
 {
     return(pop(ctx));
 }