Rhino.UI.Controls.Divider - Horizonal vs. Vertical layout

Hi,

using the Rhino.UI.Controls.Divider it seems to work fine as long as the Divider has a horizonal orientation. When using the Divider in a StackLayout:

StackLayout layout = new StackLayout
{
    HorizontalContentAlignment = HorizontalAlignment.Stretch,
    VerticalContentAlignment = VerticalAlignment.Center,
    Orientation = Orientation.Horizontal,
    Padding = new Padding(0),
    Spacing = 0,
    Height = 19,

    Items =
    {
        // Doesn't show up
        new StackLayoutItem(new Divider { Color = this.ViewModel.NormalBorderColor, Size = new Size(1, 19), Width = 1, Height = 19 }), 
        new StackLayoutItem(new Divider { Color = Colors.Transparent, Width = 2 }),
        new StackLayoutItem(dataSetColourButtonLayout),
        new StackLayoutItem(new Divider { Color = Colors.Transparent }, HorizontalAlignment.Stretch, true),
        // Doesn't show up
        new StackLayoutItem(new Divider { Color = this.ViewModel.NormalBorderColor, Size = new Size(1, 19) }),
    }
};

this.Items.Add(new StackLayoutItem(layout, VerticalAlignment.Top, true));
// Does show up
this.Items.Add(new StackLayoutItem(new Divider { Color = this.ViewModel.NormalBorderColor, Height = 1 }, VerticalAlignment.Bottom, false));

I get this layout shown up in the UI.

What am I doing wrong?

Kindest
Christian

Looking at the Divider after constructing in the OnLoadComplete the Divider height and width are set to 0. Now we know why its not showing up.

Why is that happening?

Kindest
Christian

I change it to Panel now and got the UI to look like this:

MIght be still interesting, why the Divider isn’t performing the way expected, but I think Panel is even the better control to use.

Kindest
Christian

Hey @Christian_Hartz, thanks for the insight on the Divider. Looks like we’ve never actually tested/used the Divider with a vertical orientation, as the code is using the middle Y (vs. X) for where it draws the line. I’ve created RH-68546 to fix that up.

Seems like you already fixed it. :wink:

Many thanks
Christian

RH-68546 is fixed in Rhino 7 Service Release 19