Browse Source

Add toggle to include prompt on readonly

Added a bool property to display prompt characters when in a ReadOnly state. 
 - Note - 
If this is wrong in some way (guidelines) please contact me.
pull/1342/head
EpicKip 8 years ago
committed by GitHub
parent
commit
30959ea2f9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Implementation/MaskedTextBox.cs

4
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/MaskedTextBox/Implementation/MaskedTextBox.cs

@ -252,6 +252,8 @@ namespace Xceed.Wpf.Toolkit
SetValue( AllowPromptAsInputProperty, value );
}
}
public bool DisplayPromptCharactersOnReadOnly { get;set; }
private static void AllowPromptAsInputPropertyChangedCallback( object sender, DependencyPropertyChangedEventArgs e )
{
@ -1915,7 +1917,7 @@ namespace Xceed.Wpf.Toolkit
//System.Diagnostics.Debug.Assert( provider.EditPositionCount > 0 );
bool includePrompt = ( this.IsReadOnly ) ? false : ( !this.HidePromptOnLeave || this.IsFocused );
bool includePrompt = ( this.IsReadOnly && !this.DisplayPromptCharactersOnReadOnly ) ? false : ( !this.HidePromptOnLeave || this.IsFocused );
string displayString = provider.ToString( false, includePrompt, true, 0, m_maskedTextProvider.Length );

Loading…
Cancel
Save