private IReadOnlyDictionary <string, object> CalculateAdditionalAttributes() { var additionalAttributes = AdditionalAttributes?.ToDictionary(pair => pair.Key, pair => pair.Value) ?? new Dictionary <string, object>(); if (!additionalAttributes.ContainsKey(HtmlAttributeNames.CLASS)) { additionalAttributes.Add(HtmlAttributeNames.CLASS, string.Empty); } additionalAttributes[HtmlAttributeNames.CLASS] = CssBuilder .AddClass( additionalAttributes[HtmlAttributeNames.CLASS] as string, !string.IsNullOrWhiteSpace(additionalAttributes[HtmlAttributeNames.CLASS] as string)) .Build(); return(new ReadOnlyDictionary <string, object>(additionalAttributes)); }