ScheduledTileNotification.Id プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
スケジュール内のスケジュールされたタイルを識別するために使用される一意の ID を取得または設定します。
public:
property Platform::String ^ Id { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Id();
void Id(winrt::hstring value);
public string Id { get; set; }
var string = scheduledTileNotification.id;
scheduledTileNotification.id = string;
Public Property Id As String
プロパティ値
通知の識別子。 この文字列は 16 文字に制限されています。
例
次の例は、1 時間で表示するようにスケジュールされたタイルを示しています。これには、スケジュールされた通知にラベルを付ける Id プロパティの使用が含まれています。
var Notifications = Windows.UI.Notifications;
var currentTime = new Date();
var seconds = 60;
var dueTime = new Date(currentTime.getTime() + seconds * 60 * 1000);
var idNumber = 123456789;
var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWide310x150Text09);
// Set up the wide tile text.
var tileTextAttributes = tileXml.getElementsByTagName("text");
tileTextAttributes[0].appendChild(tileXml.createTextNode("This is a scheduled notification"));
tileTextAttributes[1].appendChild(tileXml.createTextNode("Received: " + dueTime.toLocaleTimeString()));
// Set up the medium tile text.
var squareTileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileSquare150x150Text04);
var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
squareTileTextAttributes[0].appendChild(squareTileXml.createTextNode("This is a scheduled notification"));
// Include the medium tile in the notification.
var node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true);
tileXml.getElementsByTagName("visual").item(0).appendChild(node);
// Create the notification object.
var futureTile = new Notifications.ScheduledTileNotification(tileXml, dueTime);
futureTile.id = "Tile" + idNumber;
// Add to the schedule.
Notifications.TileUpdateManager.createTileUpdaterForApplication().addToSchedule(futureTile);
注釈
ScheduledTileNotification.tag と ScheduledTileNotification.id は、同様の目的を果たします。
- ScheduledTileNotification.tag プロパティは、重複する通知コンテンツが同時にキューに表示されないようにするために、Windows によって使用されます。 これにより、通知をキュー内のインプレースで更新して、古い情報が含まれるのを防ぐことができます。
- id プロパティは、スケジュール内の通知を識別します。 これにより、通知を識別したり、スケジュールから削除したりできます。