There are three List Content Properties (DropdownList, RadioButtonList & CheckboxList). These either take a manual key/value that the user can put in, or you can define your own IDataListSource which really opens up these editors.
publicinterfaceIDataListSource{ /// <summary> /// Name of the data list source /// </summary>string Name { get; } /// <summary> /// Description of the data list source. /// </summary>string Description { get; } /// <summary> /// Represents the Icon property of a data list source. /// </summary>string Icon { get; } /// <summary> /// The full name of the implemented data source class including namespace. /// </summary>string FullName { get; } /// <summary> /// Retrieves a list of items from a data source. /// </summary> /// <paramname="scope">The service scope used for dependency injection.</param> /// <paramname="currentContent">The current content object.</param> /// <returns>A collection of DataListItem objects.</returns>IEnumerable<DataListItem> GetItems(IServiceScope scope,Models.Content? currentContent);}
As you can see the GetItems returns a list of DataListItem which is a simple class which is esentially a key/value
publicclassDataListItem{publicstring Name { get; set; } =string.Empty;publicstring Value { get; set; } =string.Empty;}
As long as you can convert your data source into this format, there is really no limit to the sort of things you could make a data source. The example below show how to get a list of the available content views (This is actually used within the site on the content editor).
publicclassContentViewsDataSource(ExtensionManager extensionManager) :IDataListSource{publicstring Name =>"Content Views";publicstring Description =>"List of the available content views";publicstring Icon =>"tag";publicstring FullName =>GetType().FullName??string.Empty;publicIEnumerable<DataListItem> GetItems(IServiceScope scope,Content? currentContent) {var allContentViews =extensionManager.GetInstances<IContentView>(true);returnallContentViews.Values.Select(x => {var type =x.GetType();returnnewDataListItem { // Get the name of the component Name =type.Name, // Get the full name of the component Value =type.FullName! }; }) .OrderBy(x =>x.Name) .ToList(); }}