BadgeNotificationManager クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
アプリのタスク バー アイコンに表示されるバッジ通知を管理するメソッドを提供します。
public ref class BadgeNotificationManager sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.BadgeNotifications.BadgeNotificationsContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BadgeNotificationManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.BadgeNotifications.BadgeNotificationsContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class BadgeNotificationManager
Public NotInheritable Class BadgeNotificationManager
- 継承
- 属性
例
この例では、 SetBadgeAsGlyph を呼び出して、 Alert グリフで通知バッジを設定する方法を示します。
BadgeNotificationManager.Current.SetBadgeAsGlyph(BadgeNotificationGlyph.Alert);
この例では、 SetBadgeAsCount を呼び出して、数値が 20 の通知バッジを設定する方法を示します。
BadgeNotificationManager.Current.SetBadgeAsCount(20);
この例では、タスク バー アイコンのバッジをアプリの InfoBadge コントロールと同期する方法を示します。
コードの NavigationView での数値 InfoBadge のインクリメントの例を参照してください。 このコードは、そのサンプルの MainWindow コンストラクターに追加されます。
DependencyObject.RegisterPropertyChangedCallback メソッドを使用して、InfoBadge.Value プロパティへの変更をリッスンします。
public MainWindow()
{
this.InitializeComponent();
mailCountBadge.RegisterPropertyChangedCallback(InfoBadge.ValueProperty, (s, e) =>
{
if (e == InfoBadge.ValueProperty)
{
BadgeNotificationManager.Current.SetBadgeAsCount((uint)mailCountBadge.Value);
}
});
}
注釈
通知バッジは、アプリに固有の概要または状態情報を伝えます。 システム提供のグリフまたは数値 (1 から 99) のセットのいずれかです。 数値バッジが 99 より大きい値に設定されている場合は、"99+" と表示されます。
通知バッジがアプリのタスク バー アイコンに表示されます。 アプリがタスク バーにピン留めされている場合、アプリが実行されていない場合でもバッジが表示されます。
プロパティ
| 名前 | 説明 |
|---|---|
| Current |
現在のアプリの |
メソッド
| 名前 | 説明 |
|---|---|
| ClearBadge() |
アプリのタスク バー アイコンからバッジを削除します。 |
| SetBadgeAsCount(UInt32) |
指定した整数値をアプリのタスク バー アイコンのバッジとして適用します。 |
| SetBadgeAsGlyph(BadgeNotificationGlyph) |
指定したグリフ値をアプリのタスク バー アイコンのバッジとして適用します。 |