0
我正在開發一個適用於Windows 8的簡單應用程序。在我的應用程序中,我希望啓動磁貼顯示來自本地主機的圖像,該圖像與我的應用程序一起提供。例如 例如我已經將圖像保存在/images/tile1.jpg中,就像明智一樣。 和我的XML代碼來自localhost的Windows 8磁貼通知
<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();
})();
我只是無法弄清楚什麼是錯的與代碼。請幫忙。