2010-04-21 58 views
4

我使用Silverlight和我定义了两种风格的页面:多个样式添加到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> 

我不想加入两个样式在一个,cau我也需要他们分开。

我想是这样的:

Style="{StaticResource ExpanderBottomRightButtonStyle ExpanderScaleStyle}" 

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

我是Silverlight 3新手。

在此先感谢。

回答

1

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

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

+0

感谢您的回答,我会尝试。 – lidermin 2010-04-22 15:30:32