2016-12-14 395 views
0

我想重寫wpf toolkit propertygrid的風格。所以我修改了generic.xaml。 現在我有問題,defaulteditors樣式不覆蓋。 所以我寫了下面的樣式來覆蓋PropertyGridEditorComboBox在XAML:WPF工具包PropertyGrid風格

<Style TargetType="{x:Type xctk:PropertyGridEditorComboBox}"> 
<Setter Property="Template"> 
    <Setter.Value> 
     <ControlTemplate> 
      <ComboBox SelectedItem="{Binding Value}" ItemsSource="{?????}" /> 
     </ControlTemplate> 
    </Setter.Value> 
</Setter> 

這個片段似乎只是事實的工作,我不知道我要捆綁爲一個的ItemsSource。我需要綁定爲ItemSource?

如果還有更好的方法來覆蓋DefaultEditors外觀,請讓我知道。

KR曼努埃爾

回答

0

你必須從風格到控制它的應用將達到 - 這樣的事情:(假設PropertyGridEditorComboBoxItemsSource屬性)

ItemsSource="{TemplateBinding ItemsSource}"