Search code examples
windows-phone-8orientationstackpanel

How to set orientation of StackPanel dynamically?


I am trying to set orientation of StackPanel but following is giving me error, it says orientation does not have Vertical definition. What is the true way to set orientation of StackPanel to vertical dynamically?

StackPanel firstPanel = new StackPanel();
firstPanel.Orientation = Orientation.Vertical;

Solution

  • Did you try setting it through XAML? or have a look at this:

    Stackpanel Orientation