Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 2e0026d

Browse files
author
gumme
committed
Movement of a control is now only possible if the control is visible.
Previously you could move an element that was hidden by hovering the cursor on the edges of the hidden control, and clicking when you saw the move-cursor appear.
1 parent e7cdfc0 commit 2e0026d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/PanelMoveAdorner.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ public override void OnApplyTemplate()
4747
{
4848
base.OnApplyTemplate();
4949

50+
var bnd = new Binding("IsVisible") {Source = item.Component};
51+
bnd.Converter = CollapsedWhenFalse.Instance;
52+
BindingOperations.SetBinding(this, UIElement.VisibilityProperty, bnd);
53+
5054
var surface = this.TryFindParent<DesignSurface>();
5155
if (surface != null && surface.ZoomControl != null)
5256
{
53-
var bnd = new Binding("CurrentZoom") {Source = surface.ZoomControl};
57+
bnd = new Binding("CurrentZoom") {Source = surface.ZoomControl};
5458
bnd.Converter = InvertedZoomConverter.Instance;
5559

5660
BindingOperations.SetBinding(scaleTransform, ScaleTransform.ScaleXProperty, bnd);

0 commit comments

Comments
 (0)