2010-05-14 79 views
0

是否可以在樣式中定義資源而不是使用模板?樣式與控制模板

<ListView.Resources > 
     <Style TargetType="{x:Type ScrollBar}"> 
       <Setter Property="Background" Value="Transparent" /> 
     </Style> 
    </ListView.Resources> 

我如何包裝這個東西到:

<Style TargetType="{x:Type ListView}"> 

    </Style> 

回答

1

我不確定我是否正確理解你的問題......你在找什麼?

<Style TargetType="{x:Type ScrollBar}"> 
      <Style.Resources> 
       <Style TargetType="{x:Type ListView}"> 

       </Style> 

      </Style.Resources> 
      <Setter Property="Background" Value="Transparent" /> 
    </Style>