Index: Core/Common/src/Core.Common.Gui/Converters/KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute.cs =================================================================== diff -u -rcf9306f3121c83f6ea21fed815245481771ada1b -r7c1d854449dea26e579851ed0a7f91e9387e1c8d --- Core/Common/src/Core.Common.Gui/Converters/KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute.cs (.../KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute.cs) (revision cf9306f3121c83f6ea21fed815245481771ada1b) +++ Core/Common/src/Core.Common.Gui/Converters/KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute.cs (.../KeyValueAsRoundedDoubleWithoutTrailingZeroesElementAttribute.cs) (revision 7c1d854449dea26e579851ed0a7f91e9387e1c8d) @@ -54,10 +54,10 @@ public override string GetName(object source) { - PropertyInfo namePropertyInfo = source.GetType().GetProperty(namePropertyName); + PropertyInfo namePropertyInfo = source.GetType().GetProperty(NamePropertyName); if (namePropertyInfo == null) { - throw new ArgumentException($"Name property '{namePropertyName}' was not found on type {source.GetType().Name}."); + throw new ArgumentException($"Name property '{NamePropertyName}' was not found on type {source.GetType().Name}."); } PropertyInfo unitPropertyInfo = GetUnitPropertyInfo(source); Index: Core/Common/src/Core.Common.Gui/Converters/KeyValueElementAttribute.cs =================================================================== diff -u -r0b30baa3fa65d8b4159b5bcd9d80ddb77a2aafb8 -r7c1d854449dea26e579851ed0a7f91e9387e1c8d --- Core/Common/src/Core.Common.Gui/Converters/KeyValueElementAttribute.cs (.../KeyValueElementAttribute.cs) (revision 0b30baa3fa65d8b4159b5bcd9d80ddb77a2aafb8) +++ Core/Common/src/Core.Common.Gui/Converters/KeyValueElementAttribute.cs (.../KeyValueElementAttribute.cs) (revision 7c1d854449dea26e579851ed0a7f91e9387e1c8d) @@ -31,8 +31,6 @@ [AttributeUsage(AttributeTargets.Property)] public class KeyValueElementAttribute : Attribute { - protected readonly string namePropertyName; - /// /// Creates a new instance of . /// @@ -41,7 +39,7 @@ /// Thrown when any parameter is null. public KeyValueElementAttribute(string namePropertyName, string valuePropertyName) { - this.namePropertyName = namePropertyName; + NamePropertyName = namePropertyName; ValuePropertyName = valuePropertyName; if (valuePropertyName == null) { @@ -65,10 +63,10 @@ /// public virtual string GetName(object source) { - PropertyInfo namePropertyInfo = source.GetType().GetProperty(namePropertyName); + PropertyInfo namePropertyInfo = source.GetType().GetProperty(NamePropertyName); if (namePropertyInfo == null) { - throw new ArgumentException($"Name property '{namePropertyName}' was not found on type {source.GetType().Name}."); + throw new ArgumentException($"Name property '{NamePropertyName}' was not found on type {source.GetType().Name}."); } return Convert.ToString(namePropertyInfo.GetValue(source, new object[0])); @@ -97,6 +95,11 @@ /// /// Gets the name of the property to show as value. /// + protected string NamePropertyName { get; } + + /// + /// Gets the name of the property to show as value. + /// protected string ValuePropertyName { get; } } } \ No newline at end of file