Bill Reiss is a Windows Platform Development MVP and a Senior Consultant for AgileThought

Applying Styles to Windows Phone Text in Visual Studio 2012

I have no problem admitting when I’m wrong or stupid, and this may be one of those times where everyone else knew how this works except for me, but I’m posting about it in case anyone else out there had this issue. In Visual Studio 2010, you could click on the little peg next to the Style property in the Properties window for the selected TextBlock and get a list of available styles to choose from. I came to depend on this to choose the standard styles recommended for Windows Phone development.

When I first installed Visual Studio 2012 and the Windows Phone 8 SDK, I was surprised to see that none of the built in or locally defined styles show up for the Style property in the Properties window:

image 

I thought this was either a problem with my install, or something that would be fixed in a later release of Visual Studio 2012. Last week, Visual Studio 2012 Update 2 was officially released, and I looked again to see if the styles were showing up, and still no luck. This made me search the internet deeper and found out that the style picker still exists, it’s just moved, and it’s even better than the old one.

So how do you get to it? It’s actually easier. In the visual designer, just select the TextBlock you want to apply a style to, and right click. Then go to Edit Style and then Apply Resource. You should see something like the following:

image

Along with a nice visual preview of the style, you also can edit a copy of a style or create a new style. These tasks in the past were typically ones that you would have had to launch Blend in order to do easily, but now more of the Blend tasks have been brought into Visual Studio 2012. Hope this helps if you were as clueless as me in how to find how to set text styles.

  • http://www.robodance.com/ roschler

    Good tip Bill! I know the paranoia about missing something you think should be obvious. I spent the first 4 days working with the Windows Phone emulator, shutting down and restarting it every time I ran my app until I realized I didn’t have to do that. :)

  • http://twitter.com/CJLuddeni CJ Luddeni

    Thank you.

  • http://twitter.com/devfish Joe Healy (devfish)

    nice tip, I actually thought it was gone, and it was on my list of nasty things to send to the product team

  • http://www.robodance.com/ roschler

    I had a similar experience “re-discovering” the pre-defined brush styles under Local Brush Resources, I expected to find them in a more direct place under Appearance but there they were under Brush resources.