2010-10-25 26 views

回答

103

也可用於:

<Separator Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" /> 
+2

這很簡單,容易!這應該被標記爲答案! – psulek 2013-01-11 08:08:29

+2

優雅的解決方案 – 2013-02-20 09:58:21

31

豎隔

<Style x:Key="VerticalSeparatorStyle" 
     TargetType="{x:Type Separator}" 
     BasedOn="{StaticResource {x:Type Separator}}"> 
    <Setter Property="Margin" Value="6,0,6,0"/> 
    <Setter Property="LayoutTransform"> 
     <Setter.Value> 
      <TransformGroup> 
       <TransformGroup.Children> 
        <TransformCollection> 
         <RotateTransform Angle="90"/> 
        </TransformCollection> 
       </TransformGroup.Children> 
      </TransformGroup> 
     </Setter.Value> 
    </Setter> 
</Style> 

裏面可以這樣

<Separator Style="{DynamicResource VerticalSeparatorStyle}" /> 
+0

美麗。謝謝。 – usefulBee 2015-12-03 19:17:47