EditorType.Password

2 posts, 0 answers
  1. Andreas Decke
    Andreas Decke avatar
    29 posts
    Member since:
    Oct 2007

    Posted 02 Oct Link to this post

    Hello,

    I'm just about to replace my settings page with the DataForm. Unfortunately, I can not find an EditorType for a password! In the online documentation I find only one tip for iOS - but I need a tip (code) for Xamarin Forms.

    Thanks in advance
    Andreas

  2. Nikolay
    Admin
    Nikolay avatar
    37 posts

    Posted 03 Oct Link to this post

    Hello Andreas,

    Password editor is not exposed for the Xamarin.Forms DataForm. We've already logged this functionality as a feature request in our Ideas & Feedback portal - DataForm: Implement Password Editor. I suggest you follow the item in order to receive automatic notifications when some major updates are available.

    Meanwhile you can achieve this functionality for android and iOS by creating custom DataForm renderer. I'm posting simple implementation of CustomDataFormRenderer that should give you the desired result:

    iOS implementation:
    public class CustomDataFormRenderer : DataFormRenderer
    {
        protected override Type GetCustomEditorType(string propertyName, Type propertyType)
        {
            if (propertyName == "Password")
            {
                return typeof(TKDataFormPasswordEditor);
            }
     
            return base.GetCustomEditorType(propertyName, propertyType);
        }
    }



    Android implementation:
    public class CustomDataFormRenderer : DataFormRenderer
    {
        public CustomDataFormRenderer(Context context) : base(context)
        {
        }
     
        protected override EntityPropertyEditor GetCustomEditorForProperty(RadDataForm form, IEntityProperty nativeProperty, Telerik.XamarinForms.Input.DataForm.IEntityProperty property)
        {
            if (nativeProperty.Name() == "Password")
            {
                return new Com.Telerik.Widget.Dataform.Visualization.Editors.DataFormPasswordEditor(form, nativeProperty);
            }
     
            return base.GetCustomEditorForProperty(form, nativeProperty, property);
        }
    }


    I hope I've been helpful.

    Regards,
    Nikolay
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top