Share via


ContentDialog.PrimaryButtonText Property

Definition

Gets or sets the text to display on the primary button.

public:
 property Platform::String ^ PrimaryButtonText { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring PrimaryButtonText();

void PrimaryButtonText(winrt::hstring value);
public string PrimaryButtonText { get; set; }
var string = contentDialog.primaryButtonText;
contentDialog.primaryButtonText = string;
Public Property PrimaryButtonText As String
<ContentDialog PrimaryButtonText="string"/>

Property Value

String

Platform::String

winrt::hstring

The text to display on the primary button. To hide this button, set the text to null or an empty string. The default is an empty string.

Remarks

ContentDialog has a built-in primary button that you can use by setting this property to a non-empty string. The primary button is hidden when this property is set to an empty string or null.

Invoking the primary button closes the dialog with a return value of ContentDialogResult.Primary. It also raises the PrimaryButtonClick event, which you can optionally handle, and invokes any PrimaryButtonCommand that is set.

Applies to

See also