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; }
public PriorityQueue(int i = 1, IComparer <T> c = null) { capacity = 1; size = 0; items = new T[capacity]; if (c == null) { if (!typeof(IComparable).IsAssignableFrom(typeof(T))) { throw new System.Exception("Generic type must have a comparator passed in or implement the IComparable interface."); } PushDel = PushWithoutComparator; } else { PushDel = PushWithComparator; } comparator = c; }
public Task OnPushAsync(NavigationContext ctx, PushDelegate push) { return(push(ctx)); }
public async Task PushAsync(Page page) { await PushDelegate?.Invoke(new NavigationContext(page)); await _root.PushAsync(page); }