本文整理汇总了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
}