windows phone - 文本框背景

Bip*_*Bip 3 .net c# textbox windows-phone-7

我有Textbox蓝色Background和白色Foreground.当输入文本时,我的整体Textbox变成白色,我无法看到我正在打字,因为我在白色背景上写白色字母.如何在写入蓝色时更改文本框的背景?

nkc*_*dra 6

GotFocus像这样将事件处理程序添加到TextBox.

private void TextBox_GotFocus(object sender, RoutedEventArgs e)
    {
        (sender as TextBox).Background = new SolidColorBrush(Colors.Blue);
    }
Run Code Online (Sandbox Code Playgroud)