AppNotificationButton クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
アプリ通知に表示されるボタンを表します。
public ref class AppNotificationButton sealed
/// [Windows.Foundation.Metadata.Activatable(Microsoft.Windows.AppNotifications.Builder.IAppNotificationButtonFactory, 65536, "Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract")]
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AppNotificationButton final
[Windows.Foundation.Metadata.Activatable(typeof(Microsoft.Windows.AppNotifications.Builder.IAppNotificationButtonFactory), 65536, "Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract")]
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AppNotificationButton
function AppNotificationButton(content)
Public NotInheritable Class AppNotificationButton
- 継承
- 属性
例
次の例では、アプリ通知の XML ペイロードにボタンを追加する方法を示します。
var notification = new AppNotificationBuilder()
.AddText("Send a message.")
.AddTextBox("textBox")
.AddButton(new AppNotificationButton("Send")
.AddArgument("action", "sendMessage"))
.BuildNotification();
AppNotificationManager.Default.Show(notification);
結果の XML ペイロード:
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Send a message.</text>
</binding>
</visual>
<actions>
<input id='textBox' type='text'/><action content='Send' arguments='action=sendMessage'/>
</actions>
</toast>
注釈
AppNotificationBuilder.AddButton を呼び出して、アプリ通知の XML ペイロードにボタンを追加します。 1 つのアプリ通知に最大 5 つのボタンを追加できます。
AppNotificationBuilder API を使用してアプリ通知用の UI を作成する方法については、「アプリ通知コンテンツ」を参照してください。
アプリ通知の XML スキーマのリファレンス情報については、「アプリ 通知コンテンツ スキーマ」を参照してください。
コンストラクター
AppNotificationButton() |
AppNotificationButton クラスの新しいインスタンスを初期化します。 |
AppNotificationButton(String) |
指定したボタン テキストを使用して 、AppNotificationButton クラスの新しいインスタンスを初期化します。 |
プロパティ
Arguments |
AppNotificationButton に関連付けられている引数を取得または設定します。 |
ButtonStyle |
ボタンのスタイルを取得または設定します。 |
Content |
AppNotificationButton のボタン テキストを取得または設定します。 |
ContextMenuPlacement |
ボタンをアプリ通知コンテキスト メニュー内に表示するかどうかを指定する値を取得または設定します。 |
Icon |
AppNotificationButton のアイコンを取得または設定します。 |
InputId |
AppNotificationButton の入力 ID を取得または設定します。 |
InvokeUri |
アプリ通知ボタンがクリックされたときに起動される URI を取得または設定します。 |
TargetAppId |
アプリ通知ボタンがクリックされたときに起動するアプリのパッケージ ファミリ名 (PFN) を取得または設定します。 |
ToolTip |
アプリ通知ボタンのツール ヒント テキストを取得または設定します。 |
メソッド
AddArgument(String, String) |
キーと値のペアで構成される引数を、アプリ通知ボタンの XML ペイロードに追加します。 |
IsButtonStyleSupported() |
現在のデバイスのアプリ通知ボタンでボタン スタイルがサポートされているかどうかを示す値を返します。 |
IsToolTipSupported() |
現在のデバイスのアプリ通知ボタンでツール ヒントがサポートされているかどうかを示す値を返します。 |
SetButtonStyle(AppNotificationButtonStyle) |
アプリ通知ボタンのボタン スタイルを設定します。 |
SetContextMenuPlacement() |
通知のコンテキスト メニューにアプリ通知ボタンを配置することを要求します。 |
SetIcon(Uri) |
AppNotificationButton のアイコンを設定します。 |
SetInputId(String) |
AppNotificationButton の入力 ID を設定します。 |
SetInvokeUri(Uri) |
アプリ通知ボタンがクリックされたときに起動される URI を設定します。 |
SetInvokeUri(Uri, String) |
アプリ通知ボタンがクリックされたときに起動する URI を設定します。あいまいさを解消するために指定されたパッケージ ファミリ名 (PFN) を使用します。 |
SetToolTip(String) |
アプリ通知ボタンのツール ヒント テキストを設定します。 |
適用対象
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示