This is a migrated thread and some comments may be shown as answers.

Passwordbox inputscope suggestion

2 Answers 53 Views
PasswordBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Curtis
Top achievements
Rank 1
Curtis asked on 16 Dec 2014, 11:39 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 17 Dec 2014, 11:27 AM
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.

 
0
Curtis
Top achievements
Rank 1
answered on 17 Dec 2014, 11:36 AM
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();
        }
 
         
    }
Tags
PasswordBox
Asked by
Curtis
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Curtis
Top achievements
Rank 1
Share this question
or