我尝试为我的WinJS Windows 8 Metro应用程序创建一个新的/自定义设置选项,它似乎不会出现。我尝试按照here提出的建议并没有得到任何结果。这是我用来初始化所有内容的JS,我看到" Manage Cache"在魅力酒吧,但点击它只是关闭它:
WinJS.UI.processAll();
WinJS.Application.onsettings = function (e) {
e.detail.applicationcommands = {
"managecache": { title: "Manage Cache", href: "/html/manageCacheCharm.html" }
};
WinJS.UI.SettingsFlyout.populateSettings(e);
};
WinJS.Application.start();
这是html的主体:
<div data-win-control="WinJS.UI.SettingsFlyout" aria-label="Manage cache flyout" data-win-options="{settingsCommandId:'managecache', width: 'narrow'}">
<!-- Use either 'win-ui-light' or 'win-ui-dark' depending on the contrast between the header title and background color -->
<div class="win-ui-dark win-header" style="background-color:#2d6c61">
<!-- Background color reflects app's personality -->
<button type="button" id="backButton" class="win-backbutton"></button>
<div class="win-label">Manage Cache</div>
</div>
<div class="win-content ">
<div class="win-settings-section">
<h3>Email App Cache</h3>
<p>Email the app cache to send an administrator to help diagnose checklist issues.</p>
<p><button id="sendAppCacheButton" onclick="sendAppCache()">Email cache to Admin</button></p>
<p id="sendCacheResult"></p>
<h3>Clear App Cache</h3>
<p>Clear the app cache if you are experiencing issues. Unsynced changes will be lost.</p>
<p><button id="clearAppCacheButton" onclick="clearAppCache()">Clear app cache</button></p>
<p id="clearCacheResult"></p>
</div>
</div>
一切看起来都井然有序......有什么建议吗?谢谢!