因此,我正在嘗試使用WinJS.UI.Pivot控件創建應用程序。文檔非常簡單,我看到的樣本是「傻瓜」。如何將PivotItems動態綁定到HTML頁面
我知道我可以在PivotItem控制下加我的HTML和我也看到結合的子元素的控制的一種方式爭奪的data-win-control
來定義JavaScript文件頁面的ControlConstructor,如下所示:
(function() {
"use strict";
var ControlConstructor = WinJS.UI.Pages.define("/pages/hub/section1Page.html", {
// This function is called after the page control contents
// have been loaded, controls have been activated, and
// the resulting elements have been parented to the DOM.
ready: function (element, options) {
options = options || {};
},
});
// The following lines expose this control constructor as a global.
// This lets you use the control as a declarative control inside the
// data-win-control attribute.
WinJS.Namespace.define("HubApps_SectionControls", {
Section1Control: ControlConstructor
});
})();
有沒有辦法做到這一點動態(以編程方式)?
你是在談論以編程方式將一個PivotItem添加到WinJS.UI.Pivot控件? –
是的,這就是我問的,但我已經解決了我的原始問題...我會很高興地看到它 – sebagomez