The requested page is not available for the requested platform. You are viewing the content for Default platform.

ISupportNavigationEvents Interface

Provides methods that are called during navigation to a DXPage.

Namespace: DevExpress.Core

Assembly: DevExpress.Core.v19.1.dll

Declaration

public interface ISupportNavigationEvents
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