Skip to content

DialogButtonViewModel.CreateOk method (1 of 2)

Creates the default OK button, captioned in the current UI language and activated by Enter.

public static IDialogButtonViewModel CreateOk(ICommand command, object? commandParameter = null)
parameter description
command The command invoked when the button is pressed.
commandParameter The value passed to command.

Return Value

The button view model.

See Also


DialogButtonViewModel.CreateOk method (2 of 2)

Creates the default button with a caption of your own, styled like OK and activated by Enter. Use it when the confirming action deserves a more specific name, such as "Save" or "Install".

public static IDialogButtonViewModel CreateOk(ICommand command, string content, 
    object? commandParameter = null)
parameter description
command The command invoked when the button is pressed.
content The button caption. It is used as given, not localized.
commandParameter The value passed to command.

Return Value

The button view model.

See Also