private void CreateModulesMenu(MainViewModel model)
        {
            model.ModulesMenu
                .OfType<MenuElementGroup>()
                .ForEach(AddGroupToModulesBar);

            model.TopMenu
                .OfType<MenuElementGroup>()
                .ForEach(AddToTopMenu);

            model.Toolbar
                .OfType<MenuElement>()
                .ForEach(AddToolbarMenu);
        }
 public void SetViewModel(MainViewModel model)
 {
     CreateModulesMenu(model);
 }