private NavBarLayoutType?GetNavBarLayoutType(PageContent page) { Type pageType = page.GetType(); if (!_navBarPagesLayouts.ContainsKey(pageType)) { return(null); } return(_navBarPagesLayouts[pageType]); }
private void SetPage(PageContent page, PageViewModel dataContext = null, bool skipWhenGoBack = false) { if (!OverlayIsOpen() && ReferenceEquals(PageContent.Content, page) && (dataContext == null || ReferenceEquals((PageContent.Content as PageContent)?.DataContext, dataContext))) { return; } UpdateLayout(); GC.WaitForPendingFinalizers(); GC.Collect(); IsContentEventsActive(false); SaveContentToHistory(); if (dataContext != null) { if (dataContext.PageType != page.GetType()) { var exception = new ArgumentException($"The {nameof(dataContext)} page type must match the {nameof(page)} type", nameof(dataContext)); Events.OnError(this, new RErrorEventArgs(exception, exception.Message)); throw exception; } page.DataContext = dataContext; } PageContent.Content = page; _currentPageContentType = PageContentType.Page; _currentPageSkipWhenGoBack = skipWhenGoBack; SwitchNavBarLayout(page).Wait(); HideOverlay(); ClearOverlay(); IsContentEventsActive(true); }