1

Resolved

StackPanel needs Orientation property for runtime view changes

description

StackPanel takes an orientation parameter in it's constructor but does not provide a Orientation property to change the orientation of items after the controls are created.
 
A simple fix may be to change line 40 of the StackPanel.cs file to read ...
 
    private Orientation orientation;
    public Orientation Orientation
    {
        get { return this.orientation; }
        set
        {
            this.orientation = value;
            this.CalcLayout();
        }
    }

comments

atom0s wrote Feb 28, 2012 at 5:55 PM

You can also override the Add() methods and add this.CalcLayout(); to them (after the base call) to reset the controls properly.

wrote Feb 14, 2013 at 7:52 PM

grimston wrote Apr 6, 2013 at 6:16 AM

Fixed as of changeset 31568

wrote May 16, 2013 at 10:22 AM

wrote May 16, 2013 at 10:22 AM

wrote Jun 14, 2013 at 7:19 AM