影响我,我通常使用这样的效果:如何添加里面ItemContainerStyle
<Image.Effect>
<effects:HueBrightnessContrastSaturationEffect Hue="{Binding hue}"/>
</Image.Effect>
现在我需要应用itemContainerStyle
段内的效果。我试图添加Effect
作为Property
但我得到“效果”不被识别或不可访问。
影响我,我通常使用这样的效果:如何添加里面ItemContainerStyle
<Image.Effect>
<effects:HueBrightnessContrastSaturationEffect Hue="{Binding hue}"/>
</Image.Effect>
现在我需要应用itemContainerStyle
段内的效果。我试图添加Effect
作为Property
但我得到“效果”不被识别或不可访问。
像这样的东西应该很好地工作:
<Foo.ItemContainerStyle>
<Style TargetType="Image">
<Setter Property="Effect">
<Setter.Value>
<effects:HueBrightnessContrastSaturationEffect Hue="{Binding hue}"/>
</Setter.Value>
</Setter>
</Style>
</Foo.ItemContainerStyle>
的XAML可能ItemContainerStyle可能是不适合的图像。也许对于ListBoxItem,ListViewItem或ContentPresenter等。它可能取决于父项ItemsControl。 – pushpraj 2014-09-20 00:54:11
对不起,我没有得到你。 ItemContainerStyle确实取决于(这就是为什么我放了'Foo'),但'Effect'总是用于'Image'不是吗? – har07 2014-09-20 01:22:49
是的,我不得不将TargetType更改为ContentPresenter。多谢你们。 – Infodayne 2014-09-20 04:26:45
后你试过 – 2014-09-19 19:47:39