Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]MVVM Framework
  [Expand]ViewModels
  [Expand]Commands
  [Expand]Behaviors
  [Collapse]Services
    Getting Started
    Services in ViewModelBase descendants
    Services in POCO objects
    Services in custom ViewModels
    View creation mechanisms
   [Collapse]Predefined Set
    [Expand]Dialog Services
    [Expand]Message Box Services
    [Expand]Document Services
    [Expand]ViewInjectionService
    [Expand]Report Services
     NotificationService
     TaskbarButtonService
     ApplicationJumpListService
     DXSplashScreenService
     DispatcherService
     FrameNavigationService
     LayoutSerializationService
     FolderBrowserDialogService
     OpenFileDialogService
     SaveFileDialogService
     WizardService
     NotifyIconService
    How to create a Custom Service
  [Expand]DXBinding
  [Expand]MIF
   Converters
   ViewLocator
   Messenger
   Data Annotation Attributes
   LayoutTreeHelper
   Weak Event
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

FrameNavigationService

The FrameNavigationService is an INavigationService implementation that allows you to navigate between Views within a NavigationFrame.

Note

The service also implements the IDocumentManagerService interface. It allows you to interact with a FrameNavigationService instance as with a document manager service. See Document Services to learn more.

Assume that you need to implement a slide navigation between Views in your MVVM application. To accomplish this task, you can use the FrameNavigationService. Add the FrameNavigationService to NavigationFrame's Interaction.Behaviors.

Access the FrameNavigationService in our View Model defined as a POCO object and navigate to the required View by using the INavigationService.Navigate method. If the View Model is inherited from the ViewModelBase, use the approach from Services in ViewModelBase descendants.

In the code snippet above, you can see how to navigate to the HomeView.

In addition to the Navigate method, the INavigationService interface also provides the following navigation methods.

  • GoBack - performs a navigation to the previous view, if permitted.
  • GoForward - performs a navigation to the next view, if permitted.

Expanded Views caching support

The NavigationFrame associated with the FrameNavigationService allows you to cache the shown Views. Depending on the NavigationFrame.NavigationCacheMode property value, a NavigationFrame can cache Views to which it navigates in multiple modes: cache always, cache until the cache size exceeds the defined value, or do not cache at all. The NavigationPages provide the attached NavigationPage.NavigationCacheMode property that overrides the NavigationCacheMode method for specific elements.

Expanded Processing navigation in ViewModel

To support the navigation processing at ViewModels' level, you can implement the ISupportNavigation interface in your ViewModels. The ISupportNavigation members that occur when navigating to an object and when navigating away from it.

Expanded Splash Screen Showing

If you are navigating between content-heavy Views with complex structure, you can show a splash screen by using the FrameNavigationService.ShowSplashScreen while the NavigationFrame content is loading.

Expanded Example

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4697.

The FrameNavigationService provides methods to navigate between Views within a NavigationFrame. This example shows how to use this service.

In this example, the MainWindow contains a NavigationFrame, which shows a HomeView at startup. The HomeView contains a Tile, which invokes a command to navigate to a DetailView when clicked. The DetailView contains the Back button for backward navigation.

Is this topic helpful?​​​​​​​