I have a custom control is named WatermarkPasswordBox and I want to add InputScope property for using numeric virtual keyboard in WinRT, Win8. But it's base class is not Textbox, it's base class is Control. How can I do it?
Thanks.
I have a custom control is named WatermarkPasswordBox and I want to add InputScope property for using numeric virtual keyboard in WinRT, Win8. But it's base class is not Textbox, it's base class is Control. How can I do it?
Thanks.
Copyright © 2021 Jogjafile Inc.
In WPF you could add an owner to the
InputScopeProperty. But, of course, we're not using WPF here. Even if that were available, I'm not sure it alone would solve your problem anyway.To answer your question:
InputScopePropertyon your customPasswordBox.TextBoxinto your custom control's control template.TemplateBindingto bind theTextBox'sInputScopeto your customInputScope.What's preventing you from deriving from
PasswordBox? Your customPasswordBoxshould serve its single, specific purpose so this is something to consider.