コード例 #1
0
        /// <summary>
        /// Find the "Label" attribute value in a property's attribute metadata.
        /// </summary>
        /// <param name="prop">Property.</param>
        /// <param name="vm">View model of the property.</param>
        /// <returns>Label attribute value or empty string if not found.</returns>
        private static string GetLabelAttribute(this IReactiveProperty prop, IReactiveProperties vm)
        {
            var labelKey = nameof(TextFieldAttribute.Label);
            var attrs    = prop.GetAttributes(vm);

            return(attrs?.ContainsKey(labelKey) == true ? attrs[labelKey]?.ToString().TrimEnd(':') : string.Empty);
        }