public override void Show(MvxViewModelRequest request) { try { var requestText = GetRequestText(request); var viewsContainer = Mvx.Resolve <IMvxViewsContainer>(); var viewType = viewsContainer.GetViewType(request.ViewModelType); _rootFrame.Navigate(viewType, requestText); //Frame won't allow serialization of it's nav-state if it gets a non-simple type as a nav param } catch (Exception exception) { MvxTrace.Trace("Error seen during navigation request to {0} - error {1}", request.ViewModelType.Name, exception.ToLongString()); } }
protected virtual void ShowPage(Type viewType, MvxBasePresentationAttribute attribute, MvxViewModelRequest request) { try { var requestText = GetRequestText(request); var viewsContainer = Mvx.Resolve <IMvxViewsContainer>(); _rootFrame.Navigate(viewType, requestText); //Frame won't allow serialization of it's nav-state if it gets a non-simple type as a nav param HandleBackButtonVisibility(); } catch (Exception exception) { MvxTrace.Trace("Error seen during navigation request to {0} - error {1}", request.ViewModelType.Name, exception.ToLongString()); } }
protected virtual Task <bool> ShowPage(Type viewType, MvxBasePresentationAttribute attribute, MvxViewModelRequest request) { try { var requestText = GetRequestText(request); var viewsContainer = Mvx.IoCProvider.Resolve <IMvxViewsContainer>(); _rootFrame.Navigate(viewType, requestText); //Frame won't allow serialization of it's nav-state if it gets a non-simple type as a nav param HandleBackButtonVisibility(); return(Task.FromResult(true)); } catch (Exception exception) { _logger?.LogTrace(exception, "Error seen during navigation request to {viewModelTypeName}", request.ViewModelType.Name); return(Task.FromResult(false)); } }
protected virtual Task <bool> ShowPage(Type viewType, MvxBasePresentationAttribute attribute, MvxViewModelRequest request) { try { var requestText = GetRequestText(request); var viewsContainer = Mvx.IoCProvider.Resolve <IMvxViewsContainer>(); if (_rootFrame.Content is MainPage currentPage) { currentPage.MainContentFrame.Navigate(viewType, requestText); } else { _rootFrame.Navigate(viewType, requestText); } HandleBackButtonVisibility(); return(Task.FromResult(true)); } catch { return(Task.FromResult(false)); } }
protected override void CustomPlatformInitialization(MasterDetailPage mainPage) { _rootFrame.Navigate(mainPage.GetType(), _rootFrame); }