Skip to main content

ISupportNavigationEvents Interface

Provides methods that are called during navigation to a DXPage.

Namespace: DevExpress.Core

Assembly: DevExpress.Core.v21.2.dll

NuGet Package: DevExpress.Uwp.Controls

Declaration

public interface ISupportNavigationEvents

Remarks

The ISupportNavigationEvents interface provides the ISupportNavigationEvents.OnNavigating and ISupportNavigationEvents.OnNavigated methods that allow you to customize the default navigation logic. To use these methods, implement the ISupportNavigationEvents interface for your ViewModels as follows:

public class ViewModel : DevExpress.Core.ISupportNavigationEvents {
    // ISupportNavigationEvents implementation
    public void OnNavigated(DevExpress.Core.DXNavigationEventArgs e) {

    }

    public void OnNavigating(DevExpress.Core.DXNavigatingCancelEventArgs e) {

    }
}

The OnNavigating method is called before a page with a ViewModel implementing the ISupportNavigationEvents interface is unloaded from the parent frame. To prevent the page from being unloaded, set the e.Cancel property to true.

If the OnNavigating method’s e.Cancel parameter does not equal true, the current page is unloaded and then the ISupportNavigationEvents.OnNavigated method belonging to a ViewModel of the newly loaded page is called.

Note

To ensure ISupportNavigationEvents interface methods are called on the ViewModel, the DXPage has to be used instead of a regular Page.

See Also