当前位置: 首页>>代码示例>>C#>>正文


C# MenuButton.AttachTo方法代码示例

本文整理汇总了C#中MenuButton.AttachTo方法的典型用法代码示例。如果您正苦于以下问题:C# MenuButton.AttachTo方法的具体用法?C# MenuButton.AttachTo怎么用?C# MenuButton.AttachTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MenuButton的用法示例。


在下文中一共展示了MenuButton.AttachTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Application

        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            bool isVisible = false;
            var fontAwsome = new TTF.fontawesome_webfont();
            
            var dashboard = new MenuButton();
            dashboard.ButtonText.innerText = "Dashboard";
            dashboard.MenuButton.css.hover.style.backgroundColor = "#97829a";

            dashboard.ButtonText.css.before.style.fontFamily = fontAwsome;
            dashboard.ButtonText.css.before.contentText = "\xf009";
            dashboard.ButtonText.css.before.style.paddingRight = "5px";

            var games = new MenuButton();
            games.ButtonText.innerText = "games";
            games.MenuButton.css.hover.style.backgroundColor = "#97829a";

            games.ButtonText.css.before.style.fontFamily = fontAwsome;
            games.ButtonText.css.before.contentText = "\xf11b";
            games.ButtonText.css.before.style.paddingRight = "5px";


            var menu = new SliderMenu();
            menu.MenuHeader.innerText = "Abstractatech";
            menu.SliderMenu.style.fontFamily = new TTF.OpenSans_Semibold();


            dashboard.AttachTo(menu.SliderMenu);
            games.AttachTo(menu.SliderMenu);

            menu.AttachTo(page.MenuHolder);


            page.Click.onclick += delegate
            {
                if (!isVisible)
                {
                    isVisible = true;
                    page.MenuHolder.style.width = "15em";
                    menu.SliderMenu.style.width = "15em";
                }
                else
                {
                    isVisible = false;
                    page.MenuHolder.style.width = "0em";
                    menu.SliderMenu.style.width = "0em";
                }
            };

            #region Styles

            new IStyle(menu.SliderMenu)
            {
                transition = "width 0.5s ease-in-out",
                Opacity = 1,
                width = "0em"
            };
            new IStyle(page.MenuHolder)
            {
                transition = "width 0.5s ease-in-out",
                Opacity = 1,
                width = "0em"
            };


            page.Click.style.fontFamily = fontAwsome;
            page.Click.innerText = "\xf00b";

            new IStyle(page.Click)
            {
                border = "0",
                color="#fff",
                fontSize = "2em",
                padding = "10px 10px 7px 10px",
                backgroundColor = "#97829a"
            };
            #endregion

        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:83,代码来源:Application.cs


注:本文中的MenuButton.AttachTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。