/// <summary> /// Pushes the modal cached page as current navigation stack. /// </summary> /// <returns>The page from cache async.</returns> /// <param name="currentPageModel">Current page model.</param> /// <param name="executeOnPageModel">Execute on page model.</param> /// <param name="cacheKey">Cache key.</param> /// <param name="animated">If set to <c>true</c> animated.</param> /// <typeparam name="TPageModel">The 1st type parameter.</typeparam> public static Task <bool> PushModalPageFromCacheAsync <TPageModel>(this IBasePageModel currentPageModel, Action <TPageModel> executeOnPageModel = null, string cacheKey = null, bool animated = true) where TPageModel : class, IBasePageModel { var currentPage = XamvvmCore.CurrentFactory.GetPageByModel(currentPageModel); if (currentPage != null) { var pageToPush = XamvvmCore.CurrentFactory.GetPageFromCache <TPageModel>(cacheKey: cacheKey); if (executeOnPageModel != null) { pageToPush.ExecuteOnPageModel(executeOnPageModel); } return(XamvvmCore.CurrentFactory.PushModalPageAsync(currentPage, pageToPush, animated)); } return(Task.FromResult(false)); }
/// <summary> /// Clears the page cache. /// </summary> /// <param name="currentPageModel">Current page model.</param> public static void ClearPageCache(this IBasePageModel currentPageModel) { XamvvmCore.CurrentFactory.ClearPageCache(); }
/// <summary> /// Sets the new root and resets based on PageModel /// </summary> /// <param name="currentPageModel">Current page model.</param> public static Task <bool> SetNewRootAndResetAsync <TNewRootPageModel>(this IBasePageModel currentPageModel, bool clearCache = true) where TNewRootPageModel : class, IBasePageModel { return(XamvvmCore.CurrentFactory.SetNewRootAndResetAsync <TNewRootPageModel>(clearCache)); }
/// <summary> /// Removes the page type from cache. /// </summary> /// <returns><c>true</c>, if page type from cache was removed, <c>false</c> otherwise.</returns> /// <param name="currentPageModel">Current page model.</param> /// <param name="cacheKey">Cache key.</param> /// <typeparam name="TPageModel">The 1st type parameter.</typeparam> public static bool RemovePageTypeFromCache <TPageModel>(this IBasePageModel currentPageModel, string cacheKey = null) where TPageModel : class, IBasePageModel { return(XamvvmCore.CurrentFactory.RemovePageTypeFromCache <TPageModel>(cacheKey)); }
/// <summary> /// Gets the page as new instance. /// </summary> /// <returns>The page as new instance.</returns> /// <param name="currentPageModel">Current page model.</param> /// <param name="pageModelType">Page model type.</param> public static IBasePage <IBasePageModel> GetPageAsNewInstance(this IBasePageModel currentPageModel, Type pageModelType) { return(XamvvmCore.CurrentFactory.GetPageAsNewInstance(pageModelType)); }
/// <summary> /// Gets the page as new instance. /// Optionally provide a page model (else will be set automatically) /// </summary> /// <returns>The page as new instance.</returns> /// <param name="pageModel">Page model.</param> /// <param name="currentPageModel">Current page model.</param> /// <typeparam name="TPageModel">The 1st type parameter.</typeparam> public static IBasePage <TPageModel> GetPageAsNewInstance <TPageModel>(this IBasePageModel currentPageModel, TPageModel pageModel = null) where TPageModel : class, IBasePageModel { return(XamvvmCore.CurrentFactory.GetPageAsNewInstance(pageModel)); }
/// <summary> /// Gets the page from cache. Creates a new page instances if not exists. /// </summary> /// <returns>The page from cache.</returns> /// <param name="currentPageModel">Current page model.</param> /// <param name="pageModelType">Page model type.</param> /// <param name="cacheKey">Cache key.</param> public static IBasePage <IBasePageModel> GetPageFromCache(this IBasePageModel currentPageModel, Type pageModelType, string cacheKey = null) { return(XamvvmCore.CurrentFactory.GetPageFromCache(pageModelType, cacheKey)); }
/// <summary> /// Gets the page from cache. Creates a new page instances if not exists. /// Optionally provide a page model (else will be set automatically) /// </summary> /// <returns>The page from cache.</returns> /// <param name="pageModel">Page model.</param> /// <param name="currentPageModel">Current page model.</param> /// <param name="cacheKey">Cache key.</param> /// <typeparam name="TPageModel">The 1st type parameter.</typeparam> public static IBasePage <TPageModel> GetPageFromCache <TPageModel>(this IBasePageModel currentPageModel, TPageModel pageModel = null, string cacheKey = null) where TPageModel : class, IBasePageModel { return(XamvvmCore.CurrentFactory.GetPageFromCache(pageModel, cacheKey)); }