net472_PropertyGridHelpers.Attributes_DynamicPathSourceAttribute - dparvin/PropertyGridHelpers GitHub Wiki
Specifies that another property dynamically provides the path to the resources used to display this property in the PropertyGrid.
[AttributeUsage(AttributeTargets.Property)]
public class DynamicPathSourceAttribute : Attribute
name | description |
---|---|
DynamicPathSourceAttribute(…) | Initializes a new instance of the DynamicPathSourceAttribute class. |
static Get(…) | Gets the specified context. |
PathPropertyName { get; } | Gets the name of the path property. |
Typically used for properties of an Enum type in a PropertyGrid, where the enum values are shown in a dropdown and mapped to resources that provide user-friendly display text. The referenced property contains the path to these resources, allowing the user of the property to specify which resource set to use for what is displayed.
[DynamicPathSource(nameof(ResourcePath))]
public MyEnum DisplayProperty { get; set; }
public string ResourcePath { get; set; } = "MyNamespace.Resources";
- namespace PropertyGridHelpers.Attributes
- assembly PropertyGridHelpers
- DynamicPathSourceAttribute.cs