Setting a style's TargetType property to a base class
I was just poking around a bit in WPF and wanted all elements on my Window to share the same margin. I found that all Controls that are capable of having a margin derive from FrameworkElement so I tried the following: <Window.Resources> <Style TargetType="{x:Type FrameworkElement}"> <Setter Property="Margin" Value="10" /> </Style> </Window.Resources> And, this doesn't work. I can apply this to all Buttons, but not to all Elements that derive from Button. Am I missing something or is this simply not possible? Am I the only one feeling like using CSS for WPF would have been a good idea? Nicholas