Editor

in namespace DotVVM.AutoUI.Controls

Creates the editor for the specified property using the metadata information.

Usage & Scenarios

Generates an editor control for the specified property based on DotVVM Auto UI model metadata.

Sample 1: Basic Editor

The Property property is bound to the property in the viewmodel which shall be edited.

Because the property is of type string, the TextBox control will be used.

<auto:Editor Property="{value: FirstName}" />
public class ViewModel : DotvvmViewModelBase
{
    public string FirstName { get; set; }
}

Sample 2: Other Editor properties

The Changed event will be triggered when the user changes the value in the editor.

The Enabled property indicates whether the control will be editable or not.

Since the editors are bound to bool properties, the CheckBox controls will be generated.

<auto:Editor Property="{value: ConfirmOrder}" />

<auto:Editor Property="{value: AgreeWithConditions}" 
             Enabled="{value: ConfirmOrder}" 
             Changed="{command: OnAgreeChanged()}" />
public class ViewModel : DotvvmViewModelBase
{
    public bool AgreeWithConditions { get; set; }
    public bool ConfirmOrder { get; set; }

    public void OnAgreeChanged() 
    {
        // TODO
    }
}

Properties

Name Type Description Notes Default Value
property icon Enabled Boolean
attribute
inner element
static value
bindable
default
True
property icon OverrideTemplate ITemplate
attribute
inner element
static value
bindable
default
null
property icon Property IValueBinding
attribute
inner element
static value
bindable
default
null
property icon Visible Boolean Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control.
attribute
inner element
static value
bindable
default
True

Events

Name Type Description
event icon Changed ICommandBinding

HTML produced by the control