Back to Devexpress

DXDialogWindow.CommandsSource Property

wpf-devexpress-dot-xpf-dot-core-dot-dxdialogwindow.md

latest2.7 KB
Original Source

DXDialogWindow.CommandsSource Property

Gets or sets a list of UICommand objects that are used to generate dialog buttons. This is a dependency property.

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public IEnumerable<UICommand> CommandsSource { get; set; }
vb
Public Property CommandsSource As IEnumerable(Of UICommand)

Property Value

TypeDescription
IEnumerable<UICommand>

A list of UICommand objects that are used to generate dialog buttons.

|

Remarks

The DXDialogWindow allows you to set custom dialog buttons. Follow the next steps to add a set of custom buttons to the DXDialogWindow :

The code example below demonstrates how to add custom dialog buttons to your window:

csharp
using DevExpress.Mvvm;
.....
  public class MyDialogViewModel : IDialogViewModel {
    public MyDialogViewModel() {
      CommandsSource = new List<UICommand> {
        new UICommand {
            Id = System.Windows.MessageBoxResult.Cancel,
            Caption = "Cancel",
            IsCancel = true,
            Tag = System.Windows.MessageBoxResult.Cancel
        },
        new UICommand {
            Caption = "Print",
            IsDefault = true,
            Command = new DelegateCommand(Print),
            Tag = System.Windows.MessageBoxResult.OK
        }
      };
    }

See the UICommand topic to learn more.

See Also

DXDialogWindow Class

DXDialogWindow Members

DevExpress.Xpf.Core Namespace