Skip to main content

INavigationAware.NavigatingFrom(NavigatingEventArgs) Method

Called automatically when an application attempts to navigate from a View that implements the INavigationAware interface.

Namespace: DevExpress.Xpf.WindowsUI.Navigation

Assembly: DevExpress.Xpf.Controls.v22.2.dll

NuGet Package: DevExpress.Wpf.Controls


void NavigatingFrom(
    NavigatingEventArgs e


Name Type Description
e DevExpress.Xpf.WindowsUI.Navigation.NavigatingEventArgs

A NavigatingEventArgs object that contains event data.


INavigationAware is the interface that provides navigation methods for WindowsUI applications. To use these methods implement the INavigationAware interface for your application screens (Views) as illustrated in the following code:

public partial class MainView : UserControl, DevExpress.Xpf.WindowsUI.Navigation.INavigationAware {
     public MainView() {
         . . .

After that, implement the INavigationAware methods for your View. To do so, right-click the INavigationAware in Visual Studio and select the ‘Implement Interface’ item from the pop-up menu.

DXWindowsUI - INavitaionAware implementation

Along with the NavigatingFrom method, the INavigationAware.NavigatedTo and INavigationAware.NavigatedFrom method will also be implemented. The INavigationAware.NavigatedFrom method is called if the NavigatingFrom method’s Cancel parameter does not equal true.

If you do not wish to implement the INavigationAware interface manually, use the NavigationPage object for your application screens instead of standard UserControl objects. See the Navigation topic to learn more.

See Also