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

AddItemWithDefaultSize() static private method

static private AddItemWithDefaultSize ( DesignItem container, DesignItem createdItem, Point position ) : bool
container DesignItem
createdItem DesignItem
position Point
return bool
        internal static bool AddItemWithDefaultSize(DesignItem container, DesignItem createdItem, Point position)
        {
            return AddItemWithCustomSize(container, createdItem, position, ModelTools.GetDefaultSize(createdItem));
        }

Same methods

CreateComponentTool::AddItemWithDefaultSize ( DesignItem container, Type createdItem, Size size ) : 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