windows8 應用工具功能表列

來源:互聯網
上載者:User
應用程式欄例子這個樣本示範了如何使用這個應用程式欄呈現導航,命令,和工具,使用者。樣品採用WinJS.UI。 可以和WinJS.UI。 AppBarCommand類。這個應用程式欄被預設和出現在使用者即可手指從頂部或底部螢幕的邊緣。它涵蓋的內容可以被應用程式和使用者提供了一個邊刷,或作用,應用程式。確切地說,該示範了如何添加一個應用程式欄,自訂應用程式欄,和控制應用程式欄。這個簡單的寫在HTML,CSS和JavaScript。 XAML的版本,看到XAML應用程式欄控制例子。

 

(function () {
    "use strict";
    var page = WinJS.UI.Pages.define("/html/scenario1.html", {
        ready: function (element, options) {
            document.getElementById("s1cmdAdd").addEventListener("click", doClickAdd, false);
            document.getElementById("s1cmdRemove").addEventListener("click", doClickRemove, false);
            document.getElementById("s1cmdDelete").addEventListener("click", doClickDelete, false);
            document.getElementById("s1cmdCamera").addEventListener("click", doClickCamera, false);
            WinJS.log && WinJS.log("To show the bar, swipe up from the bottom of the screen, right-click, or press Windows Logo + z. To dismiss the bar, tap in the application, swipe, right-click, or press Windows Logo + z again.", "sample", "status");
        },
        unload: function () {
            AppBarSampleUtils.removeAppBars();
        }
    });

    // Command button functions
    function doClickAdd() {
        WinJS.log && WinJS.log("Add button pressed", "sample", "status");
    }

    function doClickRemove() {
        WinJS.log && WinJS.log("Remove button pressed", "sample", "status");
    }

    function doClickDelete() {
        WinJS.log && WinJS.log("Delete button pressed", "sample", "status");
    }

    function doClickCamera() {
        WinJS.log && WinJS.log("Camera button pressed", "sample", "status");
    }

})();

完整執行個體

/Files/risk/windows8/應用工具功能表列sample.rar 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.