Facebook
Twitter
Pinterest
Tumblr
GitHub
RSS
  • DEV Home
  • Documentation
  • Reference
  • Download
Search Results for

    Show / Hide Table of Contents

    Features: Basic Input

    Element Names and Descriptions

    Most items can have a display name and a description which can be both specified via attributes:

    • @System.ComponentModel.DisplayNameAttribute
    • @System.ComponentModel.DescriptionAttribute
    [DisplayName("Name of the Demo")]
    [Description("Most items can have a display name and a description. This is the description text.")]
    public string DemoName { get; set; } = "GenericEdit Demo";
    

    Ui Feat1

    See also: Localization

    Automatic Display Name

    When no DisplayName atttribute is specified, a displayname will be generated from the property name by spliting the property name from capitalization.

    public string TextNoDisplayName { get; set; }
    

    Ui Feat1 Text No Displayname

    Hiding the Display Name

    To not show a display name, provide an empty string:

    [DisplayName("")]
    [Description("This property has an empty display name.")]
    public string TextWithEmptyDisplayName { get; set; }
    

    Ui Feat1 Text Empty Displayname

    Text Input

    Basic Text

    A string property will cause a simple text input to be generated.

    [DisplayName("Name of the Demo")]
    public string DemoName { get; set; }
    

    Ui Feat1 Text Basic

    Password

    Adding the IsPasswordAttribute to a string property will create a password input:

    [DisplayName("Password Field")]
    [Description("Just requires adding the IsPasswordAttribute to a string property.")]
    [IsPassword]
    public string PasswordValue { get; set; }
    

    Ui Feat1 Text Password

    Warning

    For security reasons, please avoid round-tripping passwords to the clients! Passwords should be replaced with something generic before transmitting the data to clients!

    Multi-Line Text

    Apply the EditMultilineAttribute to create multi-line text input:

    [DisplayName("Multiline Text")]
    [Description("Multiline text input can be enabled via attribute, which allows to specify the number of lines for the text area.")]
    [EditMultiline(4)]
    public string MultilineText { get; set; }
    

    Ui Feat1 Text Multiline

    Number Input

    Integer

    [DisplayName("Integer Value")]
    [Description("This is a normal int32 value. It is not possible to submit an empty value")]
    [Required]
    public int IntValue { get; set; } = 100;
    

    Ui Feat1 Numeric Int

    Nullable Integer

    [DisplayName("Nullable Integer Value")]
    [Description("The value can be deleted and submitted empty")]
    public int? IntValue2 { get; set; } = 100;
    

    Ui Feat1 Numeric Int Nullable

    Double

    [DisplayName("Double Value")]
    [Description("Float and double values are shown with 6 digits by default")]
    public double DoubleValue { get; set; } = 3.141592;
    

    Ui Feat1 Numeric Double

    Double with 2 Decimals

    With the DecimalsAttribute it is possible to control the number of decimals to display:

    [DisplayName("Double Value with 2 Decimals")]
    [Decimals(2)]
    [Description("The number of decimals can be controlled through the DecimalsAttribute.")]
    public double DoubleValue2 { get; set; } = 3.1;
    

    Ui Feat1 Numeric Double 2Dec

    Boolean Input

    Boolean Value

    Boolean properties are rendered as checkboxes:

    [DisplayName("Boolean Value")]
    [Description("Boolean properties are rendered as checkboxes.")]
    public bool BooleanValue { get; set; } = true;
    

    Ui Feat1 Boolean

    Nullable Boolean Value

    Nullable boolean properties are rendered as dropdowns including an empty item:

    [DisplayName("Nullable Boolean Value")]
    [Description("Nullable boolean properties are rendered as dropdowns.")]
    public bool? NullableBooleanValue { get; set; } = true;
    

    Ui Feat1 Boolean Nullable

    Nullable Boolean with Custom Text

    For nullable boolean properties, it is possible to control the display texts via attributes

    • TristateTrueTextAttribute
    • TristateFalseTextAttribute
    [DisplayName("Another Nullable Boolean Value")]
    [Description("For nullable boolean properties, it is possible to control the display texts via attributes")]
    [TristateTrueText("Yes, do it"), TristateFalseText("No, please don't")]
    public bool? NullableBooleanValue2 { get; set; } = true;
    

    Ui Feat1 Boolean Nullable Custom

    Date and Time Input

    Date Value

    [DisplayName("Date Value")]
    public DateTime DateValue { get; set; } = DateTime.Now;
    

    Ui Feat1 Date

    Note

    Support for input of time values or date+time values is planned to be added

    File and Folder Picking

    File Picker

    Add the EditFilePickerAttribute attribute to a string property to create a text box with file picker functionality.

    [DisplayName("File Picker")]
    [Description("Just add the EditFilePicker attribute to a string property.")]
    [EditFilePicker]
    public string FileValue { get; set; }
    

    Ui Feat1 File Picker

    Folder Picker

    Add the EditFolderPickerAttribute attribute to a string property to create a text box with file picker functionality.

    [DisplayName("Folder Picker")]
    [Description("Just add the EditFolderPicker attribute to a string property.")]
    [EditFolderPicker]
    public string FolderValue { get; set; }
    

    Ui Feat1 Folder Picker

    SDK
    On this Page
    Back to Top Copyright 2022 © EMBY LLC. Please see our terms of use and privacy policy.