Windows 8用のシンプルなアプリを開発しています。私のアプリでは、アプリに同梱されているローカルホストからの画像を開始タイルに表示したいと思います。たとえば、私は自分の画像を賢明なように/images/tile1.jpgに保存しています。私のxmlコードは
<tile>
<visual>
<binding template="TileWideImage">
<image id="1" src ="http://localhost/images/tile1.jpg" />
</binding>
</visual>
これは/tile1.xmlにも同様に存在します
私のdefault.jsコードは
// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkId=232509
(function () {
"use strict";
WinJS.Binding.optimizeBindingReferences = true;
var app = WinJS.Application;
var activation = Windows.ApplicationModel.Activation;
app.onactivated = function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
var notifications = Windows.UI.Notifications;
var recurrence = notifications.PeriodicUpdateRecurrence.halfHour;
var urls = [
new Windows.Foundation.Uri("http://localhost/tile1.xml"),
new Windows.Foundation.Uri("http://localhost/tile2.xml"),
new Windows.Foundation.Uri("http://localhost/tile3.xml"),
new Windows.Foundation.Uri("http://localhost/tile4.xml")
];
notifications.TileUpdateManager.createTileUpdaterForApplication().enableNotificationQueue(true);
notifications.TileUpdateManager.createTileUpdaterForApplication().startPeriodicUpdateBatch(urls, recurrence);
} else {
// TODO: This application has been reactivated from suspension.
// Restore application state here.
}
args.setPromise(WinJS.UI.processAll());
}
};
app.oncheckpoint = function (args) {
// TODO: This application is about to be suspended. Save any state
// that needs to persist across suspensions here. You might use the
// WinJS.Application.sessionState object, which is automatically
// saved and restored across suspension. If you need to complete an
// asynchronous operation before your application is suspended, call
// args.setPromise().
};
app.start();
})();
コードの何が問題なのか理解できません。助けてください。