示例#1
0
        public override void Drop(object sender, DragEventArgs e)
        {
            Assert.ArgumentNotNull(sender, nameof(sender));
            Assert.ArgumentNotNull(e, nameof(e));

            var items = GetItems(e).ToList();

            if (!items.Any())
            {
                return;
            }

            var position = e.GetPosition(DesignSurface);

            foreach (var item in items)
            {
                var result = DesignSurface.CreateShape(new TemplateShapeContent(this, item.ItemUri, item.Name));

                result.SetPosition(position);

                position.Offset(16, 16);
            }

            SetModifiedFlag(true);
        }