Skip to main content
All docs
V24.1

Commands in Document Viewer for WinUI

  • 2 minutes to read

Important

The DevExpress WinUI product suite has been discontinued and is no longer available to new customers. We continue to monitor market-demands and the viability of WinUI as a desktop development platform. Should demand increase and market conditions change, we will reconsider our decision.

Existing Users: The DevExpress WinUI product line was available as part of a free product offer that expired on June 1, 2024. If you registered for the free offer before June 1, 2024 you can download the DevExpress WinUI product suite by visiting the DevExpress Client Center. The latest available version is v23.2.

The DocumentViewer.Commands collection contains the Document Viewer commands and allows the user to obtain a command and bind the command to a UI element. All commands implement the ICommand interface. To execute a command, call the command’s Execute method.

The following code invokes the Open dialog when the Document Viewer is loaded:

private void DocumentViewer_Loaded(object sender, RoutedEventArgs e) {
    documentViewer.Commands.ShowOpenDialogCommand.Execute(null);
}

A command’s CanExecute method determines whether the command can be executed.

The following help topic describes how to use commands to create a custom Document Viewer toolbar: Customize the Document Viewer Toolbar in the WinUI Application