我尝试为我的 WinJS Windows 8 Metro 应用程序创建一个新的/自定义设置选项,但它似乎不会出现。我尝试按照此处的建议进行操作,但一无所获。这是我用来初始化所有内容的 JS,我在超级按钮栏中看到“管理缓存”,但单击它只会关闭它:
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>
一切看起来都井井有条……有什么建议吗?谢谢!