Search code examples
wpforientationstackpanel

StackPanel orientation set in code behind


I want to set my StackPanel Orientation property to vertical in code behind. I cant find Enum that I can set Vertical.

 var panel = new StackPanel();
 panel.Orientation = Vertical;

Solution

  • After some research I found from MSDN

    var panel = new StackPanel();
    panel.Orientation = Orientation.Vertical;
    

    May be helpful for researchers