2
votes

I'm trying to make my WP7 app work well on WP8 (by compiling it as a WP8 app).

In my app, I'm changing the PhoneAccentBrush's Color which seems to work fine still, however TextBox's in WP8 now seem to show a border around it when the textbox is in focus (this wasn't happening for me on WP7). This border seems to always use the System's accent color instead of using the changed color like every other control.

Any idea what's going on here and how to change it? The red accent (if that's what the user has chosen) really clashes with my app's colors!

1

1 Answers

3
votes

I would call overriding the accent color a hack. I would avoid setting the accent color and create a template for your textBlock.

Blend makes this very easy by allowing you to copy the default template and make changes to it.

Right Click the textBox in the Objects and Timeline pane, then select Edit Template -> Edit Current. Then select the States tab and select the Focused FocusState, then edit the border brush. Save and reuse the template as needed.

I did notice the textBox control template has changed in 8 and now defines the focus state border brush, although it does default to the PhoneAccentBrush.