# DialogButtonViewModel.CreateOk method (1 of 2)

Creates the default OK button, captioned in the current UI language and activated by Enter.

```csharp
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

* class [DialogButtonViewModel](../DialogButtonViewModel.md)
* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](../index.md)

---

# 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".

```csharp
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

* class [DialogButtonViewModel](../DialogButtonViewModel.md)
* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](../index.md)

<!-- DO NOT EDIT: generated by xmldocmd for Eremex.Avalonia.Controls.ApplicationServices.dll -->
