Пример #1
0
        /// <summary>
        /// Handles the Click event of the lbl control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        void lbl_Click(object sender, EventArgs e)
        {
            Label lbl = sender as Label;

            if (lbl.Tag != null)
            {
                var menu = (NavigationMenuItemExt)lbl.Tag;
                if (menu.ShowControl == null)
                {
                    selectItem = menu;

                    if (ClickItemed != null)
                    {
                        ClickItemed(this, e);
                    }
                }
                else
                {
                    if (IsExpand)
                    {
                        selectItem = menu;
                        ResetChildControl();
                    }
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UCNavigationMenuExt"/> class.
 /// </summary>
 public UCNavigationMenuExt()
 {
     InitializeComponent();
     items = new NavigationMenuItemExt[0];
     if (ControlHelper.IsDesignMode())
     {
         items = new NavigationMenuItemExt[4];
         for (int i = 0; i < 4; i++)
         {
             items[i] = new NavigationMenuItemExt()
             {
                 Text        = "菜单" + (i + 1),
                 AnchorRight = i >= 2
             };
         }
     }
 }