Margin Archive - Cocoon Software

Jul 27

Auto Margin between Panel elements

How do you achieve a simple alignment of multiple elements within a panel in WPF? If you’re doing masks with multiple Textblocks and Textboxes you might have asked yourself exactly this question. In Winforms this wasn’t a trivial problem because you had to set the margin or padding of each element yourself. Fortunately this is a