Пример #1
0
        /// <summary>
        /// Handles post-render tasks.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BuildMenu()
        {
            DataStructures.MenuItem newMenuItem;

            /*
             * Build the NavigationMenu's data structure
             */
            TopMenu mainMenu = new TopMenu(Variables.TOP_MENU_ITEM_ID_MAIN, "Main");

            mainMenu.AddMenuItem(new DataStructures.MenuItem(Variables.MENU_ITEM_ID_HOME, "Home", "pack://application:,,,/ObdExpress;component/UI/Images/home_32.png"));
            mainMenu.AddMenuItem(new DataStructures.MenuItem(Variables.MENU_ITEM_ID_TROUBLE_CODES, "Troubleshooting", "pack://application:,,,/ObdExpress;component/UI/Images/warning_32.png"));

            TopMenu configMenu = new TopMenu(Variables.TOP_MENU_ITEM_ID_CONFIGURATION, "Configuration");

            configMenu.AddMenuItem(new DataStructures.MenuItem(Variables.MENU_ITEM_ID_CONFIGURATION, "Connection", "pack://application:,,,/ObdExpress;component/Ui/Images/connect.png"));

            _navMenu.AddTopMenu(mainMenu);
            _navMenu.AddTopMenu(configMenu);

            /*
             * Attach our event handler
             */
            _navMenu.AddNavigationMenuEventListener(NavigationMenuEventHandler);

            /*
             * Render the NavigationMenu in the GUI
             */
            RenderNavigationMenu();
        }