9

我是 C#/WPF 的初学者,正在尝试使用 Xceed PropertyGrid。在他们的网站上,他们展示了一个例子:

 <xctk:PropertyGrid x:Name="_propertyGrid" Width="450" Margin="10"
                                 AutoGenerateProperties="False">
            <!-- Only the following properties will be displayed in the PropertyGrid -->
            <xctk:PropertyGrid.PropertyDefinitions>
                <xctk:PropertyDefinition Name="FirstName" />
                <xctk:PropertyDefinition Name="FavoriteColor" />
                <xctk:PropertyDefinition Name="PetNames" />
            </xctk:PropertyGrid.PropertyDefinitions>
        </xctk:PropertyGrid>

我已将其插入我的 xaml。我看到了 PropertyGrid 视图,但是我没有看到任何属性定义。我觉得我必须缺少一些基本的东西?我应该在代码隐藏中添加任何内容吗?

4

1 回答 1

12

我在这里找到了解决方案: http ://wpftoolkit.codeplex.com/discussions/353017

此外,您可以在 Xceed 网站上下载源代码。这提出了使用 propertygrid 的示例,这对我也有帮助。诀窍是分配 PropertyGrid 的“SelectedObject”。

于 2012-04-22T18:20:44.883 回答