• Introduction
  • API Documentation
  • Sample Apps
  • GitHub

    Show / Hide Table of Contents
    • DynamicVML
      • AddNewDynamicItem
      • DynamicList<TViewModel, TOptions>
      • DynamicList<TViewModel>
      • DynamicListItem<TViewModel>
      • IDynamicList
      • IDynamicList<TValue>
      • IDynamicListItem
      • IDynamicListItem<TViewModel>
      • ListRenderMode
      • NewItemMethod
    • DynamicVML.Extensions
      • ControllerExtensions
      • EditorExtensions
      • EnumerableExtensions
      • ViewDataExtensions
    • DynamicVML.Internals
      • Constants
      • ItemDisplayParameters
      • ItemEditorParameters
      • ItemParameters
      • ListDisplayParameters
      • ListEditorParameters
      • ListParameters
      • Parameters
    • DynamicVML.Options
      • DynamicListAttribute
      • DynamicListDisplayOptions
      • DynamicListEditorOptions
      • DynamicListOptions

    Class DynamicListAttribute

    Represents an attribute which you can include in your view model's properties to indicate the property should be rendered as a Dynamic List. This class inherits from UIHintAttribute.

    Inheritance
    Object
    Attribute
    UIHintAttribute
    DynamicListAttribute
    Inherited Members
    UIHintAttribute.Equals(Object)
    UIHintAttribute.GetHashCode()
    UIHintAttribute.ControlParameters
    UIHintAttribute.PresentationLayer
    UIHintAttribute.UIHint
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, Boolean)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, Boolean)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, Boolean)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, Boolean)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, Boolean)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, Boolean)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, Boolean)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, Boolean)
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, Boolean)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, Boolean)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, Boolean)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, Boolean)
    Attribute.Match(Object)
    Attribute.TypeId
    Object.Equals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: DynamicVML.Options
    Assembly: DynamicVML.dll
    Syntax
    public class DynamicListAttribute : UIHintAttribute
    Remarks

    Instead of specifying each of your views to add the extra parameters to EditorFor(), you can alternatively configure the DynamicList properties of your view models directly in your view model class definition using this attribute:

    public class AuthorViewModel
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    
        [Display(Name = "Authored books")]
        [DynamicList("BookView", 
            ItemContainerTemplate = "MyCustomItemContainer", 
            ListTemplate = "MyCustomList",
            Method = RequestNewItemMethod.Post)]
        public virtual DynamicList<BookViewModel> Books { get; set; } = 
            new DynamicList<BookViewModel>();
    }
    Note

    While this is possible, this is not exactly recommended as one could argue that specifying view parameters in your view models may add unnecessary coupling between your code and the presentation layer. However, if you really want to specify parameters this way, the library will let you do so.

    Constructors

    | Improve this Doc View Source

    DynamicListAttribute(String)

    Initializes a new instance of the DynamicListAttribute class.

    Declaration
    public DynamicListAttribute(string listContainerTemplate = "DynamicListContainer")
    Parameters
    Type Name Description
    String listContainerTemplate

    The template for the list container. For more details about the different regions associated with a DynamicList<TViewModel, TOptions>, please EditorExtensions.

    Properties

    | Improve this Doc View Source

    ItemContainerTemplate

    Gets or sets the item container template to be used when displaying a list for this attribute. For more details about the different regions associated with a DynamicList<TViewModel, TOptions>, please EditorExtensions.

    Declaration
    public string ItemContainerTemplate { get; set; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    ItemTemplate

    Gets or sets the item template to be used when displaying a list for this attribute. This should normally be your view for the view models you are using. If you do not specify a view name, the library will attempt to find one based on your view model's class name. For more details about the different regions associated with a DynamicList<TViewModel, TOptions>, please EditorExtensions.

    Declaration
    public string ItemTemplate { get; set; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    ListContainerTemplate

    Gets or sets the list container template to be used when displaying a list for this attribute. For more details about the different regions associated with a DynamicList<TViewModel, TOptions>, please EditorExtensions.

    Declaration
    public string ListContainerTemplate { get; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    ListTemplate

    Gets or sets the list template to be used when displaying a list for this attribute. For more details about the different regions associated with a DynamicList<TViewModel, TOptions>, please EditorExtensions.

    Declaration
    public string ListTemplate { get; set; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    Method

    Gets or sets whether to use Get or Post when requesting new list items from the server. Default is to use Get.

    Declaration
    public NewItemMethod Method { get; set; }
    Property Value
    Type Description
    NewItemMethod
    | Improve this Doc View Source

    Mode

    Gets or sets whether the view for your viewmodel should receive a @model of type YourOptions<YourViewModel> or simply YourViewModel. Default is to use ViewModelOnly (so your view will receive just your view model, without its associated options object.

    Declaration
    public ListRenderMode Mode { get; set; }
    Property Value
    Type Description
    ListRenderMode

    Extension Methods

    EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, TOptions)
    EnumerableExtensions.ToDynamicList<TViewModel>(TViewModel, String)
    EnumerableExtensions.ToDynamicList<TViewModel, TOptions>(TViewModel, String, Func<TViewModel, TOptions>)
    EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TViewModel>, Func<TModel, TOptions>)
    EnumerableExtensions.ToDynamicList<TViewModel, TModel>(TModel, String, Func<TModel, TViewModel>)
    EnumerableExtensions.ToDynamicList<TViewModel, TOptions, TModel>(TModel, String, Func<TModel, TOptions>)

    See Also

    UIHintAttribute
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 César Roberto de Souza - All files are available under the MIT license except the logo, which comes from FontAwesome.