private static void AddParameterToCache(Type viewModelType, BaseViewModelParameter parameter) { if (parameter != null) { MemoryCache[viewModelType.Name] = parameter; } }
public void MyShowViewModel <T>(RequestType specialRequest, BaseViewModelParameter parameter = null) where T : MvxViewModel { AddParameterToCache(typeof(T), parameter); ShowViewModel <T>(presentationBundle: CreateBundleForRequestType(specialRequest)); }
public void ShowViewModel <T>(BaseViewModelParameter parameter = null) where T : MvxViewModel { AddParameterToCache(typeof(T), parameter); base.ShowViewModel <T>(); }
/// <summary> /// Shows the view modal modally and creates a new navigations tack for the modal view /// </summary> /// <param name="viewModelType"></param> public void ShowModalViewModel(Type viewModelType, BaseViewModelParameter parameter = null) { AddParameterToCache(viewModelType, parameter); ShowViewModel(viewModelType, presentationBundle: CreateBundleForRequestType(RequestType.Modal)); }
/// <summary> /// Tries to show the view model in the current navigation stack /// </summary> /// <typeparam name="T"></typeparam> public void ShowModalViewModel <T>(BaseViewModelParameter parameter = null) where T : MvxViewModel { ShowModalViewModel(typeof(T), parameter); }
/// <summary> /// Shows the view model after cleaning the master detail navigation stack back to the root (home) /// </summary> /// <typeparam name="T"></typeparam> public void ShowAsCleanViewModel <T>(BaseViewModelParameter parameter = null) where T : MvxViewModel { ShowViewModel <T>(RequestType.Clean, parameter); }
/// <summary> /// Shows the view model as the root of the master detail page /// </summary> /// <typeparam name="T"></typeparam> public void ShowAsRootViewModel <T>(BaseViewModelParameter parameter = null) where T : MvxViewModel { ShowViewModel <T>(RequestType.Root, parameter); }