/// <summary> /// Render the NavigationMenu according to the state of the datastructure that backs it. /// </summary> private void RenderNavigationMenu() { IEnumerator <TopMenu> tEnum = _navMenu.GetEnumerator(); IEnumerator <DataStructures.MenuItem> mEnum; _topMenuItems.Clear(); while (tEnum.MoveNext()) { // Add the TopMenu _topMenuItems.Add(tEnum.Current); if (tEnum.Current.IsSelected) { mEnum = tEnum.Current.GetEnumerator(); _menuItems.Clear(); while (mEnum.MoveNext()) { _menuItems.Add(mEnum.Current); } } } // Now that the menu is built and ready, notify this window to display the content // corresponding to the selected Menu Item (in this case, the Home page). NavigationMenuEventHandler(_navMenu, NavigationMenuEventType.MENUITEM_SELECTED); }