Building a reversible StackPanel in WPF
问题 I'd like to build a custom StackPanel with a ReverseOrder property that I can declaratively set to true to have the elements in the StackPanel appear in the opposite order of normal (e.g. bottom to top or right to left). It needs to be reversible on the fly. I'm thinking of deriving a new class from StackPanel, but I need to know what methods to override. Final solution: protected override System.Windows.Size ArrangeOverride( System.Windows.Size arrangeSize ) { double x = 0; double y = 0;