【问题标题】:Add multiple Styles to Silverlight Control向 Silverlight 控件添加多个样式
【发布时间】:2010-04-22 17:36:49
【问题描述】:

我使用的是silverlight,我为页面定义了两种样式:

  • ExpanderBottomRightButtonStyle
  • ExpanderScaleStyle

现在我想将这两种样式添加到同一个控件中:

<controls:Expander x:Name="expBRButton" Grid.Row="1" Grid.Column="2" Margin="5" Style="{StaticResource ExpanderBottomRightButtonStyle}">
            <controls:Expander.Content>
                <Button Content="&lt;Button&gt;"></Button>
            </controls:Expander.Content>
        </controls:Expander>

我不想将这两种样式合二为一,因为我也需要它们。

我的想法是这样的:

Style="{StaticResource ExpanderBottomRightButtonStyle ExpanderScaleStyle}"

但这是不可能的。我该怎么做?

我是 Silverlight 3 的新手。

提前致谢。

【问题讨论】:

    标签: silverlight silverlight-3.0


    【解决方案1】:

    单独使用样式最接近的方法是创建第三种样式并指定其BasedOn 属性指向您现有的样式之一。然后,您需要复制其他样式的内容。

    不是一个非常令人满意的解决方案,但是,我自己从来没有发现需要这个。

    【讨论】:

    • 谢谢你的回答,我试试看。
    猜你喜欢
    • 2011-08-20
    • 1970-01-01
    • 2011-11-28
    • 2016-12-14
    • 1970-01-01
    • 2017-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多