Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toggle to include prompt on readonly #1342

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ public bool AllowPromptAsInput
SetValue( AllowPromptAsInputProperty, value );
}
}

public bool DisplayPromptCharactersOnReadOnly { get;set; }

private static void AllowPromptAsInputPropertyChangedCallback( object sender, DependencyPropertyChangedEventArgs e )
{
Expand Down Expand Up @@ -1915,7 +1917,7 @@ private string GetFormattedString( MaskedTextProvider provider, string text )
//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 );

Expand Down