ICSharpCode.WpfDesign.Designer.Services.CreateComponentTool.AddItemWithDefaultSize C# (CSharp) Method

AddItemWithDefaultSize() public static method

public static AddItemWithDefaultSize ( DesignItem container, Type createdItem, Size size ) : bool
container DesignItem
createdItem System.Type
size System.Windows.Size
return bool
        public static bool AddItemWithDefaultSize(DesignItem container, Type createdItem, Size size)
        {
            CreateComponentTool cct = new CreateComponentTool(createdItem);
            return AddItemWithCustomSize(container, cct.CreateItem(container.Context), new Point(0, 0), size);
        }

Same methods

CreateComponentTool::AddItemWithDefaultSize ( DesignItem container, DesignItem createdItem, Point position ) : bool

Usage Example

        protected override void OnMouseUp(object sender, MouseButtonEventArgs e)
        {
            if (hasDragStarted)
            {
                if (operation != null)
                {
                    operation.Commit();
                    operation = null;
                }
            }
            else
            {
                CreateComponentTool.AddItemWithDefaultSize(container, createdItem, e.GetPosition(positionRelativeTo));
            }
            if (changeGroup != null)
            {
                changeGroup.Commit();
                changeGroup = null;
            }

            if (designPanel.Context.Services.Component is XamlComponentService)
            {
                ((XamlComponentService)designPanel.Context.Services.Component).RaiseComponentRegisteredAndAddedToContainer(createdItem);
            }

            base.OnMouseUp(sender, e);
        }
All Usage Examples Of ICSharpCode.WpfDesign.Designer.Services.CreateComponentTool::AddItemWithDefaultSize