Passwordbox inputscope suggestion

3 posts, 1 answers
  1. Curtis
    Curtis avatar
    7 posts
    Member since:
    Jun 2011

    Posted 16 Dec 2014 Link to this post

    I could not find the property "inputscope" on the radpasswordbox like on the radtextbox. 
    The official passwordbox does not have the property too, but maybe it would be a nice addition to add it to the radpasswordbox so that the control can mimic the pincode inputscope keyboard layout you see for example at the lock screen. We would like to have that option rather then creating a custom new passwordbox control that can define the inputscope.
  2. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 17 Dec 2014 Link to this post

    Hello Curtis,

    We have considered such a property but due to platform limitation we haven't succeeded. As you have noticed the native PasswordBox doesn't have InputScope that we can use. Also we are not able to mimic
    such a property since the platform doesn't provide a way for us to show a custom keyboard manually. 

    Please, let me know should you have any other questions or suggestions.

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. Curtis
    Curtis avatar
    7 posts
    Member since:
    Jun 2011

    Posted 17 Dec 2014 Link to this post

    Thanks for your quick reply.

    We have found a workaround that works for us at the moment and maybe also for others. So we share the code:

    public class NumericPasswordBox : RadPasswordBox
        {
     
            private TextBox _passwordTextBox;
     
            public override void OnApplyTemplate()
            {
                base.OnApplyTemplate();
     
                _passwordTextBox = GetTemplatePart<TextBox>("PART_PasswordTextBox");
               
                var inputScope = new InputScope();
                inputScope.Names.Add(new InputScopeName
                {
                    NameValue = InputScopeNameValue.Number
                });
                _passwordTextBox.InputScope = inputScope;
            }
     
            protected override void OnGotFocus(RoutedEventArgs e)
            {
                base.OnGotFocus(e);
                _passwordTextBox.Focus();
            }
     
             
        }
Back to Top