示例#1
0
        private void CreateToolBars()
        {
            foreach (var node in Nodes)
            {
                // Command items on this level must be all command groups. Other items are ignored.
                var commandGroup = node?.Content as CommandGroup;
                if (commandGroup == null)
                {
                    continue;
                }

                // ToolBarViewModel do not derive from ToolBarItemViewModel. Therefore, we do not
                // call commandGroup.CreateToolBarItem().
                var toolBar = new ToolBarViewModel(commandGroup);
                ToolBars.Add(toolBar);

                if (node.Children != null && node.Children.Count > 0)
                {
                    CreateToolBarItems(node.Children, toolBar.Items);
                }
            }
        }
示例#2
0
        private void CreateToolBars()
        {
            foreach (var node in Nodes)
            {
                // Command items on this level must be all command groups. Other items are ignored.
                var commandGroup = node?.Content as CommandGroup;
                if (commandGroup == null)
                    continue;

                // ToolBarViewModel do not derive from ToolBarItemViewModel. Therefore, we do not
                // call commandGroup.CreateToolBarItem().
                var toolBar = new ToolBarViewModel(commandGroup);
                ToolBars.Add(toolBar);

                if (node.Children != null && node.Children.Count > 0)
                    CreateToolBarItems(node.Children, toolBar.Items);
            }
        }