BadgeUpdater クラス

定義

アップデーターがバインドされている特定のタイルにバッジ オーバーレイを更新します。

public ref class BadgeUpdater sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class BadgeUpdater final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class BadgeUpdater final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class BadgeUpdater
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class BadgeUpdater
Public NotInheritable Class BadgeUpdater
継承
Object Platform::Object IInspectable BadgeUpdater
属性

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

次の例は、 Update を使用して、呼び出し元アプリのタイルに数値バッジの更新を送信する方法を示しています。

function sendBadgeNotification() {
    var Notifications = Windows.UI.Notifications;
    var badgeXml;
    var badgeAttributes;

    // Get an XML DOM version of a specific template by using getTemplateContent.
    badgeXml = Notifications.BadgeUpdateManager.getTemplateContent(Notifications.BadgeTemplateType.badgeNumber);
    badgeAttributes = badgeXml.getElementsByTagName("badge");
    badgeAttributes[0].setAttribute("value", "7");

    // Create a badge notification from the XML content.
    var badgeNotification = new Notifications.BadgeNotification(badgeXml);

    // Send the badge notification to the app's tile.
    Notifications.BadgeUpdateManager.createBadgeUpdaterForApplication().update(badgeNotification);
}

注釈

このオブジェクトのインスタンスを取得するには、 BadgeUpdateManager.CreateBadgeUpdaterForApplication メソッドまたは BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile メソッドを呼び出します。

作成されると、BadgeUpdater は特定のアプリまたはセカンダリ タイルにバインドされるため、このクラスのメソッドは、オブジェクト インスタンスがバインドされている 1 つのタイルにのみ影響します。

メソッド

Clear()

アップデーターがバインドされているタイルからバッジを削除します。

StartPeriodicUpdate(Uri, DateTime, PeriodicUpdateRecurrence)

アップデーターがバインドされている Web リソースからバッジの一連の時間指定更新を開始します。 更新指定した時刻に開始します。 定期的な更新では、Web リソース (http/https) のみが許可されることに注意してください。

StartPeriodicUpdate(Uri, PeriodicUpdateRecurrence)

アップデーターがバインドされている Web リソースからバッジの一連の時間指定更新をすぐに開始します。 定期的な更新では、Web リソース (http/https) のみが許可されることに注意してください。

StopPeriodicUpdate()

アップデーターがバインドされているバッジの現在の一連の時間更新を取り消します。

Update(BadgeNotification)

バッジのグリフまたは数値に変更を適用します。

適用対象

こちらもご覧ください