What is the easy way to set spacing between items in StackPanel?
问题 Is there an easy way to set default space between items inside StackPanel so I'll don't have to set Margin property on each item? 回答1: if all the controls are the same then do as IanR suggested and implement a Style that catches that control. if it's not then you can't create a default style to a base class because it just won't work. the best way for situations like these is to use a very neat trick - attached properties (aka Behaviors in WPF4) you can create a class that has an attached