Browse Source

Merge pull request #519 from jogibear9988/gridplacementfix

Grid placement Fix
pull/520/head
Siegfried Pammer 11 years ago
parent
commit
a72899fdee
  1. 27
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/GridPlacementSupport.cs

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

@ -218,28 +218,15 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -218,28 +218,15 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
margin.Bottom = GetRowOffset(bottomRowIndex + 1) - info.Bounds.Bottom;
info.Item.Properties[FrameworkElement.MarginProperty].SetValue(margin);
var widthIsSet = info.Item.Properties[FrameworkElement.WidthProperty].IsSet;
var heightIsSet = info.Item.Properties[FrameworkElement.HeightProperty].IsSet;
if (!widthIsSet)
{
if (ha == HorizontalAlignment.Stretch)
info.Item.Properties[FrameworkElement.WidthProperty].Reset();
else
info.Item.Properties[FrameworkElement.WidthProperty].SetValue(info.Bounds.Width);
}
else {
if (ha == HorizontalAlignment.Stretch)
info.Item.Properties[FrameworkElement.WidthProperty].Reset();
else
info.Item.Properties[FrameworkElement.WidthProperty].SetValue(info.Bounds.Width);
}
if (!heightIsSet)
{
if (va == VerticalAlignment.Stretch)
info.Item.Properties[FrameworkElement.HeightProperty].Reset();
else
info.Item.Properties[FrameworkElement.HeightProperty].SetValue(info.Bounds.Height);
}
else {
if (va == VerticalAlignment.Stretch)
info.Item.Properties[FrameworkElement.HeightProperty].Reset();
else
info.Item.Properties[FrameworkElement.HeightProperty].SetValue(info.Bounds.Height);
}
}
public override void LeaveContainer(PlacementOperation operation)

Loading…
Cancel
Save