/// <summary> /// Pushes a navigation page onto the modal stack. /// </summary> /// <param name="modal">A page view model.</param> /// <param name="contract">A page contract.</param> /// <returns>An observable that signals the completion of this action.</returns> public IObservable <Unit> PushModal(INavigationPageViewModel modal, string contract = null) { if (modal == null) { throw new NullReferenceException("The modal you tried to insert is null."); } if (modal.PageStack.Value.Count <= 0) { throw new InvalidOperationException("Can't push an empty navigation page."); } return(_viewShell .PushModal(modal.PageStack.Value[0], contract, true) .Do( _ => { AddToStackAndTick(_modalPageStack, modal, false); })); }
public IObservable <Unit> PushModal(INavigationPageViewModel modal, string contract = null) { if (modal == null) { throw new NullReferenceException("The modal you tried to insert is null."); } if (modal.PageStack.Value.Count <= 0) { throw new InvalidOperationException("Can't push an empty navigation page."); } return (View .PushModal(modal.PageStack.Value[0], contract, true) .Do( _ => { AddToStackAndTick(_ModalPageStack, modal, false); this.Log().Debug("Added modal '{0}' (contract '{1}') to stack.", modal.Title, contract); })); }