Unlike with a child elements margin and padding, which is hidden correctly when a child element is invisible, the spacing space is still added in the VerticalStackPanel:
(This screenshot shows the hidden content at the top of the bottom left panel)
(This screenshot shows when that content is set to .Visible = false, leading to extra space still being added when it shouldn't be.
And for completion's sake, here's the code used by the verticalstackpanel:
HexData = new VerticalStackPanel(); HexData.Background = new SolidBrush(new Color(10, 22, 34)); HexData.HorizontalAlignment = HorizontalAlignment.Left; HexData.VerticalAlignment = VerticalAlignment.Top; HexData.Padding = new Thickness(10); HexData.Width = 300; HexData.Height = 500; HexData.Spacing = 15; //This is the bit that doesn't work with hidden elements MenuPanel.AddChild(HexData);
It would be awesome if this could be fixed at some point?
Unlike with a child elements margin and padding, which is hidden correctly when a child element is invisible, the spacing space is still added in the VerticalStackPanel:
(This screenshot shows the hidden content at the top of the bottom left panel)
(This screenshot shows when that content is set to .Visible = false, leading to extra space still being added when it shouldn't be.
And for completion's sake, here's the code used by the verticalstackpanel:
HexData = new VerticalStackPanel(); HexData.Background = new SolidBrush(new Color(10, 22, 34)); HexData.HorizontalAlignment = HorizontalAlignment.Left; HexData.VerticalAlignment = VerticalAlignment.Top; HexData.Padding = new Thickness(10); HexData.Width = 300; HexData.Height = 500; HexData.Spacing = 15; //This is the bit that doesn't work with hidden elements MenuPanel.AddChild(HexData);
It would be awesome if this could be fixed at some point?