Skip to main content

FrameNavigationService Class

The service that provides methods to navigate between Views within a NavigationFrame.

Namespace: DevExpress.Xpf.WindowsUI.Navigation

Assembly: DevExpress.Xpf.Controls.v24.1.dll

NuGet Package: DevExpress.Wpf.Controls

Declaration

[TargetType(typeof(NavigationFrame))]
public class FrameNavigationService :
    NavigationServiceBase

Remarks

When initializing the FrameNavigationService object, you need to set the FrameNavigationService.Frame property to the NavigationFrame object that contains Views you wish to navigate between. Otherwise, the methods provided by the FrameNavigationService will not work.

Example

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.

View Example

<UserControl x:Class="DXSample.View.MainView" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:dxwui="http://schemas.devexpress.com/winfx/2008/xaml/windowsui"
    xmlns:dxwuin="http://schemas.devexpress.com/winfx/2008/xaml/windowsui/navigation"
    xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" 
    xmlns:ViewModel="clr-namespace:DXSample.ViewModel" 
    mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" 
    DataContext="{dxmvvm:ViewModelSource Type={x:Type ViewModel:MainViewModel}}">
    <Grid>
        <dxwui:NavigationFrame AnimationType="SlideHorizontal" NavigationCacheMode="Required">
            <dxmvvm:Interaction.Behaviors>
                <dxmvvm:EventToCommand EventName="Loaded" Command="{Binding OnViewLoadedCommand}" />
                <dxwuin:FrameNavigationService />
            </dxmvvm:Interaction.Behaviors>
        </dxwui:NavigationFrame>
    </Grid>
</UserControl>

Inheritance

Show 15 items
Object
DispatcherObject
DependencyObject
Freezable
Animatable
DevExpress.Mvvm.UI.Interactivity.AttachableObjectBase
DevExpress.Mvvm.UI.Interactivity.Behavior
DevExpress.Mvvm.UI.Interactivity.Behavior<FrameworkElement>
DevExpress.Mvvm.UI.ServiceBaseGeneric<FrameworkElement>
ServiceBase
ViewServiceBase
DevExpress.Mvvm.UI.DocumentUIServiceBase
See Also