Je veux que chaque bouton ait une marge de 5 points, en plus du style de thème Royale.WPF: Extension du style du thème - 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>
Il compile, mais je reçois:
Une exception non gérée du type 'System.StackOverflowException' a eu lieu dans PresentationFramework.dll
public Window1() {
InitializeComponent(); // <-- getting exception here
}
Il n'y a pas de détails d'exception parce que:
{Ne peut pas évaluer l'expression parce que le thread courant est dans un état de débordement de pile.}
Pouvez-vous nous donner une indication de l'endroit où l'exception est soulevée? – ChrisF