示例#1
0
        private void AddToolboxItem(Visual documentBaseVisual, LayoutWidgetType type, string svgIcon, string caption)
        {
            var item = new LayoutingToolboxItemViewModel
            {
                Type               = type,
                SvgIcon            = svgIcon,
                Name               = caption,
                DocumentBaseVisual = documentBaseVisual
            };

            item.LayoutingItemDragStart += Item_LayoutingItemDragStart;
            item.LayoutingItemDragStop  += Item_LayoutingItemDragStop;
            ToolboxItems.Add(item);
        }
示例#2
0
        private void LoadToolboxItems()
        {
            if (ToolboxItems == null)
            {
                ToolboxItems = new ObservableCollection <ToolboxItem>();
            }
            ToolboxItems.Clear();

            foreach (var factory in ActivityViewFactories.Where(f => f.Metadata.IsToolboxItem))
            {
                ToolboxItems.Add(new ToolboxItem
                {
                    Caption      = factory.Metadata.Caption,
                    ActivityType = factory.Metadata.TargetType
                });
            }
        }