ContentDialog.CloseButtonText プロパティ

定義

閉じるボタンに表示するテキストを取得または設定します。

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

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

プロパティ値

String

Platform::String

winrt::hstring

閉じるボタンに表示するテキスト。 このボタンを非表示にするには、テキストを または空の文字列に null 設定します。 既定値は空の文字列です。

注釈

すべてのダイアログには、ユーザーが安心してダイアログを終了できる、安全で非破壊的なアクション ボタンが含まれる必要があります。

ContentDialog には、このプロパティを空でない文字列に設定することで使用できる閉じるボタンが組み込まれています。 このプロパティが空の文字列または nullに設定されている場合、閉じるボタンは非表示になります。

組み込みの閉じるボタンを使用すると、マウス、キーボード、タッチ、ゲーム コントローラーなど、すべての入力に適したユーザー エクスペリエンスを作成できます。 ダイアログは、次の場合に閉じます。

  • ユーザーが閉じるボタンをクリックまたはタップします。
  • ユーザーがシステムの戻るボタンを押します。
  • ユーザーがキーボードの ESC ボタンを押します。
  • ユーザーがゲーム コントローラー B を押します。

閉じるボタンを呼び出すと、 が返 ContentDialogResult.Noneされ、必要に応じて処理できる CloseButtonClick イベントが発生し、設定されている CloseButtonCommand が呼び出されます。

適用対象

こちらもご覧ください