WPF Toolkit PropertyGrid Style

657 views Asked by At

i am trying to override the wpf toolkit propertygrid's style. Therefore i modified the generic.xaml. Now i have the problem that the defaulteditors styles are not overridden. Therefore i wrote following style to override the PropertyGridEditorComboBox in Xaml:

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

This snippet seems to work except the fact that i do not know what i have to bind as an itemssource. What do i have to bind as Itemssource?

If there is also a better way to override the DefaultEditors appearance please let me know.

KR Manuel

1

There are 1 answers

0
Petter Hesselberg On

You have to reach from the style to the control it's applied to -- something like this:

ItemsSource="{TemplateBinding ItemsSource}"

(Assuming that PropertyGridEditorComboBox has an ItemsSource property.)