Questions tagged [navigationservice]

NavigationService Class is a .NET Framework class which contains methods, properties, and events to support navigation. Namespace is System.Windows.Navigation.

From MSDN's documentation on NavigationService:

NavigationService encapsulates the ability to download content within the context of a browser-style navigation.

Content can be any type of .NET Framework object and HTML files. In general, however, pages are the preferred as the way to package content for navigation Content can be navigated to by providing an instance of an object and calling an overload of the Navigate method that accepts an object:

NavigationService.Navigate(Object)
NavigationService.Navigate(Object, Object)

Alternatively, content can be navigated to by passing a relative or absolute uniform resource identifier (URI) to one of the Navigate method overloads that accepts a URI:

NavigationService.Navigate(Uri)
NavigationService.Navigate(Uri, Object)
NavigationService.Navigate(Uri, Object, Boolean)

When content is navigated to by URI, NavigationService will return an object that contains the content.

The lifetime of a navigation can be tracked through the following events:

Navigating
Navigated
NavigationProgress
NavigationFailed
NavigationStopped
LoadCompleted
FragmentNavigation
128 questions
10
votes
1 answer

NavigationService remove forwardstack

I see a lot of answers, about removing the backstack. But How do I remove the forward stack? Aka, Navigating A, to B, to C A -> B -> C I then navigate back from C, to B (Form saved, C closed NavigationService.GoBack();) B <- C I should now, NOT be…
IAmGroot
  • 13,760
  • 18
  • 84
  • 154
9
votes
2 answers

Clearing backstack in NavigationService

I am navigating through different pages within my application. After I login, I come to home page from where the navigation starts. During navigation, when I come to homepage, I want to go to the login page by pressing BackKey but I can only…
master.fake
  • 487
  • 1
  • 6
  • 22
8
votes
2 answers

How to clear whole navigation history hosted by the WPF Frame control

In a WPF application the Frame control is used to host/navigate pages. I'd like to clear the navigation history. There is NavigationService.RemoveBackEntry() method which can be used to clear the backward portion of the history. But what about the…
Alex Martianov
  • 81
  • 1
  • 1
  • 3
5
votes
4 answers

How to navigate to another project inside same solution

Hey Hope somebody can help. I have in group developed on many different projects and we now want to combine these. I therefore include the projects. In the startup project I include the reference to the other projects. And then I use the code from…
JTIM
  • 2,774
  • 1
  • 34
  • 74
4
votes
1 answer

How to keep page with full state in navigation wpf app

I'm building a WPF app using pages and the navigation service. One of the pages take an object as a constructor Sub New(ByVal o As Object) ' This call is required by the Windows Form Designer. InitializeComponent() .... So, to navigate…
Eduardo Molteni
  • 38,786
  • 23
  • 141
  • 206
4
votes
0 answers

WPF - NavigationService memory troubles

I needed to write an application for kiosk terminal and I choose WPF for this, because I need single window application. Implementation is simple - NavigationWindow and set of Pages, that uses in NavigationService.Navigate() method. During using the…
Demos
  • 41
  • 2
4
votes
1 answer

UriKind in windows phone navigation between pages

I am a windows phone developer. I use NavigationService class for navigating to different pages. In this we use a UriKind property. What is this property actually means ?.. I googled it but not get a clear answer about it. In msdn they provide as …
Arun
  • 3,478
  • 8
  • 33
  • 46
3
votes
2 answers

What determines whether NavigationCommands.BrowseBack calls the page constructor?

I have two pages with similar logic in them. Load the page, click some buttons that will show/hide other buttons, continue to next page. When I hit the next page, if I click the back button I am returned to the previous page. The difference is that…
Brandon
  • 68,708
  • 30
  • 194
  • 223
3
votes
1 answer

NavigationService.BackStack.FirstOrDefault() does not contains definition in Windows Phone 8?

I am trying to get the last page in the navigation using the following in WP8 var lastPage = NavigationService.BackStack.FirstOrDefault(); However Visual Studio 12 complaints that it does not contain a definition for FirstOrDefault
PutraKg
  • 2,226
  • 3
  • 31
  • 60
2
votes
1 answer

Windows Phone App crashes when using NavigationService.GoBack() too soon

Even though NavigationService.CanGoBack returns True, NavigationService.GoBack() throws me these exceptions : A first chance exception of type 'System.ArgumentException' occurred in System.Windows.dll A first chance exception of type…
2
votes
2 answers

Xamarin Prism Unable to navigate to LoginPageViewModel

I am trying to make my Xamarin Project use MVVM with Prism and DryIoc. I mostly want to use AutoRegistration like below: [AutoRegisterForNavigation] ... protected override void RegisterTypes(IContainerRegistry containerRegistry) { //Pages …
2
votes
1 answer

Navigate to another wpf without opening new windows

I am new to WPF , i can't find a way to open a new WPF window on the same main WPF app i tried Frame method , here is the code :-
Ahmed
  • 45
  • 1
  • 9
2
votes
2 answers

UWP NavigationView switch to another page via MVVM

Switching for the first time ever from WPF to UWP I found out that there are great controls like SplitView and NavgiationView do exist in the world of UWP. For renewing my current home-project I have choosen the NavigationView control as my main UI…
mbed_dev
  • 1,450
  • 16
  • 33
2
votes
0 answers

Immediately redirect to another page in WPF

I have a page that several other pages navigate to. However in some circumstances the user should not see this page, so I want to send them to another page instead. Rather than update the rest of the calling code, I just want to change this page to…
Brandon
  • 68,708
  • 30
  • 194
  • 223
2
votes
1 answer

NavigationService.Navigate error

I'm quite new on C# programming and I have a problem on my code. I have created a button and applied on it an event click which open an other page of my project by the technology NavigationService. This is the script: private void click_login(object…
Kraenys
  • 297
  • 1
  • 5
  • 19
1
2 3
8 9