AppNotificationButton.Icon プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
AppNotificationButton のアイコンを取得または設定します。
public:
property Uri ^ Icon { Uri ^ get(); void set(Uri ^ value); };
Uri Icon();
void Icon(Uri value);
public System.Uri Icon { get; set; }
var uri = appNotificationButton.icon;
appNotificationButton.icon = uri;
Public Property Icon As Uri
プロパティ値
ボタン アイコンの URI。
例
次の例は、このプロパティを使用してアプリ通知ボタンのアイコンを設定する方法を示しています。
var button = new AppNotificationButton("Reply")
.AddArgument("action", "reply");
button.Icon = new Uri("ms-appx:///Images/Reply.png");
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.AddButton(button)
.BuildNotification();
AppNotificationManager.Default.Show(notification);
結果の XML ペイロード:
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Notification text.</text>
</binding>
</visual>
<actions>
<action content='Reply' arguments='action=reply' imageUri='ms-appx:///Images/Reply.png'/>
</actions>
</toast>
注釈
AppNotificationButton.SetIcon を呼び出して、アプリ通知ボタンのアイコンを設定することもできます。
次のスクリーンショットは、アイコンを使用するアプリ通知ボタンを示しています。
サポートされているイメージ ファイルの種類は次のとおりです。
- .png
- .jpg
- 。Svg
AppNotificationBuilder API を使用してアプリ通知用の UI を作成する方法のガイダンスについては、「アプリ通知コンテンツ」を参照してください。
アプリ通知の XML スキーマのリファレンス情報については、「アプリ通知 コンテンツ スキーマ」を参照してください。
適用対象
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示