When designing a “You are here” icon for the map in ShopSavvy (download now on iPhone, Android and Windows Phone 7. It’s free and super awesome), I decided to try something a little different. Because ShopSavvy is a theme-compliant application, I thought it might be fun to have the “you are here” icon be representation of the user’s actual phone.
So I created a little XAML icon that is a very rough approximation of the front Windows Phone 7 screen. I used shapes and theme-variant brushes so that the icon changes to represent whatever theme the user has in place on their phone.
Because the the icon is so small (48-by-80 px), I used only basic shapes and one custom path shape to represent the “maps” application. I also did everything on a “Canvas” in order to try to trim off as much layout computation time as possible. You could make it with a Grid and then scale it to your heart’s content. Probably won’t make a huge difference, but I’m paranoid about resources in my phone apps these days.
Here are a couple examples of how the icon could look, depending on the user’s theme choice:
All from the same XAML.
For the ShopSavvy version, I put a tiny little ShopSavvy icon at the top. In the code below, I took it out so the top right-hand will simply be a blank box. Or you would put a tiny version of your own app icon there.
- <Microsoft_Phone_Controls_Maps:Pushpin>
- <Border BorderBrush="#FF9B9B9B" BorderThickness="1"
- HorizontalAlignment="Center" Height="80"
- VerticalAlignment="Center" Width="48"
- CornerRadius="4" Background="Black">
- <Canvas>
- <Ellipse Fill="#FFE4E4E4" Height="3"
- Stroke="Black" Width="3"
- StrokeThickness="0"
- Canvas.Top="71"
- Canvas.Left="6"/>
- <Ellipse Fill="#FFE4E4E4"
- Height="3" Stroke="Black"
- Width="3" StrokeThickness="0"
- Canvas.Top="71" Canvas.Left="22"/>
- <Ellipse Fill="#FFE4E4E4" Height="3"
- Stroke="Black" Width="3"
- StrokeThickness="0"
- Canvas.Top="71" Canvas.Left="37"/>
- <Rectangle Height="62" Canvas.Left="3"
- StrokeThickness="0" Canvas.Top="5"
- Width="40" RadiusX="1"
- RadiusY="1"
- Fill="{StaticResource PhoneBackgroundBrush}"/>
- <Rectangle Fill="{StaticResource PhoneAccentBrush}"
- Height="13" StrokeThickness="0"
- Width="13"
- Canvas.Left="7" Canvas.Top="9" />
- <Rectangle Fill="{StaticResource PhoneAccentBrush}"
- Height="13" StrokeThickness="0" Width="13"
- Canvas.Left="21" Canvas.Top="9" />
- <Rectangle Fill="{StaticResource PhoneAccentBrush}"
- Height="13" StrokeThickness="0" Width="13"
- Canvas.Left="7" Canvas.Top="23" />
- <Rectangle Fill="{StaticResource PhoneAccentBrush}"
- Height="13" StrokeThickness="0" Width="13"
- Canvas.Left="21" Canvas.Top="23" />
- <Rectangle Fill="{StaticResource PhoneAccentBrush}"
- Height="13" StrokeThickness="0" Width="27"
- Canvas.Left="7" Canvas.Top="37" />
- <Ellipse Height="3" Fill="{StaticResource PhoneForegroundBrush}"
- Stroke="Black" Width="3"
- StrokeThickness="0"
- Canvas.Top="10" Canvas.Left="37" />
- <Rectangle Fill="{StaticResource PhoneAccentBrush}"
- Height="13" StrokeThickness="0"
- Width="13" Canvas.Left="7" Canvas.Top="51" />
- <Rectangle Fill="{StaticResource PhoneAccentBrush}"
- Height="13" StrokeThickness="0"
- Width="13" Canvas.Left="21" Canvas.Top="51" />
- <Ellipse Fill="White" Height="7" Stroke="Black"
- StrokeThickness="0" Width="7"
- Canvas.Top="12" Canvas.Left="10"/>
- <Rectangle Fill="White" Height="5" Stroke="Black"
- StrokeThickness="0" Width="7"
- Canvas.Left="10" Canvas.Top="27"/>
- <Rectangle Fill="White" Height="5" Stroke="Black"
- StrokeThickness="0" Width="5"
- Canvas.Left="28" Canvas.Top="43"/>
- <Rectangle Fill="White" Height="2" Stroke="Black"
- StrokeThickness="0"
- Canvas.Left="21" Canvas.Top="46" Width="5"/>
- <Path Data="M226.1875,316.1875 L230.5,321.5 L232.75,322 L234.25,324 L235.5,325.5 L236.75,327.25 L238.875,328.375 L238.9375,316.125 z"
- Fill="White" Height="12.25"
- Stretch="Fill" Stroke="Black"
- StrokeThickness="0" UseLayoutRounding="False"
- Canvas.Left="21.2"
- Canvas.Top="51.1" Width="12.751"/>
- <Rectangle Fill="White" Stroke="Black"
- StrokeThickness="0" Width="7" Height="5"
- Canvas.Left="9" Canvas.Top="55"/>
- <Ellipse Fill="White" Height="6"
- Stroke="Black" StrokeThickness="0"
- Width="6" Canvas.Top="26" Canvas.Left="24"/>
- </Canvas>
- </Border>
- </Microsoft_Phone_Controls_Maps:Pushpin>
Not much. Just something fun that I thought might be fun to share