public IEnumerable <IMenuItem> CollectDynamicMenuItems(object commandParameter)
        {
            var builder = new MenuBuilder();

            // Menu:  Virtual devices
            int       currentWeight   = 0;
            IMenuItem deviceMenuGroup =
                MenuItemFactory.CreateMenuItem(
                    menuText: "Virtual Devices",
                    weight: currentWeight++);

            using (builder.AddMenuGroup(deviceMenuGroup))
            {
                int i = 0;
                var virtualDevices = this.driverOperations.VirtualDeviceNames;
                var currentlySelectedVirtualDevice = this.SelectedVirtualDevice;
                foreach (var virtualDevice in virtualDevices)
                {
                    IMenuItem deviceMenuItem =
                        MenuItemFactory.CreateMenuItem(
                            menuCommand:
                            new NationalInstruments.RelayCommand(
                                executeParam => this.SelectedVirtualDevice = virtualDevice,
                                canExecuteParam => virtualDevice != currentlySelectedVirtualDevice),
                            menuText: virtualDevice,
                            weight: i,
                            commandParameter: null);
                    builder.AddMenu(deviceMenuItem);
                    i++;
                }
            }

            builder.AddMenu(MenuItemFactory.CreateSeparator(currentWeight++));

            //Menu: Refresh
            builder.AddMenu(
                MenuItemFactory.CreateMenuItem(
                    menuCommand:
                    new NationalInstruments.RelayCommand(
                        executeParam => this.driverOperations.Refresh(),
                        canExecuteParam => !this.IsAnyDeviceOffline),
                    menuText: "Refresh",
                    weight: currentWeight++,
                    commandParameter: null));

            return(builder.MenuItems);
        }