Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

NavigationFrame.GoForward() Method

In This Article

Navigates forward to the previously selected screen (view).

Namespace: DevExpress.Xpf.WindowsUI

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

NuGet Package: DevExpress.Wpf.Controls

#Declaration

public void GoForward()

#Remarks

The GoForward method will undo navigation performed via the Back button or the NavigationFrame.GoBack method. This method will have an effect only if the NavigationFrame has navigated back from the current view at least once. You can use the NavigationFrame.CanGoForward property to get whether the GoForward method is available. See the Navigation topic for more info.

You can also navigate back to the previously viewed screen via the NavigationFrame.GoBack method. Its current availability can also be checked via the NavigationFrame.CanGoBack property.

The following example demonstrates how to use the GoForward and NavigationFrame.GoBack methods, called by 2 corresponding NavigationButtons. The custom checkBackForwardState methods checks whether navigation buttons are available each time the NavigationFrame.Navigated event occurs.

public MainWindow() {
    InitializeComponent();
    checkButtonsState();
    . . .
}

private void cmdForward_Click(object sender, RoutedEventArgs e) {
    frame1.GoForward();
}

private void cmdBack_Click(object sender, RoutedEventArgs e) {
    frame1.GoBack();
}

private void checkButtonsState() {
    cmdForward.IsEnabled = frame1.CanGoForward;
    cmdBack.IsEnabled = frame1.CanGoBack;
}

private void frame1_Navigated(object sender, DevExpress.Xpf.WindowsUI.Navigation.NavigationEventArgs e) {
    checkButtonsState();
}

The animation below illustrates the result.

See Also