Dictionary にバインドされた ItemsControl があり、Dictionaries キーの値に基づいてテンプレートを適用しようとしています。私はやろうとしています:
<ItemsControl ItemsSource="{Binding Path=CommonItems, Mode=OneWay}">
<ItemsControl.Style>
<Style TargetType="ItemsControl">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Key}" Value="authentication">
<Setter Property="ItemTemplate" Value="{StaticResource AuthenticationTemplate}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ItemsControl.Style>
</ItemsControl>
それはまったく機能せず、キーが ItemsControl に存在しないというエラーが表示されます。これにより、TargetType を使用してバインディングを検索していると思われます。では、これをどのように行い、実際に ItemsSource を使用させるのでしょうか?