XAMLに、すべてのコントロールに適用されるスタイルを設定する方法はありますか?たとえば、以下では、すべてのコントロールにマージンを設定したいと思います。TargetTypeをButton、CheckBoxなどに変更することで、タイプごとにスタイルを追加できます。代わりに、Controlから継承するすべてのタイプにスタイルを設定する以下のように設定します。
<UserControl x:Class="MyPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Height="300" Width="300">
<UserControl.Resources>
<Style TargetType="Control">
<Setter Property="Margin" Value="3"/>
</Style>
</UserControl.Resources>
<StackPanel>
<Button>My Button</Button>
<CheckBox>My Checkbox</CheckBox>
</StackPanel>
</UserControl>