I see your point and indeed I should confirm that by not knewing all details about your project Implicit Styles seemed like the best solution to me. Also I should confirm that migrating to implicit styles from StyleManager is not a smooth process and will require big timeframe on your side (having in mind how big your project is). And yes -- you are correct, I don't see point in migrating to implicit styles theming mechanism just to make your MaskedTextInput multiline.
Luckily I have a solution that will let you stick with the StyleManager theming mechanism and will make it possible to add the required properties to the MaskedInputTextBox PreviewInputTextBox. There's no need to retemplate nothing in XAML.
The solution I'm suggesting is to create a custom MaskedInputText control that inherits our RadMaskedInputText
control. The purpose is to override its OnApplyTemplate
method. This method's body makes it possible to traverse the control template and find the PreviewInputTextBox by its name when the template is loaded. Now you can add the properties that I previously described to make this TextBox appear multiline with vertical scrollviewer. Here's sample code snippet:
MultilineMaskedTextInput : RadMaskedTextInput
var previewInnerTextBox = Template.FindName(
previewInnerTextBox.TextWrapping = System.Windows.TextWrapping.Wrap;
Please don't forget to set the required DefaultStyleKey
for the custom control you are creating as described in our documentation
Let me know if you need any further assitance with this approach.
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer
and share your thoughts.