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

Commit a72899f

Browse files
Merge pull request #519 from jogibear9988/gridplacementfix
Grid placement Fix
2 parents 6ffe7b8 + 50ad72b commit a72899f

1 file changed

Lines changed: 7 additions & 20 deletions

File tree

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/GridPlacementSupport.cs

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -218,28 +218,15 @@ public override void SetPosition(PlacementInformation info)
218218
margin.Bottom = GetRowOffset(bottomRowIndex + 1) - info.Bounds.Bottom;
219219
info.Item.Properties[FrameworkElement.MarginProperty].SetValue(margin);
220220

221-
var widthIsSet = info.Item.Properties[FrameworkElement.WidthProperty].IsSet;
222-
var heightIsSet = info.Item.Properties[FrameworkElement.HeightProperty].IsSet;
223-
if (!widthIsSet)
224-
{
225-
if (ha == HorizontalAlignment.Stretch)
226-
info.Item.Properties[FrameworkElement.WidthProperty].Reset();
227-
else
228-
info.Item.Properties[FrameworkElement.WidthProperty].SetValue(info.Bounds.Width);
229-
}
230-
else {
221+
if (ha == HorizontalAlignment.Stretch)
222+
info.Item.Properties[FrameworkElement.WidthProperty].Reset();
223+
else
231224
info.Item.Properties[FrameworkElement.WidthProperty].SetValue(info.Bounds.Width);
232-
}
233-
if (!heightIsSet)
234-
{
235-
if (va == VerticalAlignment.Stretch)
236-
info.Item.Properties[FrameworkElement.HeightProperty].Reset();
237-
else
238-
info.Item.Properties[FrameworkElement.HeightProperty].SetValue(info.Bounds.Height);
239-
}
240-
else {
225+
226+
if (va == VerticalAlignment.Stretch)
227+
info.Item.Properties[FrameworkElement.HeightProperty].Reset();
228+
else
241229
info.Item.Properties[FrameworkElement.HeightProperty].SetValue(info.Bounds.Height);
242-
}
243230
}
244231

245232
public override void LeaveContainer(PlacementOperation operation)

0 commit comments

Comments
 (0)