Visually Located


Give your lists the space they deserve

This blog serves as a public service announcement to give your ListBox, ListView, ItemsControl, whatever you choose the space that they deserve. I have seen a lot of apps (and often forget to do this myself!) that do not extend their lists all the way to the right of the page and keep the page too close to the bottom. It is easy to fall into this trap because of the defaults within Visual Studio. Take a look at the following examples: Notice that huge gap to the side? Now take a look at the settings apps Look mom! No gap! So what causes this gap? It’s the default template for pages in Visual Studio. When you create a new page for Windows Phone Silverlight apps you get the following <!--ContentPanel - place additional content here--> <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> </Grid> Notice the side margin of 12? This is a design guideline to leave the gap, but lists give you this b... [More]

Creating a behavior to capitalize text

Many apps get data that they show from services. These services generally have their data cased a certain way. If you want to navigate to a page to show data, you may want to have the title of the page be information from the service. The title portion of the page tells the user that this is the profile for Shawn Kendrot. The text for “Shawn Kendrot” came from the service and is cased in Title Case. But if you wanted to follow design guidelines (which are not a requirement), you may want the name to be all upper case. To accomplish this you have three options, convert the text when you download it, create a value converter, or create a behavior. The first is really not an option, because that means that you can no longer use that text for anything else. Value converters are nice, easy to use, and sometimes overused. Behaviors are nice because they can easily be used within the designer of Blend. If you are not familiar with Blend, you should find time to use it. It is the tool to ... [More]