Browse Source
<extToolkit:PropertyGrid AutoGenerateProperties="False">
<extToolkit:PropertyGrid.PropertyDefinitions>
<extToolkit:PropertyDefinition Name="FirstName" />
<extToolkit:PropertyDefinition Name="Age" />
</extToolkit:PropertyGrid.PropertyDefinitions>
</extToolkit:PropertyGrid>
This will only show the FirstName and Age properties of the bound object.
pull/1645/head
7 changed files with 89 additions and 11 deletions
@ -0,0 +1,9 @@ |
|||
using System; |
|||
|
|||
namespace Microsoft.Windows.Controls.PropertyGrid |
|||
{ |
|||
public class PropertyDefinition |
|||
{ |
|||
public string Name { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
using System.Collections.ObjectModel; |
|||
|
|||
namespace Microsoft.Windows.Controls.PropertyGrid |
|||
{ |
|||
public class PropertyDefinitionCollection : ObservableCollection<PropertyDefinition> |
|||
{ |
|||
public PropertyDefinition this[string propertyName] |
|||
{ |
|||
get |
|||
{ |
|||
foreach (var item in Items) |
|||
{ |
|||
if (item.Name == propertyName) |
|||
return item; |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue