Royaleのテーマスタイルに加えて、すべてのボタンに5ポイントの余白を設定します。WPF:テーマのスタイルを拡張する - StackOverflowException
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
}
を発生
例外の詳細はありません:
{。現在のスレッドがスタックオーバーフロー状態にあるので、式を評価することはできません}
例外がどこで発生したのかわかりますか? – ChrisF