Quantcast
Channel: Silverlight Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 801

Commented Issue: PhoneTextBox uses wrong brush with hint and empty text [9945]

$
0
0
Just create a PhoneTextBox with a Hint and you can see this when you start typing into an empty text box. The text is drawn with the hint brush, not the standard foreground brush. I've worked around this issue by adding a TextChanged listener and calling this code:

public static void OnPhoneTextBoxTextChanged(PhoneTextBox textBox)
{
if (!string.IsNullOrEmpty(textBox.Text))
{
Brush foregroundBrush = (Brush)Application.Current.Resources["PhoneTextBoxForegroundBrush"];
if (textBox.Foreground != foregroundBrush)
textBox.Foreground = foregroundBrush;
}
}

This is definitely a bug
Comments: ** Comment from web user: AlexSorokoletov **

Or fix that in template

<TextBlock x:Name="MeasurementTextBlock"
Margin="8"
IsHitTestVisible="False"
Opacity="0"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontStretch="{TemplateBinding FontStretch}"
TextAlignment="{TemplateBinding TextAlignment}"
FontWeight="{TemplateBinding FontWeight}"
FontStyle="{TemplateBinding FontStyle}"
TextWrapping="{TemplateBinding TextWrapping}"
----->>> Foreground={StaticResource PhoneTextBoxForegroundBrush}
Text="{TemplateBinding Text}" />


Viewing all articles
Browse latest Browse all 801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>