2017-07-18 213 views
0

我正在使用擴展WPF工具包。WPF擴展工具包DropDownButton

如何更改此DropDownButton中的箭頭標準樣式?

<wpfx:DropDownButton 
     Width="200" 
     Height="32" 
     Content="DropDownButton: ClickMe"> 
     <wpfx:DropDownButton.DropDownContent> 
      <wpfx:WrapPanel Background="Aqua"> 
       <StackPanel Width="100" Height="100"> 
        <Button>Click Me</Button> 
       </StackPanel> 
      </wpfx:WrapPanel> 
     </wpfx:DropDownButton.DropDownContent> 
    </wpfx:DropDownButton> 

回答

1

您需要修改(整個)控制模板。你會發現,這裏默認的:https://github.com/xceedsoftware/wpftoolkit/blob/015d89f201800a275feacf8eccedfd58fb1a59ca/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DropDownButton/Themes/Generic.xaml

你可以把它複製到你的項目和設置您的DropDownButtonTemplate屬性:在模板

<wpfx:DropDownButton Width="200" Height="32" Content="DropDownButton: ClickMe"> 
    <wpfx:DropDownButton.DropDownContent> 
     <wpfx:WrapPanel Background="Aqua"> 
      <StackPanel Width="100" Height="100"> 
       <Button>Click Me</Button> 
      </StackPanel> 
     </wpfx:WrapPanel> 
    </wpfx:DropDownButton.DropDownContent> 
    <wpfx:DropDownButton.Template> 
     <!-- add the ControlTemplate here --> 
    </wpfx:DropDownButton.Template> 
</wpfx:DropDownButton> 

外觀爲Path與「箭」的x:Name 。您需要將Data屬性設置爲代表所需箭頭的Geometry

有「箭頭」屬性或者你可以設置一些枚舉值或類似的東西。您需要自己定義箭頭的外觀並修改模板。

+0

@亞歷Wyler:請記住投票了有用的答案:) https://stackoverflow.com/help/someone-answers – mm8

相關問題