public StandardToolboxViewModel(IToolboxCreatorService service) { ToolBox = new ToolboxControl(); if (service != null) { _service = service; ReloadToolboxIcons(_service); } }
public void ReloadToolboxIcons(IToolboxCreatorService toolboxService) { var categories = toolboxService.GetToolboxCategories(); _dispatcher.BeginInvoke(new Action(() => { ToolBox.Categories.Clear(); categories.ToList().ForEach(cat => ToolBox.Categories.Add(cat)); })); }