diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.Designer.UserInterface/Editors/Designer/Controls/DesignerControl.cs b/Plugins.UserInterface/UniversalEditor.Plugins.Designer.UserInterface/Editors/Designer/Controls/DesignerControl.cs
index de55c787..340b40ce 100644
--- a/Plugins.UserInterface/UniversalEditor.Plugins.Designer.UserInterface/Editors/Designer/Controls/DesignerControl.cs
+++ b/Plugins.UserInterface/UniversalEditor.Plugins.Designer.UserInterface/Editors/Designer/Controls/DesignerControl.cs
@@ -119,9 +119,18 @@ namespace UniversalEditor.Plugins.Designer.UserInterface.Editors.Designer.Contro
dragging.Y = new ObjectModels.Designer.Measurement(dy + (e.Y - cy), ObjectModels.Designer.MeasurementUnit.Pixel);
dragging = null;
(Parent as DesignerEditor).EndEdit();
+
+ Refresh();
}
}
+ ///
+ /// Gets or sets a value indicating whether the contents of a on this will be shown while a drag operation
+ /// is in progress. If false, a border outline will be drawn at the current drag location instead of the contents of the associated .
+ ///
+ /// true if show contents while dragging; otherwise, false.
+ public bool ShowContentsWhileDragging { get; set; } = true;
+
protected override void OnPaint(PaintEventArgs e)
{
if (m_ObjectModel == null) return;
@@ -134,9 +143,15 @@ namespace UniversalEditor.Plugins.Designer.UserInterface.Editors.Designer.Contro
{
ComponentInstance inst = SelectedDesign.ComponentInstances[i];
Rectangle componentRect = new MBS.Framework.Drawing.Rectangle(margin_x + inst.X.Value, margin_y + inst.Y.Value, inst.Width.Value, inst.Height.Value);
- if (inst == dragging)
+
+ MBS.Framework.Drawing.Rectangle dragBounds = new MBS.Framework.Drawing.Rectangle(margin_x + _tmpDragX, margin_y + _tmpDragY, inst.Width.Value, inst.Height.Value);
+ if (inst == dragging && ShowContentsWhileDragging)
{
- componentRect = new MBS.Framework.Drawing.Rectangle(margin_x + _tmpDragX, margin_y + _tmpDragY, inst.Width.Value, inst.Height.Value);
+ componentRect = dragBounds;
+ }
+ else if (inst == dragging)
+ {
+ e.Graphics.DrawRectangle(new Pen(SystemColors.HighlightBackground), dragBounds);
}
inst.Component.Render(inst, e, componentRect);