Browse Source

Grid placement Fix

When Grid Stretched horizontal no width should be set!
Same on vertical!
pull/519/head
jkuehner 11 years ago
parent
commit
50ad72bcc0
  1. 15
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/GridPlacementSupport.cs

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

@ -218,29 +218,16 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -218,29 +218,16 @@ 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 {
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 {
info.Item.Properties[FrameworkElement.HeightProperty].SetValue(info.Bounds.Height);
}
}
public override void LeaveContainer(PlacementOperation operation)
{

Loading…
Cancel
Save