Royale テーマ スタイルに加えて、すべてのボタンに 5 ポイントのマージンが必要です。
Window1.xaml:
<Window x:Class="_styles.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/PresentationFramework.Royale;component/themes/royale.normalcolor.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Margin" Value="5"/>
</Style>
</ResourceDictionary>
</Window.Resources>
<StackPanel>
<Button Content="Button A"/>
<Button Content="Button B"/>
</StackPanel>
</Window>
コンパイルされますが、次のようになります。
型 'System.StackOverflowException' の未処理の例外が PresentationFramework.dll で発生しました
public Window1() {
InitializeComponent(); // <-- getting exception here
}
次の理由により、例外の詳細はありません。
{現在のスレッドがスタック オーバーフロー状態にあるため、式を評価できません。}