Go to content

Bulletcode.NET

Services

In order to use the built-in desktop services, call the RegisterDesktopServices() extension method of IServiceCollection:

services.RegisterDesktopServices();

The IListViewModelFactory service makes it possible to populate a list of drop-down items from a collection, enumeration or class constants. It contains the following methods:

  • GetItems() — returns a list of ListItemViewModel objects by retrieving the keys and names from the collection. An optional empty item, with null key and the specified name, can be also added.
  • GetEnumItems() — returns a list of ListItemViewModel objects representing the values and display names of the values of an enumeration type. It is similar to the GetEnumSelectList() method of the IHtmlHelper service available in web applications. An optional empty item can also be added.
  • GetConstItems() — returns a list of ListItemViewModel objects representing the values of all constants defined in a class. It is similar to the GetConstSelectList() extension method of the IHtmlHelper service (see MVC for more information). An optional empty item can also be added.