TileUpdater Class

Ändert den Inhalt der einzelnen Kachel, an die der Updater gebunden ist.

Syntax


var tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
var tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication(applicationId);
var tileUpdater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(tileId);

Attribute

[Muse()]
[Version(0x06020000)]

Member

TileUpdaterKlasse hat diese Membertypen:

Methoden

The TileUpdater Klasse hat diese Methoden. Mit C#, Visual Basic und C++ erbt es auch Methoden aus Object Klasse.

MethodeBeschreibung
AddToSchedule Adds a ScheduledTileNotification to the schedule.
Clear Removes all updates and causes the tile to display its default content as declared in the app's manifest.
EnableNotificationQueue Enables the tile to queue up to five notifications. This enables the notification queue on all tile sizes.
EnableNotificationQueueForSquare150x150 Enables the tile to queue up to five notifications on the medium tile.
EnableNotificationQueueForSquare310x310 Enables the tile to queue up to five notifications on the large tile.
EnableNotificationQueueForWide310x150 Enables the tile to queue up to five notifications on the wide tile.
GetScheduledTileNotifications Retrieves a list of scheduled updates to the tile.
RemoveFromSchedule Removes an upcoming tile update from the schedule.
StartPeriodicUpdate(Uri, DateTime, PeriodicUpdateRecurrence) Begins a series of timed updates for the tile that the updater is bound to. Update content is retrieved from a specified Uniform Resource Identifier (URI). Updates begin at a specified time.
StartPeriodicUpdate(Uri, PeriodicUpdateRecurrence) Begins a series of timed content changes for the tile that the updater is bound to, beginning immediately.
StartPeriodicUpdateBatch(IIterable(Uri), DateTime, PeriodicUpdateRecurrence) Begins a series of timed updates that cycle on the tile that the updater is bound to. Update content is retrieved from an array of specified Uniform Resource Identifier (URI) with updates beginning at a specified time and subsequent updates occurring at the periodic interval thereafter.
StartPeriodicUpdateBatch(IIterable(Uri), PeriodicUpdateRecurrence) Begins a series of timed updates that cycle on the tile that the updater is bound to. Update content is retrieved from an array of specified Uniform Resource Identifier (URI), the first update happening immediately and subsequent updates occurring at the periodic interval thereafter.
StopPeriodicUpdate Cancels the current series of timed updates for the tile that the updater is bound to.
Update Applies a change in content or appearance to the tile.

 

Eigenschaften

Der TileUpdaterKlasse hat diese Eigenschaften.

EigenschaftZugriffstypBeschreibung

Setting

SchreibgeschütztGets a value that specifies whether a tile can be updated through notifications.

 

Hinweise

Um eine Instanz dieses Objekts abzurufen, verwenden Sie die Methoden TileUpdateManager.CreateTileUpdaterForApplication oder TileUpdateManager.CreateTileUpdaterForSecondaryTile.

Wenn TileUpdater erstellt wird, wird er an eine bestimmte App oder sekundäre Kachel gebunden. Die Methoden dieser Klasse beeinflussen also nur die einzelne Kachel, an welche die Objektinstanz gebunden ist.

Beispiele

Im folgenden Beispiel wird Update gezeigt, das verwendet wird, um eine Benachrichtigung zur Kachel der App zu senden.



function sendTileTextNotification() {
    var Notifications = Windows.UI.Notifications;

    // Get an XML DOM version of a specific template by using getTemplateContent.
    var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWide310x150Text03);

    // You will need to look at the template documentation to know how many text fields a particular template has.
    // Get the text attribute for this template and fill it in.
    var tileAttributes = tileXml.getElementsByTagName("text");
    tileAttributes[0].appendChild(tileXml.createTextNode("Hello World!"));

    // Create the notification from the XML.
    var tileNotification = new Notifications.TileNotification(tileXml);

    // Send the notification to the calling app's tile.
    Notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification);
}

Die folgende Codezeile verwendet EnableNotificationQueue zum Aktivieren der Benachrichtigungswarteschlange für die Kachel der aufrufenden Anwendung.



Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication().enableNotificationQueue(true);

Das folgende Beispiel veranschaulicht die Verwendung der RemoveFromSchedule-Methode.



var notifier = Notifications.TileUpdateManager.createTileUpdaterForApplication();
var scheduled = notifier.getScheduledTileNotifications();

for (var i = 0, len = scheduled.length; i < len; i++) {
    
    // The itemId value is the unique ScheduledTileNotification.Id assigned to the 
    // notification when it was created.
    if (scheduled[i].id === itemId) {
        notifier.removeFromSchedule(scheduled[i]);
    }
}

Anforderungen

Mindestens unterstützter Client

Windows 8 [Nur Windows Store-Apps]

Mindestens unterstützter Server

Windows Server 2012 [Nur Windows Store-Apps]

Namespace

Windows.UI.Notifications
Windows::UI::Notifications [C++]

Metadaten

Windows.winmd

 

 

Anzeigen:
© 2015 Microsoft