2010-04-21 57 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