wpf xaml スタイルの定義について質問があります。この方法でスタイルを設定しようとすると:
<StackPanel Orientation="Vertical">
<StackPanel.Style>
<Setter Property="BusinessModeler:GraphItemBehaviour.IsBroughtIntoViewWhenSelected" Value="True" />
</StackPanel.Style>
</StackPanel>
メッセージで例外を発生させます - 'System.Windows.Setter' is not a valid value for property 'Style'
。
この定義を使用すると:
<Style x:Key="itemBehaviour" >
<Setter Property="BusinessModeler:GraphItemBehaviour.IsBroughtIntoViewWhenSelected" Value="True" />
</Style>
<StackPanel Orientation="Vertical" Style="{StaticResource itemBehaviour}">
すべて正常に動作します。
それで、違いは何ですか?