public BlazorPageNavigator(NavigationManager blazorNavManager) { _blazorNavManager = blazorNavManager; var uri = new Uri(blazorNavManager.BaseUri); _rootIntent = new NavigationIntent(uri.AbsolutePath); _history.Push(_rootIntent); }
private void Dispatch(NavigationIntent intent) { var uriBuilder = new UriBuilder(_blazorNavManager.ToAbsoluteUri(intent.Path)); var queryString = intent.ToQueryString(); if (!string.IsNullOrEmpty(queryString)) { uriBuilder.Query = queryString; } _blazorNavManager.NavigateTo(uriBuilder.Uri.ToString()); }
public override void Replace(Screen screen, IScreenResolver resolver) { if (!(resolver is IBlazorScreenResolver blazorScreenResolver)) { return; } var intent = blazorScreenResolver.GetNavigationIntent(screen); if (_history.Count > 0) { _history.Pop(); } _history.Push(intent); if (_history.Count == 1) { _rootIntent = intent; } Dispatch(intent); }
public BlazorPageNavigator(NavigationManager blazorNavManager, NavigationIntent rootIntent) { _blazorNavManager = blazorNavManager; _rootIntent = rootIntent; _history.Push(_rootIntent); }