diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Implementation/MaskedTextBox.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Implementation/MaskedTextBox.cs index 6dd0f035..a7171e7a 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Implementation/MaskedTextBox.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MaskedTextBox/Implementation/MaskedTextBox.cs @@ -334,8 +334,6 @@ namespace Microsoft.Windows.Controls }; } - #endregion //Private - private object ConvertTextToValue(string text) { object convertedValue = null; @@ -380,7 +378,7 @@ namespace Microsoft.Windows.Controls return MaskProvider.ToDisplayString(); } - protected void SyncTextAndValueProperties(DependencyProperty p, object newValue) + private void SyncTextAndValueProperties(DependencyProperty p, object newValue) { //prevents recursive syncing properties if (_isSyncingTextAndValueProperties) @@ -400,6 +398,23 @@ namespace Microsoft.Windows.Controls _isSyncingTextAndValueProperties = false; } + #endregion //Private + + #region Public + + /// + /// Attempts to set focus to this element. + /// + public new void Focus() + { + if (TextBox != null) + TextBox.Focus(); + else + base.Focus(); + } + + #endregion //Public + #endregion //Methods #region Commands