Esempio n. 1
0
        public SidemenuToolbar(string name, SideMenuBar menu)
            : base(name, null)
        {
            SideMenu = menu;
            Menu     = menu.Menu;

            CmdCollapseAll = AddChild(new ToolBarButton("collapseall", "Collapse All", (char)FontAwesomeIcons.fa_minus_square));
            CmdExpandAll   = AddChild(new ToolBarButton("expandall", "Expand All", (char)FontAwesomeIcons.fa_plus_square_o));

            CmdScrollUp   = AddChild(new ToolBarButton("scrollup", "Scroll Up", (char)FontAwesomeIcons.fa_chevron_up));
            CmdScrollDown = AddChild(new ToolBarButton("scrolldown", "Scroll Down", (char)FontAwesomeIcons.fa_chevron_down));

            CmdScrollUp.IsAutofire   = true;
            CmdScrollDown.IsAutofire = true;


            CmdPin                = AddChild(new ToolBarButton("pinned", "Pin the sidebar", (char)FontAwesomeIcons.fa_thumb_tack));
            CmdPin.Dock           = Docking.Right;
            CmdPin.IsToggleButton = true;
            CmdPin.Click         += (sender, e) => SideMenu.AutoClose = !CmdPin.Checked;

            CmdHamburgerClose        = AddChild(new ToolBarButton("close", "Minimize to Mobile-Menu", (char)FontAwesomeIcons.fa_bars));
            CmdHamburgerClose.Dock   = Docking.Right;
            CmdHamburgerClose.Margin = new Padding(2, 0, 1, 0);
            this.Padding             = new Padding(5, 1, 1, 1);

            Children.OfType <ToolBarButton> ().ForEach(btn => btn.DisplayStyle = ButtonDisplayStyles.Image);
            CmdHamburgerClose.Click += (sender, e) => SideMenu.OnClose();
        }
Esempio n. 2
0
 protected override void CleanupManagedResources()
 {
     Menu     = null;
     SideMenu = null;
     base.CleanupManagedResources();
 }