I am trying to allocate an empty listview file, and then add events to it using xxxx.push functions.
It works well in an example I have, but copy/move it, it is not working.
The problem is that it is executing 'document.addEventListener("DOMContentLoaded", initialize'
but it will not return to the code (as when it is working in the first case).
Therefor the list is not initialized.
(function () {
"use strict";
function initialize() {
var astop1 = 0;
WinJS.UI.processAll().done(function () {
var astop2 = 0;
// Get reference to ListView control
var lvProducts = document.getElementById("lvProducts").winControl;
// Create a List of products
var listProducts = new WinJS.Binding.List([
{ name: "Empty", text: "my text" }
]);
// Bind the list of products to the ListView
lvProducts.itemDataSource = listProducts.dataSource;
});
}
document.addEventListener("DOMContentLoaded", initialize);
})();