开发者

Silverlight style trigger throwing error in blend

I am styling a listbox in silverlight and the trigger I am making will not work in Blend. Here is the code.

<Style TargetType="ListBoxItem" x:Key="ContainerStyle">
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="ContentTemplate" Value="{StaticResource SelectedTemplate}" />
            </Trigger>
        </Style.Triggers>
        &l开发者_开发知识库t;Setter Property="ContentTemplate" Value="{StaticResource ItemTemplate}" />
    </Style>

Blend just says "The member Triggers is not recognized or is not accessible.


That would be because the Style class does not have a Triggers collection. Only derivatives of FrameworkElement have a Triggers collection and in Silverlight only Loaded trigger is recognized.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜