AppTaskContent.AddButton(String, Uri) メソッド

定義

ユーザーがクリックしてアクションを実行できるボタンをタスク コンテンツに追加します。

public:
 virtual void AddButton(Platform::String ^ text, Uri ^ actionUri) = AddButton;
/// [Windows.Foundation.Metadata.Experimental]
void AddButton(winrt::hstring const& text, Uri const& actionUri);
[Windows.Foundation.Metadata.Experimental]
public void AddButton(string text, System.Uri actionUri);
function addButton(text, actionUri)
Public Sub AddButton (text As String, actionUri As Uri)

パラメーター

text
String

Platform::String

winrt::hstring

ボタンに表示するテキスト。

actionUri
Uri Uri

ユーザーがボタンをクリックしたときに起動される URI。

属性

注釈

Important

アプリ タスクのサポートは、2026 年 5 月から Windows 11 への段階的なロールアウトを開始します。 Windows.UI.Shell.Tasks API によって有効になるエクスペリエンスでは、対応するアプリ タスク機能が、アプリが実行されている Windows のバージョンに存在する必要があります。 それ以外の場合、これらの API は影響を受けなくなります。

タスクがユーザーの注意を必要とし、簡単なアクションの選択肢を提供する場合は、ボタンを使用します。 追加できるボタンの最大数は 、MaxButtons によって定義されます。 通常、タスクの状態がNeedsAttentionされるときに SetQuestion と組み合わせて使用されます。

適用対象