diff --git a/PropertyGrid Plus.md b/PropertyGrid-Plus.md similarity index 90% rename from PropertyGrid Plus.md rename to PropertyGrid-Plus.md index ba28517..c8e8602 100644 --- a/PropertyGrid Plus.md +++ b/PropertyGrid-Plus.md @@ -1,18 +1,19 @@ # PropertyGrid Plus Derives from Control -A version of the [PropertyGrid](PropertyGrid) with 15 additional Features: -{anchor:feature1} +A version of the [[PropertyGrid]] with 15 additional Features: + **1) Custom Properties** Create PropertyItems by specifying their characteristics (DisplayName, Value, Category, Description, Editor…). These CustomPropertyItems should be added to the PropertyGrid.Properties collection. The PropertyGrid will then display this collection of custom properties. The display of each property can be individually controlled. + * LiveExplorer sample : PropertyGrid/Using a CustomList/CustomProperties -{anchor:feature2} + **2) DefinitionKey Attribute (For Editors)** The DefinitionKey attribute can be assigned to properties of your selected object to define which EditorDefinition to be applied to the property. As an alternative to the Editor attribute, this allows you separate the UI-specific code from your business model code. It can also be used to specify a specific default editor when a property type does not resolve to a valid editor (e.g., Object). In the following example, the properties FirstName and LastName will use a TextEditor. -{{ +``` [DefinitionKey( "nameType" )](DefinitionKey(-_nameType_-)) public string FirstName { get; set; } [DefinitionKey( "nameType" )](DefinitionKey(-_nameType_-)) @@ -20,18 +21,19 @@ In the following example, the properties FirstName and LastName will use a TextE public object ReferenceNo { get; set; } -}} +``` + * LiveExplorer sample : PropertyGrid/UsingSelectedObjects/DefinitionKeyAttribute -{anchor:feature3} + **3) Expandable properties when multiple objects are selected** Expandable properties will work when using multi-selected object in a PropertGrid. The selectedObjects must have common expandable properties. -{anchor:feature4} + **4) Ability to collapse specific categories with a given class attribute** You can use the ExpandedCategory attribute to make a specific category Collapsed or Expanded by default. In the following example, the Category “Connections” is Collapsed by default. -{{ +``` [ExpandedCategory( "Conections", false )](ExpandedCategory(-_Conections_,-false-)) Public class Person { @@ -42,13 +44,14 @@ In the following example, the Category “Connections” is Collapsed by default [Category( "Information" )](Category(-_Information_-)) public string FirstName { get; set; } } -}} +``` + * LiveExplorer sample : PropertyGrid/UsingSelectedObjects/UsingAttributes -{anchor:feature5} + **5) Attributes for localization** LocalizedDisplayName, LocalizedDescription, LocalizedCategory: Theses attributes allow to easily localize the DisplayName, Description, and Category attributes values using standard Resx resource files. -{{ +``` public class Person { [LocalizedDisplayName( "FirstName", typeof( DisplayLocalizationRes ) )](LocalizedDisplayName(-_FirstName_,-typeof(-DisplayLocalizationRes-)-)) @@ -57,19 +60,19 @@ LocalizedDisplayName, LocalizedDescription, LocalizedCategory: Theses attributes public string FirstName { get; set; } } // DisplayLocalizationRes is a resx file. -}} +``` * LiveExplorer sample : PropertyGrid/UsingSelectedObjects/Localization -{anchor:feature6} + **6) Override property's editor definitions** The EditorDefinition classes can be overridden to fits your needs. -{anchor:feature7} + **7) PropertiesSource string collections are editable** When setting the PropertiesSource or Properties property, you can provide your own data to be displayed in the PropertyGrid. This allows you to easily insert and remove properties at runtime. The usage scheme is similar to the one used for the standard ItemsControl. The following example uses the MyData object to create a collection of 2 properties to fill the PropertyGrid. -{{ +```