I am developing a localized website and I need the breadcrumbs to be localizable too.
Usually when I write a localizable attribute I create a constructor with the type of Resources and a string that would be the key to search for. This is the same concept used, for example, by the DisplayAttribute in the COmponentModel namespace.
public class BreadcrumbAttribute(string titleKey, Type resourceType)
I tried to replicate the same operation by deriving a class from the BreadcrumbAttribute attribute but since the proprties are not virtual it is not possible for me to change the behavior in the correct way.
Suggestion
Make all properties in the BreadcrumbAttribute as virtualOR
Implements the localization pattern directly inside the library
I am developing a localized website and I need the breadcrumbs to be localizable too. Usually when I write a localizable attribute I create a constructor with the type of Resources and a string that would be the key to search for. This is the same concept used, for example, by the
DisplayAttribute
in the COmponentModel namespace.public class BreadcrumbAttribute(string titleKey, Type resourceType)
I tried to replicate the same operation by deriving a class from the
BreadcrumbAttribute
attribute but since the proprties are not virtual it is not possible for me to change the behavior in the correct way.Suggestion
Make all properties in the
BreadcrumbAttribute
asvirtual
OR Implements the localization pattern directly inside the library