WPF工具包PropertyGrid样式

时间:2016-12-14 10:00:54

标签: wpf propertygrid toolkit

我试图覆盖wpf工具包propertygrid的样式。因此我修改了generic.xaml。 现在我遇到的问题是默认的样式没有被覆盖。 因此,我编写了以下样式来覆盖Xaml中的PropertyGridEditorComboBox:

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

这个片段似乎有效,除了我不知道我必须绑定为itemssource的事实。我必须绑定为Itemssource?

如果还有更好的方法来覆盖DefaultEditors外观,请告诉我。

KR Manuel

1 个答案:

答案 0 :(得分:0)

你必须从风格到它应用的控件 - 如下所示:

ItemsSource="{TemplateBinding ItemsSource}"

(假设PropertyGridEditorComboBox具有ItemsSource属性。)