If I have a DataGrid in a XAML form, and add the following style:
<Style TargetType="Button">
<Setter Property="Margin" Value="2"/>
</Style>
The data grid locks up the application. I found if I put the style into a resource block that isn't seen by any data grid, then it seems to be happy. However, if I want to have the style above applied to all buttons on my window, I have to put it in various resource blocks that cannot be seen by the data grid.
Is there any way to avoid this?