<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Jeff Wilcox » Silverlight</title>
	
	<link>http://www.jeff.wilcox.name</link>
	<description>Silverlight, rich client apps and web development</description>
	<lastBuildDate>Mon, 14 May 2012 04:24:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JeffWilcox/Silverlight" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="jeffwilcox/silverlight" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Updated Silverlight Unit Test Framework binaries–compatible with the Mango phone tools beta</title>
		<link>http://www.jeff.wilcox.name/2011/06/updated-ut-mango-bits/</link>
		<comments>http://www.jeff.wilcox.name/2011/06/updated-ut-mango-bits/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 20:38:07 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2011/06/updated-ut-mango-bits/</guid>
		<description><![CDATA[I took a few minutes today to build and share this updated set of assemblies that are Mango beta-compatible for phone developers. These can also be used with the RTM of phone, SL3, etc. There were some XAML syntax errors in code that was previously not exercised, oops. [ZIP, 518K] Silverlight Unit Test Framework Assemblies [...]]]></description>
			<content:encoded><![CDATA[<p>I took a few minutes today to build and share this updated set of assemblies that are Mango beta-compatible for phone developers. These can also be used with the RTM of phone, SL3, etc. There were some XAML syntax errors in code that was previously not exercised, oops.</p>
<p><a href="http://media.jeff.wilcox.name/blog/TestFx20110609.zip"><strong>[ZIP, 518K]</strong> Silverlight Unit Test Framework Assemblies compatible with Mango Beta Tools</a></p>
<p>I’ve enclosed the license file, too. Sorry it took so long to get out, Jon.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2011/06/updated-ut-mango-bits/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Jeff Wilcox’s “Metro” design guide for developers, v1.00</title>
		<link>http://www.jeff.wilcox.name/2011/03/metro-design-guide-v1/</link>
		<comments>http://www.jeff.wilcox.name/2011/03/metro-design-guide-v1/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 03:28:38 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2011/03/metro-design-guide-v1/</guid>
		<description><![CDATA[Here's my developer's guide to improving the design of your Windows Phone apps. Let's make our apps look great!]]></description>
			<content:encoded><![CDATA[<p>Let’s make our Windows Phone apps look great, ok?</p>
<p>I am not a designer. I am not a developer-designer. I am a developer and spend my days coding. But I love the concept of “metro” design and believe that it has the potential to bring a beautiful story to Windows Phone, and potentially millions of people. This is Microsoft moving beyond battleship grey buttons for its developer base, and all we need is just a little extra help to get there.</p>
<p>I don’t have a design background, my app is not the most beautiful app ever, but I’m fairly confident in what I would regard as a “80%-accurate” metro implementation. I’m trying to mimic the core Windows Phone operating system’s design, and in return users are getting a consistent interface, and one that respects their desires for how their phone should work.</p>
<p>Over time we can all work together to make all the apps beautiful by default, it doesn’t need to be a special exception to the rule.</p>
<p>If metro was inspired by transportation, just remember that there’s some awful looking transit out there. A few misaligned margins and your app’s going to look like a rusty bus. Just a little maintenance every time you create a page, check-in a page, or look over your app before submitting to the Windows Phone Marketplace will not only yield a good-looking app – but will probably get you some good recognition, too.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="bus1" border="0" alt="bus1" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/bus11.jpg" width="342" height="228" /><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="westminster1" border="0" alt="westminster1" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/westminster11.jpg" width="342" height="228" />    <br /><em>What sort of transportation best defines your metro-inspired app? Is it clean, functional?</em></p>
<p>This is my first attempt to share just a few things that I’ve learned while developing a few Windows Phone applications, as I feel that developers just love rules, so maybe having suggested rules will help. We love to fight about code style guidelines, and this whole “metro-design-thing” is really just more of that. Please, let’s get some comments flowing on the topic, start a discussion, and I hope to revise this kind of thing and publish again. I started this list in December and am very happy to share it!</p>
<p>I’m talking about</p>
<ul>
<li>simplicity</li>
<li>ease of use</li>
<li>discoverability</li>
<li>conformance</li>
<li>the right alignment &amp; spacing</li>
<li>using the proper styles</li>
<li>other random tips and suggestions</li>
</ul>
<p><a href="http://www.riagenic.com/">Scott Barnes</a> has previously covered a lot about <a href="http://www.riagenic.com/archives/493">the potential of metro for developers</a>, calling it the first real compromise between developers and designers. He goes on to say “Metro simply put feels like I am shoplifting design. It’s not a lot of work and the main focus I have is controlling myself from adding too many elements to the screen or keeping the typography unbalanced.”</p>
<p>I read that to mean “copy what the phone does! it is simple and works!” – I’m also focusing here just on the Windows Phone user interface, but it could apply more openly to other apps and platforms in some situations.</p>
<p>I created these tips while building <a href="http://www.4thandmayor.com/">4th &amp; Mayor</a>. It’s almost like a checklist, I s’pose. Originally ported from my OneNote notebook… and sorry, not enough visual examples.</p>
<h1>“Metro” rules for coders</h1>
<p>In no particular order…</p>
<h2>Metro 100</h2>
<h3>Resources and Styles exist for a reason</h3>
<p>The default Windows Phone styles exist to help you make your application fit in with the intended visual design and appeal of the Windows Phone. You should use styles with text, and consider using the static resources for margins, spacing, brushes, and more.</p>
<p>You’ll find the file with these special resources defined here on a 64-bit machine:</p>
<blockquote><p>C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Design\</p>
</blockquote>
<h3>Understand what margins you get with styles</h3>
<p>Styles may bring in a margin. If you have a StackPanel with both a text block and a button, you should have:</p>
<ul>
<li>The TextBlock requires a style such as PhoneTextNormalStyle or PhoneTextSmallStyle</li>
<li>The button has no style (the default style is already appropriately setup for use in all phone apps)</li>
</ul>
<p>If you do this properly,you will notice that the button and text are properly left-aligned.</p>
<p>If instead you just have a text block as-is, and a button, the text will be 12px to the left of the Button. That is not good at all! You want a visually straight line in your app on the left.</p>
<h2>Mind the gap: Alignment, spacing and margins</h2>
<h3>12px is the golden Windows Phone number</h3>
<p>Almost everything in the grid of the Windows Phone design system is pretty much 12px. Sometimes that means a margin of 12px, added to a container that is already left-aligned out by 12px, yielding a 24px actual visual amount of pixels – but it’s about 12px increments.</p>
<p>In some situations it may be appropriate to use 6px or 18px numbers (often when spacing text and other elements vertically), but try 12px first, it’s consistent and clear. The magic number of Windows Phone.</p>
<h3>Pages should align to the left, and a pivot header item should align down the left of the page</h3>
<p>Your page should have a nice, visually crisp line that is 24 pixels from the left of the device’s screen. It may be easiest to test for this while using the light theme on the phone. Pivot header items naturally should line up to the 24 pixel point, allowing for a quick and easy visual check. Don’t forget to check every single pivot item so that your UI is completely great.</p>
<p>Text that uses the proper styles should be aligned fine with other controls like the Button. Do not allow items to be indented by 12px, or back by 12px, the jagged line is not attractive and breaks the clean design line.</p>
<h3>ALIGNMENT IS KING</h3>
<p>Repeating… It is worth shouting out: alignment is one of the easiest ways to make your application look professional, easy to follow, and takes very little effort on the part of the developer. Align everything.</p>
<h3>Scrollbars are flush with the right of the device</h3>
<p>This means that often the margin of a ListBox may be “0,0,-12,0” – to offset the difference and allow the scroll viewer to be flush with the device. In some situations it may need to be –24px or 0px depending on the container and other situations.</p>
<h3>Text that does not fit should be clipped, flush to the right</h3>
<p>Unless you have a specific business reason to use ellipsis at the end of an item (which is not officially supported in Silverlight 3 and therefore the current Windows Phone release), just let content “clip” at the far right when it is longer than the device. Of course, wrapping has a place, so wrap if you don’t want the clip.</p>
<p>Don’t fade the “clip” at the end.</p>
<h2>Colors and brushes</h2>
<p>The static resources for colors and brushes exist for a reason, and should almost always be used.</p>
<h3>Avoid hard-coded colors</h3>
<p>Hard-coded colors introduce bugs and may affect marketplace ingestion in light or dark theme modes.</p>
<p>There are a few situations that may warrant a hard-coded background color when the color is the same in the light and dark themes, as well as a situation where a fixed foreground of white may be acceptable – in a long list selector’s group header, for example, when the background is the phone accent brush.</p>
<h3>Accent colors were built to be used and respected</h3>
<p>Respect your users. Honor their accent color choices by using that color for important user interface elements that indicate touchable elements, actionable information, headings, errors, etc.</p>
<h3>Use accents sparingly and mostly for emphasis</h3>
<p>Accent colors should be used to differentiate content but not to confuse the user. A good data-heavy example application is the people hub in the Windows Phone – open any person’s information up and see how it presents the headings and text for items such as phone numbers and e-mail addresses.</p>
<h3>Use the light theme often</h3>
<p>Dedicate at least one day a week to using your application, both in the emulator and on the device, in the light theme.</p>
<h3>Change accent colors as often as you change your t-shirt</h3>
<p>You want to make sure that you are using and respecting the user’s personalization choice for their device. They’ve made it yours, and now you have the option to make your app personal to them, too.</p>
<h3>Tread carefully with branding</h3>
<p>A brand and its coloring is important, but consider that not all users will want to have the brand’s colors and experience oozing from every corner of your application. A simple logo or small amount of contrast in the user interface, centered around the brand, may be enough – coupled with respecting a user’s phone light/dark theme and accent color choice.</p>
<h3>Beware the pains of light-only and inverse theming</h3>
<p>If you want to go for the light-forced experience like the Mail app, you might find that it’s a big challenge. Having to retemplate controls, templates, styles, and so on, it’s a big challenge, and easy to get wrong.</p>
<h2>Text</h2>
<p>Text is a super-important part of metro. Love text. And love Segoe WP!</p>
<h3>Always use a text style</h3>
<p>They exist for a reason. They give you the phone margins of 12px on the left horizontal, so you want that. Without it, you will have misaligned visuals.</p>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/PhoneTextStyles.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="PhoneTextStyles" border="0" alt="PhoneTextStyles" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/PhoneTextStyles_thumb.png" width="685" height="140" /></a></p>
<p>So this is the <strong>GOOD</strong> text example:</p>
<blockquote><pre>&lt;TextBlock Text=&quot;Good Text&quot; Style=&quot;{StaticResource PhoneTextNormalStyle}&quot;/&gt;
&lt;Button Content=&quot;text&quot;/&gt;</pre>
</blockquote>
<h3>Use PhoneTextNormalStyle often.</h3>
<p>It’s a pretty easy-to-read style and should be the default for most UI.</p>
<h3>Use PhoneTextLargeStyle occasionally.</h3>
<p>It’s good to use for special visuals like groups, important instructions, and some UI features (such as loading text). Often this is combined with a PhoneAccentBrush on the foreground for even more visual distinction, especially if the item can be interacted with.</p>
<h3>Use PhoneTextSmallStyle sparingly.</h3>
<p>For small text, such as detailed info or legalease, it might be a good fit. Otherwise it is often too small for many users to easily read and digest.</p>
<h3>Do not hard-code font size, font family, or other properties</h3>
<p>You should not have hard-coded font sizes or families, unless you are using the static resources to make a specific change to text. (It is o.k. to reference the PhoneFontFamilySemiLight and PhoneFontFamilySemiBold resources, for example, but not to FontSize=”16.667”.</p>
<h3>Do not use raw text blocks (without a style)</h3>
<p>A text block without a style is a bug with the small exception of including a hard-coded margin of 12 on the left. It may be acceptable to achieve a desired look to have a margin such as “12,18,0,6”, for example, but in most situations this is easier to accomplish by using a style such as {StaticResource PhoneTextLargeStyle} and then just overriding the Margin value.</p>
<h3>Text boxes and password boxes should be watermarked text boxes</h3>
<p>Although not built into the phone, you will have a more beautiful UI if you use watermarked text boxes and password boxes instead of field labels and then the text box.</p>
<h3>Evaluate every text block for its wrapping potential</h3>
<p>Every single TextBlock instance needs to be evaluated for the need for wrapping content. Descriptions, important titles and place names, etc. should probably have a wrapping experience and not clip. Don’t forget to think about pivot titles, either, which may need a wrapping title.</p>
<h3>Text boxes should tombstone nicely</h3>
<p>Remember to tombstone the contents of a text box. You can do better by also storing selection information or other important properties. In some situations, you may even want a tombstoning text box to record its focus information, so that when the app activates again, you can even have the software keyboard open (text box focused).</p>
<h2>Hyperlink Buttons</h2>
<p>They can be difficult to touch accurately, especially the default template, and when in a big list of other hyperlink buttons. Be careful.</p>
<h3>Double-check target names for web addresses</h3>
<p>It can be very time-consuming to test every single hyperlink in an application for its behavior. To avoid unknown or unexpected crashes, if using an absolute URI (such as a web site or address), check that the TargetName is something such as “_self” or “_new” to enforce the browser opening.</p>
<h3>Consider re-templating for additional touch target space</h3>
<p>You may want to use negative margins or other tricks to give hyperlink buttons just a little extra space (such as 6px top and bottom) to still have a clear appearance but to allow for more touch target space.</p>
<h2>Images</h2>
<h3>Large image thumbnails look wonderful.</h3>
<p>Instead of sticking with the small thumbnail experience often used in other platforms, think about having beautiful, large images within a wrap panel. You will have a nice-looking UI if you have 200x200px images, for example:</p>
<p><img src="http://d2tz2ccf2zi8lx.cloudfront.net/media/si/4am_pics.png" /></p>
<h3>Full-bleed images have a place</h3>
<p>There are situations where a full-bleed photo, image, or user interface element is appropriate, will look great, and give users maximum screen real estate for the bleed item (item that goes to the edge of the device’s screen).</p>
<p>For example, here is a static map that bleeds to the edge of the screen:</p>
<p><img src="http://d2tz2ccf2zi8lx.cloudfront.net/media/si/4am1.png" /></p>
<h3>Link images to a large image viewer</h3>
<p>It is a nice courtesy to have image thumbnails actually be buttons that move to a full-screen photo/image exploration environment. Whether that environment just shows the picture (in any orientation), or goes above-and-beyond to also do pinch &amp; zoom, is an exercise left up for the bored developer.</p>
<h2>Scrolling &amp; Touch</h2>
<h3>Always check the light theme and look for your scroll bars</h3>
<p>A very common mistake for developers who override the theme to be light (to mimic the behavior of the official Mail app for Windows Phone) is to not re-template the scroll bars throughout the application. This is difficult, as it may require retemplating scroll bars, scroll viewers, list boxes, and more.</p>
<p>If you simply change a background color, and do not retemplate the scroll bar, you’ll usually see no scroll bar at all – it’s a white-colored object on top of a white background, and not so useful!</p>
<h3>Scrollbars are flush with the right of the device</h3>
<p>A repeat, but worth it: even the official Twitter app for the Windows Phone got this design nit-pic wrong, and scrolling feels disconnected as a result. The –12px margin is your friend.</p>
<h3>You may have 6-12px too many at the top of a list</h3>
<p>In some situations, your scrolling containers, items, or other elements may in fact be 6px or 12px too low. To ensure the proper alignment, touch the scroll viewer and move your first up just a very slight amount. Your object should immediately start to get clipped, indicating that it was properly positioned at the very top of your scroll viewer.</p>
<p>You might need to use a negative top margin of -6px or –12px to fix this small thing.</p>
<h3>Remember to pad the bottom of scroll viewers or ListBoxes</h3>
<p>If you have item templates or others that do not include a bottom margin, it may be possible for your list to end with the very bottom of the content being flush against the bottom of the phone (or the application bar, or other visual underneath). This often is not a visually appealing thing, so you might need to add a bottom margin of 12px to the template or container.</p>
<h3>Tombstone scroll viewers to be nice to your users</h3>
<p>Users expect that if they leave your app, have scrolled down a list, and come back, that it is restored in the same position. It takes more work as a developer, but really shows off the polish your app can have.</p>
<h3>Bounce the touch screen often</h3>
<p>You should always be touching your screen. Even when nothing looks actionable. Almost everything needs to be contained in a ScrollViewer, even if it is a simple page. Here’s why:</p>
<ul>
<li>Landscape pages are difficult and annoying if nothing scrolls!</li>
<li>If the software keyboard opens up, it will want to use the scroll viewer to adjust the viewport just right.</li>
<li>Many users expect the main content of any page to have an associated bounce effect.</li>
<li>Including a scroll viewer will make sure that landscape mode or re-using components in other amounts of screen real-estate will still yield a usable result.</li>
</ul>
<h2>System Tray</h2>
<h3>Please have a system tray on most pages.</h3>
<p>I personally expect to have the system tray available at almost any time. When I am running an app, I really do want to know the time, battery life, if I’m on 3G, etc. Please keep the system tray on pages that you create. Even if it means there’s a little visual glitch / gap at the top where you cannot control the color of the system tray. It’s worth it from a functionality standpoint, I believe.</p>
<h2>Application Bar</h2>
<h3>Favor 3 menu items in an application bar (or 5) if any</h3>
<p>The application bar moves to a specific size depending on the number of menu items in it. If you have 4 items, it will show the size for 5 – so visually it may not look quite right. Try optimizing for 3 or 5 menu items if you can for the best, tightest look.</p>
<h3>Consider making the app bar transparent on photo pages when there’s a menu of choices</h3>
<p>There are situations where an Opacity=0 app bar is the right call, leaving just the ellipsis for the user to touch to get to menu items. If you don’t have any icons, consider it, but keep it consistent.</p>
<h2>Every page in your app</h2>
<p>Take the time to double-check every page, no matter how minor, so that you can ensure integrity in design and a consistent experience for your users. This is about XAML and not visual design as much.</p>
<h3>Page Orientation</h3>
<p>Be consistent, and consider allowing every single page in your app to be viewed in both Portrait and Landscape, with the exception of Pano.</p>
<h3>Panorama pages should only use the Portrait orientation</h3>
<p>Due to the large title font size of a panorama (hub), such experiences should only be contained within a Portrait-designated page.</p>
<h3>Tilt Effect</h3>
<p>Be consistent if using the tilt effect attached property by including it at the top of every page in the app.</p>
<h3>Toolkit Transitions</h3>
<p>If using the transitions from the Silverlight for Windows Phone Toolkit, remember to audit all of your pages for the transition service being set. By default no transition service data means no transitions for any page lacking this data.</p>
<h3>Consistent XAML XML namespaces</h3>
<p>For your own sanity, and that of your team, consider using a standard set of XMLNS names that you can include in the top of pages. Wavering or changing them per-page may yield to difficult to understand XAML when comparing across the app, or working with designers.</p>
<h3>Avoid per-page progress bar experiences</h3>
<p>It is often easier to have a single performance progress bar instance in the frame of the app, binding it to your data model’s loading events. This reduces the overhead of many progress bars, and is easier to hook up for automatic load detection and notification.</p>
<h3>Avoid popups {a performance tip, not a design thing}</h3>
<p>The popup control in Windows Phone can have negative performance implications, not allowing its members to be properly accelerated. Consider using a trick method where your frame contains an overlaying Grid instead of a Popup control.</p>
<h2>Panorama / Hub Experiences</h2>
<h3>Hubs should be like a magazine cover.</h3>
<p>Keep it simple, engaging, users must click something to go to a sub-page.</p>
<h3>Consider a pivot control instead.</h3>
<p>Panorama is a “hot” and popular control to offer that hub experience in any app, but it can be overused. Consider whether a pivot control may be more appropriate.</p>
<h3>Whitespace is wonderful.</h3>
<p>Help the user to focus on just what is important. Do this by minimizing the number of things to distract them: less text, less crazy pictures, just a few simple things. It will go a long way.</p>
<h3>Interactive controls don’t usually belong on a panorama page.</h3>
<p>If you start seeing buttons, text boxes, password boxes, check boxes, or other multiple control types in a panorama item, re-think whether it’s a magazine <em>cover</em> at that point, and perhaps redesign your app’s experience.</p>
<h3>Use at least 3 panorama items in a pano.</h3>
<p>If you use only 2 panorama items, you will not get the appropriate visual mirroring, and may see visual glitches. 1 panorama item is not supported. So, start with 3, and try not to have many more than that at all.</p>
<h2>Pivot Control and Pivot Items</h2>
<h3>No more than 7 items please.</h3>
<p>It’s a general guideline (I believe from the official UI guide) that 7 items is the max. But that doesn’t mean you should always use 7 pivot items in a pivot control!</p>
<h3>Pivot item margins may need to be altered in some situations.</h3>
<p>In some advanced scenarios, it is appropriate to set the pivot item margin values. Examples include edge-bleed images and multi-select controls on the Windows Phone (such as the Mail application). Building such a control is another challenge but it will be clipped if the pivot item is smaller than the edges.</p>
<h3>Consider a new page instead of a new pivot item.</h3>
<p>When adding a new item or data type to a pivot page, think long and hard about whether it’s an appropriate additional as yet another pivot item. For less-used data and information, perhaps a link to a new page with that content may be more appropriate. It will also yield better performance, having less in the visual tree, a quicker startup time, etc.</p>
<h3>Always restore the right pivot item when tombstoning.</h3>
<p>As a courtesy, a polished app should store the pivot item you were on and when you come back, make sure you’re looking at the same thing.</p>
<h2>Using the correct language/wording for your users</h2>
<p>You want to maintain a simple, friendly, friendly voice in your application. More is available in the <a href="http://go.microsoft.com/fwlink/?LinkID=183218">UI Design and Interaction Guide for Windows Phone 7</a>.</p>
<h2>App polish</h2>
<h3>You need a basic but slick about page.</h3>
<p>All great apps should have an about page, to offer information about the developer (or company). Though the marketplace guidelines no longer require it, do consider offering support contact information, a feedback link, and links to privacy policies and other guidelines as appropriate.</p>
<p>The about page should be easy to locate in your app, not hidden away too much.</p>
<h3>Consider including legal notices.</h3>
<p>Consider including the text of legal notices for components that you’re using in your application. This helps give credit to the components that make your application possible, credit the authors with a little pride, and helps protect your application as appropriate by complying with any license terms.</p>
<h3>Message boxes: throttling</h3>
<p>If you display a message box to your users (especially for errors or notices), consider using a throttling mechanism to limit the number of message boxes per minute that might appear.</p>
<h3>Message boxes: consider custom buttons</h3>
<p>Consider building your own message box look-alike to offer buttons with actionable text (such as “delete file” instead of “ok”).</p>
<h3>Message boxes: consider a checkbox to stop the reminder type</h3>
<p>If you add a reminder for your users to go to a meeting, or to review your app, or to purchase your trial app, consider adding a check-box to a custom message box-looking popup, allowing the user the stop the type of notification in the future. The flag is an easy true/false value to store in your app settings.</p>
<h3>Phone numbers</h3>
<p>Always display a phone number in a hyperlink button when possible, linking that action to make a phone call. You may need to extend or use custom helpers to get the right behavior.</p>
<h3>Consider “random witty banter”</h3>
<p>A fun experience app developers often use is that of “witty banter”: that is, friendly headings or text that often change randomly. For example, by having a library of sample text, you can offer watermarked text box that has a watermark that says “search for pizza”, and sometimes “search for Italian”, making the experience a little more fun, friendly, and engaging for the user.</p>
<p>This also helps remove boredom: a user likes to see their apps come alive, and fixed, static text, is never that much fun.</p>
<h2>Getting the reviews you deserve</h2>
<p>I hope these tips help you. Often all people want to know is how to improve the perf of their apps, and though important, a lot of an app’s review is about perception as well, granted you have your functionality down pat. As of 3/24 my app is currently the #1 free app in the <a href="http://www.bing.com/browse?g=wp7&amp;qpvt=top+windows+phone+7+apps&amp;FORM=SGEWEB#toc=1">Windows Phone Marketplace by rating</a>, skyrocketing to the top – and those 5 stars often are attributed in reviews to some semblance of an emphasis on the metro design. Sample 5-stars:</p>
<blockquote>
<p>“UI is well-designed!”</p>
<p>“Simply irresistible”</p>
<p>“Optimized for WP7, Metro UI, and fast”</p>
<p>“Excellent app very well done uses the metro design language beautifully <img src='http://www.jeff.wilcox.name/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ”</p>
<p>“Shows how easy and beautiful a WP7 app can be.”</p>
<p>“Simply, this is how WP7 apps should all look.”</p>
<p>“Wow, you’ve encouraged me to go out and look into building my own metro WP7 app!”</p>
</blockquote>
<p>This makes me think, we can all do so well. Enjoy the tips, I hope they are useful. And tell me when I’m wrong! Let’s get those 3-star apps up to 4-star, and so on, thanks to more consistent design. And remember to mind your margins – all 12px of it when appropriate for alignment.</p>
<p>Hope this helps. <em>Photo credits: </em><a href="http://www.flickr.com/photos/davidesimonetti/2493540940/"><em>Westminster Tube ‘06</em></a><em> by Davide Simonetti and <a href="http://www.flickr.com/photos/bmaas/126385859/">Old Bus</a> by Barry Maas.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2011/03/metro-design-guide-v1/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Windows Phone, a great dev platform: adding leaderboards to 4th &amp; Mayor in 30 minutes</title>
		<link>http://www.jeff.wilcox.name/2011/03/4am-leaderboard-notification/</link>
		<comments>http://www.jeff.wilcox.name/2011/03/4am-leaderboard-notification/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 03:07:48 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2011/03/4am-leaderboard-notification/</guid>
		<description><![CDATA[Just over a week ago, a new foursquare feature was released for nice leaderboards. WP7 is fast - I added the feature in about 30 minutes.]]></description>
			<content:encoded><![CDATA[<p>It’s just amazing how efficient the Windows Phone (powered by Silverlight) dev environment can be. I’m a little biased here (yeah yeah I work on the team), but wanted to start of my app development series with a short example of just how quickly the platform can enable rapid changes and innovation.</p>
<p>At SXSW a little over a week ago, foursquare introduced the new ‘<a href="http://blog.foursquare.com/2011/03/08/foursquare-3/">fsq3</a>’ version of their apps for iPhone, Android, and I believe eventually Blackberry, too, though not initially. Foursquare has always been about a fun time, exploring the city as part of a massive, worldwide-game, and so they did some nice work in version 3 to bring in a little more fun: every time you check-in to a place, there’s a leaderboard (relative to all of your friends) that appears, showing your latest scores and your close competition.</p>
<p>It took about 30 minutes to add this feature to my foursquare app, sadly this blog post will probably take 60 minutes to prepare.</p>
<p>The steps really are:</p>
<ul>
<li>Parsing the JSON of the added data</li>
<li>Creating a new data/model item</li>
<li>Designing and creating new XAML templates for presenting the data</li>
<li>Updating the data template selector for the added notification type</li>
<li>Binding the data and making the magic happen</li>
</ul>
<p>Here’s what it looks like on an iPhone – the new “Leaderboard” section is of interest. Interestingly, the Android app for foursquare is pretty much a clone of the iPhone app… so no need to really highlight that.</p>
<p><img src="http://d2tz2ccf2zi8lx.cloudfront.net/media/posts/leaderboardInResults.png" /></p>
<p>The way that this is implemented on the foursquare service side is a simple new “notification” type that comes in after a check-in or other action. When working with services like this, as a developer it’s more important than ever to be resilient against “invalid” or unknown data and types – lots of null checks, default handling clauses, etc. So foursquare added a new <em>leaderboard</em> notification type to the others (such as mayor status, a recommended tip at a place, etc.)</p>
<p>The code I wrote to handle notifications started with a simple set of parsing methods. Notifications can actually come from any foursquare web request, but typically it’s just when you check-in. I use (and absolute love!) <a href="http://json.codeplex.com/">JSON.NET</a> by James Newton-King &#8211; the LINQ to JSON stuff is nice, and it’s a lot better than the JSON stuff built into the platform.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:3636f1cf-0285-4a90-aa71-9cc2aa386cff" class="wlWriterEditableSmartContent">
<pre class="csharp" name="code">// Notifications is a List&lt;Notification&gt;
public static Notifications ParseJson(JToken json, string venueId)
{
    var ns = new Notifications();

    foreach (var notif in json)
    {
        Notification notification = Notification.ParseJson(notif, venueId);
        if (notification != null)
        {
            ns.Add(notification);
        }
    }

    return ns;
}

public static Notification ParseJson(JToken notification, string venueId)
{
    Notification n = null;

    string type = Checkin.TryGetJsonProperty(notification, "type");
    var item = notification["item"];
    if (item != null)
    {
        switch (type)
        {
            case "message":
                n = new MessageNotification(item);
                break;

            case "badge":
                n = new BadgeNotification(item);
                break;

            case "mayorship":
                n = new MayorshipNotification(item);
                break;

            case "tip":
                n = new RecommendedTipNotification(item);
                break;

            case "leaderboard":
                n = new LeaderboardNotification(item);
                break;

            case "special":
                n = new SpecialNotification(item, venueId);
                break;

            case "score":
                n = new ScoreNotification(item);
                break;

            default:
                var hasMessage = item["message"];
                if (hasMessage != null)
                {
                    n = new MessageNotification(item);
                }

                break;
        }
    }

    return n;
}

namespace JeffWilcox.FourthAndMayor.Model
{
    public class LeaderboardNotification : Notification
    {
        public string Message { get; private set; }

        public List&lt;LeaderboardItem&gt; Leaderboard { get; private set; }

        public LeaderboardNotification(JToken item)
        {
            Message = Checkin.SanitizeString(Checkin.TryGetJsonProperty(item, "message"));

            var leaders = new List&lt;LeaderboardItem&gt;();
            var lj = item["leaderboard"];
            if (lj != null)
            {
                foreach (var victor in lj)
                {
                    var wolverine = LeaderboardItem.ParseJson(victor);
                    if (wolverine != null)
                    {
                        leaders.Add(wolverine);
                    }
                }
            }

            Leaderboard = leaders;
        }
    }
}</pre>
</div>
<p>And then a switch to handle known notification types and create data model objects from that. This yields a nice strongly typed data object – I personally prefer this to just storing the JSON tree live, or using a property bag, but everyone has their own opinions. Strong typing makes data binding in Silverlight super easy.</p>
<p>The JSON from foursquare looks a lot like this:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:13c02a2f-e8e1-46bf-aa3e-5eba88c5a2b7" class="wlWriterEditableSmartContent">
<pre class="jscript" name="code">{
"type": "mayorship",
"item": {
  "type": "nochange",
  "checkins": 27,
  "message": "You're still the Mayor of Boka Kitchen &#038; Bar! (27 check-ins in the past two months)",
  "image": "http://foursquare.com/img/crown.png"
}
},
{
"type": "leaderboard",
"item": {
  "leaderboard": [
	{
	  "user": {
		"id": "4052351",
		"firstName": "Gilles",
		"lastName": "K",
		"photo": "https://playfoursquare.s3.amazonaws.com/userpix_thumbs/FXM5YX5ABXZARAR1.png",
		"gender": "male",
		"homeCity": "WA",
		"relationship": "friend"
	  },
	  "scores": {
		"recent": 120,
		"max": 127,
		"checkinsCount": 31
	  },
	  "rank": 1
	},
	{
	  "user": {
		"id": "20057",
		"firstName": "Jeff",
		"lastName": "W",
		"photo": "https://playfoursquare.s3.amazonaws.com/userpix_thumbs/RRJIFN1NATUHRN4J.jpg",
		"gender": "male",
		"homeCity": "Seattle, WA",
		"relationship": "self"
	  },
	  "scores": {
		"recent": 117,
		"max": 124,
		"checkinsCount": 49
	  },
	  "rank": 2
	},
	{
	  "user": {
		"id": "130986",
		"firstName": "Tim",
		"lastName": "H",
		"photo": "https://playfoursquare.s3.amazonaws.com/userpix_thumbs/4A52T22PCNGR11EM.jpg",
		"gender": "male",
		"homeCity": "WA",
		"relationship": "friend"
	  },
	  "scores": {
		"recent": 116,
		"max": 125,
		"checkinsCount": 41
	  },
	  "rank": 3
	}
  ],
  "message": "You jumped ahead of Tim!",
  "scores": [
	{
	  "points": 3,
	  "icon": "https://playfoursquare.s3.amazonaws.com/static/img/points/mayor.png",
	  "message": "You're the Mayor!"
	}
  ],
  "total": 3
}
},</pre>
</div>
<p>And so at runtime, when you check-in, you’ll end up with this return result being stored. Since I’ve already coded in my app simple parsing methods for CompactUsers, it’s easy to work with this rich hierarchical data.</p>
<p>In my checkin (“what’s new”) window of <a href="http://www.4thandmayor.com/">4th &amp; Mayor</a> I’ve a very simple items control that is used to expand at runtime the data objects into a nice visual presentation. Now in Silverlight 3 (the version that was forked for Windows Phone initially) there isn’t a way to have implicit “data templates” that key off of type, so I did have to do a little hacking. But this is super easy.</p>
<p>Here’s my data template selector that I wrote as a value converter. I expose public properties of type DataTemplate:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:d523f33d-ef72-47f7-bfa5-d37000efafed" class="wlWriterEditableSmartContent">
<pre class="csharp" name="code">namespace JeffWilcox.FourthAndMayor.Converters
{
    public class NotificationDataTemplateSelector : IValueConverter
    {
        public DataTemplate MessageTemplate { get; set; }
        public DataTemplate MayorTemplate { get; set; }
        public DataTemplate BadgeTemplate { get; set; }
        public DataTemplate TipTemplate { get; set; }
        public DataTemplate ScoreTemplate { get; set; }
        public DataTemplate SpecialTemplate { get; set; }
        public DataTemplate LeaderboardTemplate { get; set; }

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ScoreNotification sn = value as ScoreNotification;
            if (sn != null)
            {
                return ScoreTemplate;
            }

            BadgeNotification bn = value as BadgeNotification;
            if (bn != null)
            {
                return BadgeTemplate;
            }

            MayorshipNotification mn = value as MayorshipNotification;
            if (mn != null)
            {
                return MayorTemplate;
            }

            LeaderboardNotification ln = value as LeaderboardNotification;
            if (ln != null)
            {
                return LeaderboardTemplate;
            }

            RecommendedTipNotification tip = value as RecommendedTipNotification;
            if (tip != null)
            {
                return TipTemplate;
            }

            MessageNotification msg = value as MessageNotification;
            if (msg != null)
            {
                return MessageTemplate;
            }

            var special = value as SpecialNotification;
            if (special != null)
            {
                return SpecialTemplate;
            }

            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}</pre>
</div>
<p>And then on my check-in page, in the page’s resources, I define the individual data templates that I would like different notification data objects to appear as. XAML is pretty verbose but wow, powerful. I hand-edited many of my data templates. And I’m picky, I prefer one attribute per line in most situations – it makes diffs in source control a lot easier to understand and work with, especially while integrating.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:83ca7e7a-1eca-40ec-a2f1-96f251a7df9a" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;DataTemplate x:Key="Leaderboard"&gt;
    &lt;StackPanel&gt;
		&lt;ContentPresenter Content="Leaderboard"
		                  ContentTemplate="{StaticResource GroupHeader}"/&gt;
        &lt;TextBlock
            Text="{Binding Message}"
            TextWrapping="Wrap"
            Margin="0,0,0,12"
            Style="{StaticResource PhoneTextNormalStyle}"/&gt;
        &lt;ItemsControl ItemsSource="{Binding Leaderboard}"&gt;
            &lt;ItemsControl.ItemTemplate&gt;
                &lt;DataTemplate&gt;
                    &lt;HyperlinkButton Style="{StaticResource NoHyperlink}"
                                HorizontalAlignment="Stretch"
                                HorizontalContentAlignment="Stretch"
                                NavigateUri="{Binding User.UserUri}"&gt;
                        &lt;Grid Margin="0,0,0,12"&gt;
                            &lt;Grid.ColumnDefinitions&gt;
                                &lt;ColumnDefinition Width="72"/&gt;
                                &lt;ColumnDefinition /&gt;
                                &lt;ColumnDefinition Width="88"/&gt;
                            &lt;/Grid.ColumnDefinitions&gt;
                            &lt;Grid Grid.Column="0"&gt;
                                &lt;Grid
                                    Width="72"
                                    Height="72"
                                    Background="{StaticResource PhoneChromeBrush}"&gt;
                                    &lt;Image
                                        jw:AwesomeImage.UriSource="{Binding User.Photo}"
                                        Tag="clear"/&gt;
                                &lt;/Grid&gt;
                                &lt;Grid
                                    Background="{StaticResource PhoneAccentBrush}"
                                    Width="12"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Stretch"
                                    Visibility="{Binding IsSelf, Converter={StaticResource Vis}}"&gt;
                                    &lt;Grid.RenderTransform&gt;
                                        &lt;TranslateTransform X="-24"/&gt;
                                    &lt;/Grid.RenderTransform&gt;
                                &lt;/Grid&gt;
                            &lt;/Grid&gt;
                            &lt;StackPanel
                                Grid.Column="1"
                                Orientation="Horizontal"&gt;
                                &lt;TextBlock
                                    Style="{StaticResource PhoneTextLargeStyle}"
                                    FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                                    VerticalAlignment="Center"
                                    Text="{Binding Rank}"/&gt;
                                &lt;TextBlock
                                    VerticalAlignment="Center"
                                    Margin="0"
                                    Text="{Binding User}"
                                    Style="{StaticResource PhoneTextLargeStyle}"/&gt;
                            &lt;/StackPanel&gt;
                            &lt;TextBlock
                                Text="{Binding Scores.Recent}"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center"
                                Grid.Column="2"
                                Style="{StaticResource PhoneTextLargeStyle}"
                                FontFamily="{StaticResource PhoneFontFamilySemiLight}"/&gt;
                        &lt;/Grid&gt;
                    &lt;/HyperlinkButton&gt;
                &lt;/DataTemplate&gt;
            &lt;/ItemsControl.ItemTemplate&gt;
        &lt;/ItemsControl&gt;
    &lt;/StackPanel&gt;
&lt;/DataTemplate&gt;</pre>
</div>
<p>So next I add an instance of the converter and give it a name. This is designed to associate the XAML data templates with the way to show specific notification object types when the items control expands after binding.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:940a8a41-e4fb-4b4b-bda9-38db8861a7a5" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Converters:NotificationDataTemplateSelector
    MessageTemplate="{StaticResource Message}"
    BadgeTemplate="{StaticResource Badge}"
    MayorTemplate="{StaticResource Mayor}"
    TipTemplate="{StaticResource PopularTip}"
    ScoreTemplate="{StaticResource Score}"
    LeaderboardTemplate="{StaticResource Leaderboard}"
    SpecialTemplate="{StaticResource Special}"
    x:Key="DataTemplateSelector"/&gt;</pre>
</div>
<p>And now here’s the items control. Here I bind the ItemsSource to my list of notifications, then use this syntax to use the data template selector:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:4f818259-6bd6-4faa-b1d7-99d0f9c4d170" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;jw:AwesomeScrollViewer&gt;
    &lt;StackPanel Margin="12,0,12,12"&gt;
        &lt;TextBlock
            Text="what's new"
            Margin="9,-7,0,16"
            Style="{StaticResource PhoneTextTitle1Style}"/&gt;
        &lt;ItemsControl ItemsSource="{Binding}"
                        Margin="0,0,0,24"&gt;
            &lt;ItemsControl.ItemTemplate&gt;
                &lt;DataTemplate&gt;
                    &lt;Grid Margin="12,0"&gt;
                        &lt;ContentControl
                        HorizontalContentAlignment="Stretch"
                        Content="{Binding}"
                        ContentTemplate="{Binding Converter={StaticResource DataTemplateSelector}}"/&gt;
                    &lt;/Grid&gt;
                &lt;/DataTemplate&gt;
            &lt;/ItemsControl.ItemTemplate&gt;
        &lt;/ItemsControl&gt;
    &lt;/StackPanel&gt;
&lt;/jw:AwesomeScrollViewer&gt;</pre>
</div>
<p>And at runtime we end up with this great output, now including the new <strong>v3 leaderboard feature</strong> in under 30 minutes! Building on all the other components in my app, and the rich Silverlight visual tree, I’m able to add features like this really quickly, without worry.</p>
<p>Another nice thing about XAML and data templates: typically there is very little required testing, especially if you’re in the habit of going through code reviews or at least reviewing source control diffs first – if you don’t change the shape of your data, you’re in a pretty good place.</p>
<p><img src="http://d2tz2ccf2zi8lx.cloudfront.net/media/posts/leaderboardWp7InResults.png" /></p>
<p>There are a lot of amazing efficiencies possible thanks to XAML. For instance, I have just a few instances in my app of data templates for check-ins, places, tips, etc. Then, whenever I add a new page, I can refer to the existing tip template, so there’s a central places for any visual tweaks or fixes that I make.</p>
<h3>Leaderboards to the next level</h3>
<p>So there’s also a leaderboard endpoint on the foursquare v2 web service that lets you grab the complete leaderboard of your friends. I was able to add this to the app in another 15 minutes – but that’s for another blog post. At a high level for that,</p>
<ul>
<li>I defined a new model item base that exposes a small list hierarchy – leaderboard items, leaderboard scores, and a leaderboard collection. (5 minutes) </li>
<li>Added a data loader class for the ‘leaderboard’ endpoint, powered by AgFx (5 minutes) </li>
<li>Added a new pivot item to the current users’ profile page, re-used the exact same “leaderboard” data template from the notifications window done above (5 minutes) </li>
</ul>
<p>Hope this helps. Oh, and if you’re noticing, these objects are not implementing INotifyPropertyChanged… in my app this sort of data doesn’t change at runtime. You only get a check-in report once for a check-in, with static data. Easy that way.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2011/03/4am-leaderboard-notification/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>4th &amp; Mayor: the ultimate foursquare app for your Windows Phone</title>
		<link>http://www.jeff.wilcox.name/2011/03/announcing-4thandmayor/</link>
		<comments>http://www.jeff.wilcox.name/2011/03/announcing-4thandmayor/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 22:43:05 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2011/03/announcing-4thandmayor/</guid>
		<description><![CDATA[I'm pleased to announce that my foursquare app for Windows Phone, 4th &#038; Mayor, is now available on the Windows Phone Marketplace.]]></description>
			<content:encoded><![CDATA[<p>I’m pleased to announce that my app is called <a href="http://www.4thandmayor.com/">4th &amp; Mayor</a>. It is a <a href="http://www.foursquare.com/">foursquare</a> client for Windows Phone 7 and it is now available for free on the Windows Phone Marketplace. I previously hinted at the app with <a href="http://www.jeff.wilcox.name/2011/03/building-an-unofficial-4sq-app-for-wp7/">this other post</a>.</p>
<p>This app brings all of the great new foursquare features that your iPhone and Android friends have been using: adding and experiencing photos at places, photos with tips, commenting on check-ins, and an early look at the cool new “explore” features that recommendations places and things to do. (<a href="http://blog.foursquare.com/2011/03/08/foursquare-3/">fsq3 info on the foursquare blog</a>)</p>
<p>It’s been a lot of fun building the client over the past few months, and I am excited to share a lot of my development experiences on this blog. Expect great things. Foursquare has a very solid and open API for developers to use (REST + JSON), and it’s a great, fun way to explore any city and stay in touch with your friends. Also, given all the recent news about Twitter, I’m super happy that I didn’t decide to make a Twitter client <img src='http://www.jeff.wilcox.name/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>On top of being a fully functional, free foursquare app, I’ve also made sure to address key complaints that I heard from people regarding the official foursquare app for WP7: general touch responsiveness, feature completeness, and the ability to check-in to international locations (with accents and other special characters in their name).</p>
<p><a href="http://www.4thandmayor.com/features/index.html"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" border="0" src="http://d2tz2ccf2zi8lx.cloudfront.net/media/p1.png" /></a></p>
<h3>Follow the product</h3>
<p>You can find out more about 4th &amp; Mayor on the web at <a href="http://www.4thandmayor.com/">http://www.4thandmayor.com/</a> – as well as on Twitter <a href="http://www.twitter.com/4thandmayor">@4thandmayor</a> and on <a href="http://www.facebook.com/4thandmayor">Facebook</a>. If you are interested in the app, its features and updates, please subscribe to the app’s blog at <a href="http://blog.4thandmayor.com/">http://blog.4thandmayor.com/</a>.&#160; I don’t want to inundate my technical subscribers with news about app updates and new features, so I want to keep that separate for the most part.</p>
<p>Do expect a great series of blog posts to come out of this learning experience, all the development-related information will be posted here. From the Windows Phone design system to development tips and tricks, this is the place to find that.</p>
<h2>“4th &amp; Mayor”</h2>
<p>So my app is called 4th &amp; Mayor. Instead of focusing on just raw performance from a development standpoint, I wanted to show how I would envision a great Windows Phone app. I believe that for a v1.0 release, I have delivered a great initial app experience. I decided to try and demonstrate a happy compromise, hoping to yield a wonderful experience that doesn’t take short-cuts.</p>
<ul>
<li>An emphasis on design</li>
<li>Aiming for complete client functionality</li>
<li>Keeping the app responsive to user input no matter what</li>
<li>A beautiful experience, yet differentiated enough</li>
</ul>
<p>This all started because one of the things I use my smart phone the most is foursquare, followed by email and Twitter. I just really wanted a better foursquare experience on the Windows Phone, and figured this would be the best way to gain excellent app development experience.</p>
<p>(The name? It&#8217;s a little odd yet creative, is clearly not an official client, and it&#8217;s all about working to become the mayor while having fun, right? The intersection of foursquare (4th) and the fun of the game – working to establish a mayorship (Mayor).</p>
<h3>An emphasis on design and rich visuals</h3>
<p>The design system for Windows Phone, code-named “Metro”, really is cool. Others have written about the experience before, but it really is a very developer-friendly design system that is crisp, clean, and once you understand the core principles and rules, it’s easy to build jaw-dropping apps. I’m just a geek, but feel I’ve come away with a pretty good first release when it comes to visual consistency and trying to adhere to the basics of “Metro”.</p>
<p>This comes through in a few ways. If you look to the screenshots below, on the left, you see the nice visuals in the “places” listing: no rounded corners, crisp and clean, etc. On the right, the “photos” pivot item for a page shows a few large, rich photos from the venue – and clicking them brings up the full-screen photo experience.</p>
<p>Both are very easy scenarios to polish thanks to XAML, but it takes an understanding of how to translate “Metro” ideas into XAML. A lot of off-by-12-pixel polishing goes into shipping a solid Windows Phone app.</p>
<p><a href="http://www.4thandmayor.com/"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" border="0" src="http://d2tz2ccf2zi8lx.cloudfront.net/media/p2.png" /></a></p>
<h3>A fun experience </h3>
<p>There’s great incentive in the new foursquare 3 features to check-in and have fun doing it: a completely revamped points system. Get points for being a VIP (checking in with the mayor), being the first of your friends to check out a new place, and so on. This, combined with the new leaderboards and an ever-growing catalog of badges is just modern-day fun.</p>
<h3>The rush to the marketplace</h3>
<p>When I heard about the problems that people were having with the foursquare app for Windows Phone, I decided to try and move into “ship mode” immediately instead of completing all of the features I had planned. I forked my source and started polishing and fixing bugs last weekend. As a result, I apologize if there’s something missing or a few bugs in the first release.</p>
<p>My app does 2 things that people have been having issues with the foursquare WP7 app:</p>
<ul>
<li>Sign in works</li>
<li>You’re able to check into a place that has special characters or accents in the name (international friends, enjoy!)</li>
</ul>
<h3>An update with specials is coming soon</h3>
<p>Now that the app is out there, an update coming soon will add specials support, and I’ll also work to address any large buckets of customer-reported bugs. Thanks to getting the build out earlier in the week for people with developer unlocked phones, I’ve been able to start identifying a few small bugs and issues that I hope to correct soon (thanks everyone).</p>
<h2>From a blank Visual Studio project to shipping… &lt; 120 days</h2>
<p>I created a new Visual Studio project a few weeks after purchasing my first Windows Phone (a Samsung Focus, I’m pretty happy with it), and registered for the domain name 4thandmayor.com in early December 2010. Hoping to learn about the process of building a large, feature-complete Windows Phone app from the ground up, I had no idea how much time it would take, but it’s been a fun use of many a night and weekend over the past few months.</p>
<p>Most development happened in spurts as I found a free Sunday afternoon or a clear night or two. I’m really glad that I was able to the have the opportunity to build a feature-complete WP7 app and that Microsoft is open to this kind of project as appropriate.</p>
<p>A brief, approximate timeline of my development process:</p>
<ul>
<li>Early Dec. 2010: App concept, goals, and new Visual Studio project created. Targeting v1 of the foursquare API.</li>
<li>Mid-December: Domain name registration, setup a source control system at home, etc. Oh no! Foursquare v2 API launched, v1 to be deprecated.</li>
<li>Christmas vacation Dec. 2010: Lots of coding and completing the application, foursquare launched photos &amp; comments support for iPhone and Android. I was able to add these features in a few days over the break.</li>
<li>Late January: spent a few weekends polishing, fixing bugs, and focusing on the “Metro” design</li>
<li>February: moved to a much more rich data loading system</li>
<li>3/8/2011: foursquare announced fsq3, with even more new features, at SXSW. Around this time, there were login issues with the official foursquare app for WP7, and I decided it was time to launch the app.</li>
<li>3/16/2011: submitted to the Windows Phone Marketplace</li>
</ul>
<p>Not knowing that fsq3 was coming out at SXSW, it’s a testament to the Windows Phone app platform that it only took a few hours to add these new views, models, and features into my app (exploring, enhanced leaderboards, etc.), allowing me to deliver a little more than a week and a half later a feature-complete implementation.</p>
<p>I will be covering a lot of the experiences and sharing a decent amount of code and samples over the next many blog posts, covering:</p>
<ul>
<li>Application architecture</li>
<li>Data loading strategies</li>
<li>Designing for Windows Phone… for developers.</li>
<li>Building out controls and components for a strong and polished “Metro” experience</li>
<li>Establishing a web experience for your WP7 app</li>
<li>Compromising between raw performance and beautiful design</li>
<li>Analytics and apps</li>
<li>Keeping the user interface responsive</li>
<li>OAuth2 and the Windows Phone</li>
<li>Pivot loading techniques and user interface virtualization tips</li>
<li>Debugging, collecting feedback and beta testing</li>
<li>Gold plating: making a fun out-of-box, first-time-run experience</li>
<li>Polishing a Windows Phone app</li>
<li>Marketplace ingestion and the last mile</li>
</ul>
<p>Please let me know if there are any things I’ve missed, or you’d like to know about, and I will add them to the list! I’ve learned a wealth of information along the way but I think this will be a long-term blogging project, there’s just so many different things here.</p>
<h3>Technical building blocks</h3>
<p>The app was a pretty big technical undertaking, the goal of building a feature-complete app for such a large service is a big challenge. Along the way I had to build out a number of components, and of course make use of many great things others have shared as well.</p>
<ul>
<li><a href="http://silverlight.codeplex.com/">Silverlight for Windows Phone Toolkit</a>: powering page transitions, the tilt effect, and toggle switches.</li>
<li><a href="http://code.msdn.microsoft.com/AgFx-Windows-Phone-and-6fd11606">AgFx: a Windows Phone and Silverlight application framework</a> by Shawn Burke (more info <a href="http://blogs.msdn.com/b/sburke/archive/2011/03/11/build-great-windows-phone-applications-the-easy-way.aspx">here</a> and <a href="http://blogs.msdn.com/b/sburke/archive/2011/03/17/tutorial-building-a-connected-phone-app-with-agfx.aspx">here</a> too)</li>
<li>Various image control and loading concepts by <a href="http://blogs.msdn.com/b/delay">David Anson</a></li>
<li><a href="http://json.codeplex.com/">JSON.NET by James Newton-King</a></li>
<li>Andy Pennell’s <a href="http://blogs.msdn.com/b/andypennell/archive/2010/11/01/error-reporting-on-windows-phone-7.aspx">LittleWatson</a></li>
<li><a href="http://www.davidpoll.com/tag/silverlight-and-beyond-slab/">SLaB by David Poll</a> (used for tombstoning stuff)</li>
<li>Advice and code by Peter Torr &amp; also Gilles Khouzam</li>
<li>
<div align="left"><a href="http://www.microsoft.com/maps/product/licensing_for_mobile.aspx">Bing Maps Mobile Platform</a></div>
</li>
<li>And last but most important, the <a href="http://developer.foursquare.com/">foursquare developer API</a></li>
</ul>
<p>And I also built out a ton of specialized components, talk about fun:</p>
<ul>
<li>Watermarked text box</li>
<li>Visual components resembling the OS’s text messaging experience</li>
<li>An awesome scroll viewer that can do delayed image loading in an efficient and smart manner</li>
<li>Smart image controls for fading, replacing “Metro”-style blocks of color, and efficiently downloading bits.</li>
<li>A grouping items control with an emphasis on smooth scrolling</li>
<li>A text visualizer for showing licensing information in the About screen</li>
<li>A Static Bing Map control for high-performant, beautiful maps</li>
<li>A WebXamlBlock for displaying updatable information</li>
<li>Orientation-aware layout containers</li>
<li>An analytics component</li>
<li>“Live tiles” for use inside an app</li>
<li>A fun <a href="http://en.wikipedia.org/wiki/Ken_burns">Ken Burns</a>-style effect</li>
<li>Enhanced message box and dialog overlays</li>
<li>A very lightweight app settings provider</li>
<li>Tombstoning stream and text functionality</li>
</ul>
<h3>Initial reception</h3>
<blockquote><p>“My Saturday night was great, thx to 4th &amp; Mayor” – toowicked</p>
<p>“Been using 4th &amp; Mayor foursquare app, gotta say it’s the best one I’ve used on any OS. Get it when it’s available in WP7 marketplace!” &#8211; Jonnie</p>
<p>“4th &amp; Mayor you are beautiful and fill my heart with hope for #WP7 future.” &#8211; Sergey</p>
<p>“Wow, 4th &amp; Mayor is incredible. Infinitely better than the official foursquare app for Windows Phone.” &#8211; Brian</p>
<p>“Inspired by the @4thandmayor application. I guess I will be doing some #wp7 coding this weekend.” &#8211; Laci</p>
<p>“Wish we could get you to make a Twitter app that looks as good as 4th &amp; Mayor <img src='http://www.jeff.wilcox.name/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ” &#8211; Josh</p>
</blockquote>
<h3>Special thanks</h3>
<p>This project could not have happened without the help and support of many good friends and engineers.</p>
<p>A big shout out to Naveen and all the folks at foursquare: thanks for building a beautiful product, great service, and having a solid, open API for developers to take advantage of!</p>
<p>As called out in the “About” page of my app, thanks:</p>
<ul>
<li>Shawn Burke</li>
<li>David Anson</li>
<li>Gilles Khouzam</li>
<li>David Poll</li>
<li>Peter Torr</li>
<li>Andy Pennell</li>
</ul>
<p>Also, thanks to my excellent beta testers who have been checking in all over the world. Notably, Shawn, Eric, Gilles, Nimesh, Shoko, Sam, Johan, David, and Nic. You all rock!</p>
<p>There is a <a href="http://www.4thandmayor.com/support/knownIssues/index.html">list of known issues</a> up on the site. The app is designed to offer a rich, compelling and fun experience for people with up to 50 foursquare active friends, with slight performance degradation for people with more friends.</p>
<p>So, check out the site and download the app if you’re into foursquare.</p>
<p><a href="http://www.4thandmayor.com/"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" border="0" src="http://d2tz2ccf2zi8lx.cloudfront.net/media/wp7_install.png" /></a></p>
<p>Hope you enjoy the app!</p>
<p> <small>Foursquare™ is a trademark of Foursquare Labs, Inc.   <br />This application uses the foursquare™ application programming interface but is not endorsed or certified by Foursquare Labs, Inc.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2011/03/announcing-4thandmayor/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Upcoming speaking engagements on the Windows Phone</title>
		<link>http://www.jeff.wilcox.name/2011/03/upcoming-2011-speaking-engagements/</link>
		<comments>http://www.jeff.wilcox.name/2011/03/upcoming-2011-speaking-engagements/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 21:45:15 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[MIX]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2011/03/upcoming-2011-speaking-engagements/</guid>
		<description><![CDATA[I wanted to share info on a few of the upcoming talks that I will be giving at a few conferences. If you’re thinking of attending any of these, I think there will be plenty to learn! MIX 2011 (April) At Microsoft’s own MIX 11 conference in Vegas, I will be presenting on Windows Phone [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to share info on a few of the upcoming talks that I will be giving at a few conferences. If you’re thinking of attending any of these, I think there will be plenty to learn!</p>
<h1>MIX 2011 (April)</h1>
<p>At Microsoft’s own <a href="http://live.visitmix.com/mix11">MIX 11 conference in Vegas</a>, I will be presenting on <a href="http://channel9.msdn.com/events/MIX/MIX11/DVC01">Windows Phone application performance</a> (session DVC01), with an emphasis on lessons learned, what’s improving in the performance space, and a look at the new Windows Phone profiler.</p>
<p>I’ve had the honor of attending MIX several years now and each year it gets better, more refined, and remains an outliner in the Microsoft conference line-up (it’s more fun, casual, and Las Vegas is always fun).</p>
<p>You can see the <a href="http://live.visitmix.com/mix11">current session list</a> for MIX 2011 <a href="http://live.visitmix.com/mix11">online</a>. Also, the Silverlight Toolkit has been nominated for one of the Nineny awards, so that will be exciting! MIX is held in Las Vegas at the Mandalay Bay convention center April 12-14. The keynote speakers on day one are Scott Guthrie and Joe Belfiore.</p>
<h1>NDC 2011 (June)</h1>
<p>I’ll be presenting a few sessions on Windows Phone developer at the <a href="http://ndc2011.no/index.aspx">Norwegian Developers Conference (NDC 2011)</a> in Oslo, Norway. The event is held from June 8-10. Here’s the <a href="http://ndc2011.no/agenda.aspx?cat=1071">current session lineup and schedule</a> for NDC 2011. Scott Guthrie is giving the keynote on 6/8.</p>
<p>I’m presenting 2 talks:</p>
<ul>
<li>On the morning of 6/7, a talk on “Peeking at the source of a successful Windows Phone app”. This is a 300-level talk that looks into what it takes to have a <em>large</em> Windows Phone app, from dealing with the marketplace, solving common problems, and a look at a smart data caching and loading system for pulling down data from web services.</li>
<li>In the afternoon, “Making a beautiful and rock-solid Windows Phone app”. This talk is more of a 200-level one that takes a simple Windows Phone app (like you could create in a matter of hours) and then takes it to the next level by adding visual effects, addressing usability and design issues, as well as adding error reporting and other key app services. It would be great for any developer thinking about building an app, to find out how to polish it and make a difference.</li>
</ul>
<p>There are a <a href="http://ndc2011.no/index.aspx?cat=1070">ton of other great speakers</a> going including Jon Skeet, Rob Conery, Jonas Follesø, and the .NET Rocks guys, just to name a few.</p>
<p>Hope to see you out in the wild this conference season!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2011/03/upcoming-2011-speaking-engagements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I’m developing my own Foursquare client for the Windows Phone</title>
		<link>http://www.jeff.wilcox.name/2011/03/building-an-unofficial-4sq-app-for-wp7/</link>
		<comments>http://www.jeff.wilcox.name/2011/03/building-an-unofficial-4sq-app-for-wp7/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 23:28:14 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Control Development]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2011/03/building-an-unofficial-4sq-app-for-wp7/</guid>
		<description><![CDATA[I'm developing an unofficial Foursquare app for Windows Phone that will be the basis of a number of upcoming technical blog posts, conference talks, and more.]]></description>
			<content:encoded><![CDATA[<p>I’m developing an unofficial Foursquare client app for Windows Phone in my spare time that will be available free on the Windows Phone marketplace this month. I will have another blog post soon introducing the app in a more official capacity, this is just setting the stage.</p>
<p>With an emphasis on design that you’d expect from a great Windows Phone app, the app is fun to use, responsive, and almost as addictive as coffee if you’re into 4sq like I am. Here’s a quick look at the app – it respects your theme preferences, accent coloring, and looks beautiful.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="A preview of my unofficial Foursquare client" border="0" alt="A preview of my unofficial Foursquare client" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/banner1.png" width="685" height="326" /></p>
<p>Building a complete app of this size from the ground-up has been a great learning experience. It has given me a lot of good perspective to bring back to the product team (the day job), and it fits my needs perfectly, since I love Foursquare and am passionate about having the best experience using it on my phone.</p>
<p>The Windows Phone development environment is stellar, really productive; I’m amazed at how quickly I can add new endpoints, build up functional UI, and in general be productive.</p>
<p>Full disclosure, I’m a developer on the Silverlight Phone &amp; Devices team, so I have my own fine opinions in this space. But it’s fun, easy, and I can’t wait to see more people get into the groove.</p>
<h3>Why build yet another Foursquare app?</h3>
<p>Although the Foursquare app for Windows Phone today is ok, it doesn’t support a number of great new features that Foursquare has added to their iPhone and Android apps, such as photos, commenting, and new features released at SXSW this week (such as leaderboard updates whenever you check-in at a place), so I’m focusing on adding that sort of functionality, while polishing the user interface and experience to better match how I would expect a world-class app for the Windows Phone to look and feel.</p>
<p>I’m sure, in time, the official app will be updated as well. It makes perfect sense to me why they should focus development on those platforms initially given the number of users they are serving with those devices. There’s going to be a chicken-and-egg situation with apps for a while on any new platform.</p>
<p>So I’m not looking to completely replace that nice official app, but if others find my client useful, that’s great, too! I know my Windows Phone friends on Foursquare want a better experience, and I’ve had a number of good friends testing my new application to help get it ready to release into the wild. Stay tuned.</p>
<h3>Loving Windows Phone development today</h3>
<p>I’ve been using a <a href="http://www.windowsphone.com/">Windows Phone</a> (Samsung Focus) since mid-November last year, and I’m happy to say that it’s been a pretty good process overall. I’m consistently amazed at how many people ask to see it when I’m out on the town – it is my opinion that in time this is going to be a very strong contender, and the Nokia involvement is pretty exciting. The marketing is right about one thing: having your next meeting right on the lock screen is super important for my day job, I’m always running from meeting to meeting.</p>
<p>Interest in the dev platform is going to grow, and so it’s very important for me as a member of the Silverlight for Windows Phone team to have a good understanding of the lifecycle of app development, especially a hard look at platform limitations, where we can do better, and what’s missing, in building out a complete Windows Phone app that matches the user experience expectations that our users have.</p>
<p>Building such an involved app has helped me get into the customer mindset even more: experiencing some of the pains today, the joy of getting something working, and then having the experience of using my very own app out in the real world as I check-in to places.</p>
<p>I traveled the world last year meeting with customers large and small to make sure that the initial applications all had a good launch, and along the way helped build guidance about performance, common issues and pitfalls, and came up with a number of suggestions I think all wp7 app devs should consider. That knowledge, combined with my experience building my own Foursquare app, is really interesting, and I cannot wait to share some of those tips because I think it will help drive quality into all the apps out there.</p>
<h3>Why Foursquare</h3>
<p>I’m an avid Foursquare fan. I’ve been using it for a long time now, find it a really fun way to share experiences with friends (the new more visible leaderboard in v3 is fun, as are check-in comments!), and yes, I admit that I use my phone for only a few things: e-mail, 4sq, the occasional Facebook or Twitter update, and maps. That’s in priority order. I’m always checking in, because it’s fun with Foursquare – Facebook places is just boring in comparison.</p>
<p>From an application perspective, Foursquare is a sufficiently complex application (over 40 views/pages) that the learning experience has so far been valuable, and it covers many typical application scenarios for the smartphone form-factor: location services, camera and picture integration, privacy, and plenty of web services and rich content.</p>
<p>From a development standpoint, Foursquare has a solid application programming interface that is pretty open, uses OAuth2, JSON, and represents the state of the art for most strong web services today. Perfect candidate.</p>
<p>Though I briefly considered charging for the app, this is my gift to the Windows Phone world – hopefully there are some Foursquare fans on WP7 that will appreciate that!</p>
<h3>Looking at recent Foursquare innovations</h3>
<p>As I mentioned at the start, Foursquare has recently made exciting new improvements to its service, expanding the “game”, and so there are a number of features that are not supported on the Windows Phone client today.</p>
<p>As a Windows Phone user, I want to be able to enjoy the same experience as friends with iPhones and Androids… and it’s just a matter of the software here. I want to experience these great Foursquare features:</p>
<ul>
<li>Photos of venues </li>
<li>Photos with tips </li>
<li>Associating a photo with a check-in </li>
<li>Commenting on check-ins </li>
<li>Leaderboard results when checking in </li>
<li>Additional special types </li>
<li><em>and more</em> </li>
</ul>
<p>I hope to fully support all these great new features where I can, enabling Windows Phone users to experience the same great things that our iPhone and Android friends can today with the latest Foursquare 3 client.</p>
<h3>The Windows Phone development environment</h3>
<p><a title="Touchscreen panel + emulator! by jeffwilcox, on Flickr" href="http://www.flickr.com/photos/jeffwilcox/5510816214/"><img style="display: inline; float: right" alt="Touchscreen panel + emulator!" align="right" src="http://farm6.static.flickr.com/5174/5510816214_620c363ba7_m.jpg" width="240" height="180" /></a>Visual Studio has always been a great place for coding, but combining that with the rich Silverlight design surface, the free Expression Blend tool for UI tweaking, and a way of debugging using my phone device or the Windows Phone emulator, it’s all very solid.</p>
<p>Most recently, I was able to setup a station with a touch-screen monitor on a Windows 7 machine. The result is the ability to use the Windows Phone emulator more like a real phone – being able to pinch, flick, and pan using real touch manipulations is a great improvement over using the mouse in testing before. All I did was plug in the touch-screen monitor and go! Here’s a <a href="http://www.youtube.com/watch?v=z3wpOS5_e9s&amp;feature=youtu.be">short YouTube video of that experience</a> while debugging.</p>
<h3>Components, components, components</h3>
<p>One reason that I have not yet released my app on the marketplace is that I’ve been tweaking, polishing, and filling out the user experience through a large component/control library. As a side project in my evenings, this has been a labor of love.</p>
<p>Building out an application this large with the right level of performance is not easy, and I’ve had to build a number of specialized components along the way. Many of these components I’ve polished enough to behave just like you would expect the Windows Phone to – and this is important to me. I don’t want a user to have an inconsistent experience from the rest of the phone, and so I’m taking the time to build these to a high level of quality.</p>
<p>I have an eye for detail and as a result really find it offensive when I’m using apps that don’t respect the OS design and user’s preferences, for example: I want my selected “accent color” to come through in the app. I would like the experience to feel authentic to the Windows Phone, and not be a “port” of some other app experience from another platform.</p>
<p>So now I’ve built up an army of components. Most are specialized, but over time, I will find a way to share them with the community at large. Give me time!</p>
<p>A core part of this application is a sweet way of loading and caching data from the web for use in model objects and data binding. Details will be out on that in a bit, too.</p>
<h3>Do we need a Three20 for Windows Phone?</h3>
<p>If this reads a lot like Joe Hewitt’s “<a href="http://joehewitt.com/post/developing-facebook-for-iphone/">Developing Facebook for iPhone</a>” post, it is on purpose &#8211; I’ve drawn a lot of inspiration from learning about the <a href="http://three20.info/">Three20 project</a> that Joe started. It started for a similar reason as why I am building so many custom components – matching the OS, filling gaps where there are no official controls in the SDK yet, and working to improve the ease of use (pulling and caching data from the web, for instance). It’s also somewhat comforting (and maybe a little disturbing) to me that I can read posts about the Apple development platform, mentally replacing “Apple” with “Microsoft”, and understand that all app platforms seem to go through the same trials and tribulations.</p>
<p>Three20 is an open source project initially started by Joe, offering a number of the components built for the Facebook app for iPhone, generalized and polished for use in pretty much all the top iOS apps today.</p>
<p>I’m not ready to commit to releasing my mixed-quality-bag specialized-components, but I think the community at large is going to continue to build out additional solid components – I’m already seeing many active phone and Silverlight developers starting to share their components, which is sweet.</p>
<p>Excited to share more with you all over the coming months. I will be blogging technical details on my blog here, as well as sharing tidbits on Twitter – so please do follow me, <a href="http://www.twitter.com/jeffwilcox">@jeffwilcox</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2011/03/building-an-unofficial-4sq-app-for-wp7/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Using AutoCompleteBox in a Windows Phone Panorama or Pivot item</title>
		<link>http://www.jeff.wilcox.name/2011/03/acb-in-pivot/</link>
		<comments>http://www.jeff.wilcox.name/2011/03/acb-in-pivot/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 22:28:20 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/?p=779</guid>
		<description><![CDATA[With some quick re-templating action, you can use AutoCompleteBox from the toolkit in a Panorama or Pivot control page for Windows Phone. This is one of the key customer asks from folks developing WP7 apps that I hear often. The good news is that this can be accomplished with simple re-templating of the AutoCompleteBox control, [...]]]></description>
			<content:encoded><![CDATA[<p>With some quick re-templating action, you can use AutoCompleteBox from the toolkit in a Panorama or Pivot control page for Windows Phone. This is one of the key customer asks from folks developing WP7 apps that I hear often.</p>
<p>The good news is that this can be accomplished with simple re-templating of the AutoCompleteBox control, and a little visual trickery.</p>
<p>The bad news is that I’m not sure that we will be able to address the CodePlex work item to officially support this, <a href="http://silverlight.codeplex.com/workitem/7574">work item 7574</a> with 21 votes so far (a popular issue!), because of the technical limitations at play here: the control itself uses a child Popup in the template to display the results, showing them on top of your page and content. When used in a Panorama or Pivot, there are issues here where the Popup doesn’t properly align on the page, or work at all.</p>
<p>There are three steps to doing this:</p>
<ol>
<li>Making sure that you have a Visibility converter available in your app (most already have this) </li>
<li>Designing the visuals with grids to include a placeholder and a spanning content area on top of your pivot/panorama items’ content </li>
<li>Retemplating your AutoCompleteBox when used </li>
</ol>
<p>For this example, I’m starting with the standard Windows Phone Pivot Application template so that you can follow along. This is best described as <strong>“hack quality</strong>” so proceed at your own risk. I want to unblock people that believe this is not possible, so here it is.</p>
<p>Also, with this workaround, the Visual Studio design surface is unable to continue working due to an issue resolving RelativeSource at runtime. You’ll want to comment out some of it while working on your design.</p>
<h2>Visual trickery, illustrated</h2>
<p>The trick to this re-template is to <strong>remove the popup</strong> from the template. Instead, we need to “fake” the popup experience by overlaying the results of the AutoCompleteBox (when searching) on top of the visuals in the PivotItem or PanoramaItem.</p>
<p>As always, I believe re-templating is a core Silverlight development technique. Though often a last resort before modifying the code of controls or building your own, it is a super important concept to master.</p>
<p>To do this, start with a standard Pivot control or Panorama item template and make these changes to the item that will contain your search box.</p>
<ul>
<li>The root element of the item must be a Grid, not a StackPanel </li>
<li>It must define at a minimum 2 rows: the first row has a hard-coded height of 72 that will represent the search/text box of the AutoCompleteBox, effectively a “placeholder” </li>
<li>The last visual needs to be another Grid, with Grid.Row set to 0, and the RowSpan to span the entire number of rows defined in the child of the pivot/panorama item. This is to fake the effect of a “popup” by allowing visuals to be on top. </li>
</ul>
<p>I understand this concept can be a little confusing, which is yet another reason we can’t really just change the template for all AutoCompleteBox examples. I might add this template to the sample project in the future, however!</p>
<p>The reason the last item needs to be the “overlay” grid is that XAML at the bottom of an item has a higher z-order than the rest, acting similar to a popup.</p>
<p>So visually, we define first a basic grid in the item.</p>
<p>The XAML might look like this now – you can follow along in the default pivot app project to see what’s different.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:58525722-4051-44a1-9c00-cd2aee05d868" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;controls:PivotItem Header="first"&gt;
    &lt;Grid&gt;
        &lt;Grid.RowDefinitions&gt;
            &lt;RowDefinition Height="72"/&gt;
            &lt;RowDefinition/&gt;
        &lt;/Grid.RowDefinitions&gt;

        &lt;!-- Row 0 is a 'placeholder' for the AutoCompleteBox control --&gt;

        &lt;ListBox
            Grid.Row="1"
            x:Name="FirstListBox" Margin="0,0,-12,0" ItemsSource="{Binding Items}"&gt;
            &lt;ListBox.ItemTemplate&gt;
                &lt;DataTemplate&gt;
                    &lt;StackPanel Margin="0,0,0,17" Width="432"&gt;
                        &lt;TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/&gt;
                        &lt;TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/&gt;
                    &lt;/StackPanel&gt;
                &lt;/DataTemplate&gt;
            &lt;/ListBox.ItemTemplate&gt;
        &lt;/ListBox&gt;
    &lt;/Grid&gt;
&lt;/controls:PivotItem&gt;</pre>
</div>
<p>This defines a placeholder (Row 0) and the content of the item (Row 1). Row 0 is where the text box visually should be overlaid. Visually, this is sort of what this is about enabling from a spacing perspective:</p>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/Grid1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Grid1" border="0" alt="Grid1" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/Grid1_thumb.png" width="480" height="800" /></a></p>
<p>Now, we add the “overlay” grid. For this purpose, I temporarily colored it Red to show that it overlays the earlier items:</p>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/Grid2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Grid2" border="0" alt="Grid2" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/Grid2_thumb.png" width="480" height="800" /></a></p>
<p>In the actual world, this is where you want to put in the overlay grid and eventually the AutoCompleteBox.</p>
<p>So the updated code is similar to this:</p>
<p><div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:894465c2-cc62-48e7-ad61-26b12e6bbdfc" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;controls:PivotItem Header="first"&gt;
    &lt;Grid&gt;
        &lt;Grid.RowDefinitions&gt;
            &lt;RowDefinition Height="72"/&gt;
            &lt;RowDefinition/&gt;
        &lt;/Grid.RowDefinitions&gt;

        &lt;!-- Row 0 is a 'placeholder' for the AutoCompleteBox control --&gt;

        &lt;ListBox
            Grid.Row="1"
            x:Name="FirstListBox" Margin="0,0,-12,0" ItemsSource="{Binding Items}"&gt;
            &lt;ListBox.ItemTemplate&gt;
                &lt;DataTemplate&gt;
                    &lt;StackPanel Margin="0,0,0,17" Width="432"&gt;
                        &lt;TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/&gt;
                        &lt;TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/&gt;
                    &lt;/StackPanel&gt;
                &lt;/DataTemplate&gt;
            &lt;/ListBox.ItemTemplate&gt;
        &lt;/ListBox&gt;

        &lt;!-- The AutoCompleteBox experience --&gt;
        &lt;!-- Must be the last XAML in the Grid to ensure a top z-order --&gt;
        &lt;!-- It must span the entire grid, starting with row 0. --&gt;
      &lt;Grid Grid.Row="0" Grid.RowSpan="2"&gt;
      &lt;/Grid&gt;
    &lt;/Grid&gt;
&lt;/controls:PivotItem&gt;
</pre>
</div>
<p>Ok. We’re closer now that the basics are there. If you run the project, you’ll still see simply your content, with space at the top where the AutoCompleteBox (text box part) will go.</p>
<h2>A required visibility converter</h2>
<p>Since we replaced the pivot, we need to instead toggle the visibility of the list box for showing results only when the IsDropDownOpen dependency property is set to true. This is easy enough using a relative source binding (similar to a template binding) plus adding a Visibility converter to the project, and using it in the template.</p>
<p>Here’s a super simple visibility converter to get started. Add it as a class file to your project.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:8c207532-f1f6-4f04-b90d-5021a9d40bc9" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">using System;
using System.Windows;
using System.Windows.Data;

namespace Microsoft.Phone.Controls
{
    public class VisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool visible = true;

            if (value is bool)
            {
                visible = (bool)value;
            }
            else if (value is int || value is short || value is long)
            {
                visible = 0 != (int)value;
            }
            else if (value is float || value is double)
            {
                visible = 0.0 != (double)value;
            }
            else if (value == null)
            {
                visible = false;
            }

            if ((string)parameter == "!")
            {
                visible = !visible;
            }

            return visible ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
</pre>
</div>
<p>And then to the page, add it as a resource, plus the XMLNS for “localControls” pointing to the Microsoft.Phone.Controls namespace. I use the key name <strong>Vis.</strong></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:4976b4b9-80e4-4d98-ad67-726365b785cb" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">        &lt;!-- Make the visibility converter available --&gt;
        &lt;Grid.Resources&gt;
            &lt;localControls:VisibilityConverter x:Key="Vis"/&gt;
        &lt;/Grid.Resources&gt;
</pre>
</div>
<p>Now we’ll use it in the template.</p>
<h2>The new template</h2>
<p>Now we want to re-template the AutoCompleteBox. You could define the template once in App.xaml, but for simplicity I just did this inline. The most important parts are:</p>
<ul>
<li>Removing the Popup template part </li>
<li>Adding a Visibility relative source binding to show/hide the results at the appropriate time </li>
<li>The listbox and textbox in the template are moved into a grid-row structure visually </li>
</ul>
<p>This takes advantage of the idea that template parts in controls are usually “optional”, so without the Popup in there, it still functions just fine in the app.</p>
<p>So this now adds to the overlay grid…</p>
<ul>
<li>AutoCompleteBox instance</li>
<li>Sets the item template, filter parameters, etc., as an example</li>
<li>Sets the ControlTemplate</li>
</ul>
<p>Here is the ControlTemplate if you are just copying and pasting into your own app:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:5ecc4edf-d94a-450f-93ac-aa4b30491f9a" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;ControlTemplate TargetType="toolkit:AutoCompleteBox"&gt;
    &lt;Grid&gt;
        &lt;Grid.RowDefinitions&gt;
            &lt;RowDefinition Height="Auto"/&gt;
            &lt;RowDefinition/&gt;
        &lt;/Grid.RowDefinitions&gt;
        &lt;TextBox
            x:Name="Text"
            Background="{TemplateBinding Background}"
            BorderBrush="{TemplateBinding BorderBrush}"
            BorderThickness="{TemplateBinding BorderThickness}"
            FontFamily="{TemplateBinding FontFamily}"
            FontSize="{TemplateBinding FontSize}"
            FontStyle="{TemplateBinding FontStyle}"
            FontWeight="{TemplateBinding FontWeight}"
            Foreground="{TemplateBinding Foreground}"
            InputScope="{TemplateBinding InputScope}"
            Opacity="{TemplateBinding Opacity}"
            Padding="{TemplateBinding Padding}"
            Style="{TemplateBinding TextBoxStyle}"/&gt;
        &lt;ListBox
            Margin="12"
            Visibility="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource Vis}}"
            Grid.Row="1"
            x:Name="Selector"
            Background="White"
            FontFamily="{TemplateBinding FontFamily}"
            FontSize="{TemplateBinding FontSize}"
            FontStyle="{TemplateBinding FontStyle}"
            FontWeight="{TemplateBinding FontWeight}"
            Foreground="{TemplateBinding Foreground}"
            IsTabStop="False"
            ItemContainerStyle="{TemplateBinding ItemContainerStyle}"
            ItemTemplate="{TemplateBinding ItemTemplate}"
            Opacity="{TemplateBinding Opacity}"
            BorderBrush="{StaticResource PhoneTextBoxEditBorderBrush}"
            BorderThickness="{TemplateBinding BorderThickness}"
            Padding="0,8"/&gt;
    &lt;/Grid&gt;
&lt;/ControlTemplate&gt;</pre>
</div>
<p>The Visibility binding on the ListBox is important, as it is what keeps the ListBox from being displayed over your existing page content at runtime. It uses the resource we defined for the visibility converter, <strong>Vis</strong>. Relative source binding is used to make it very similar to a template binding with a converter.</p>
<p>And so the final XAML for the PivotItem looks like this expanded:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:49cd3d2c-1b4e-44e6-aef9-b5f49d8099bc" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;controls:PivotItem Header="first"&gt;
    &lt;Grid&gt;
        &lt;Grid.RowDefinitions&gt;
            &lt;RowDefinition Height="72"/&gt;
            &lt;RowDefinition/&gt;
        &lt;/Grid.RowDefinitions&gt;

        &lt;!-- Row 0 is a 'placeholder' for the AutoCompleteBox control --&gt;

        &lt;ListBox
            Grid.Row="1"
            x:Name="FirstListBox" Margin="0,0,-12,0" ItemsSource="{Binding Items}"&gt;
            &lt;ListBox.ItemTemplate&gt;
                &lt;DataTemplate&gt;
                    &lt;StackPanel Margin="0,0,0,17" Width="432"&gt;
                        &lt;TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/&gt;
                        &lt;TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/&gt;
                    &lt;/StackPanel&gt;
                &lt;/DataTemplate&gt;
            &lt;/ListBox.ItemTemplate&gt;
        &lt;/ListBox&gt;

        &lt;!-- The AutoCompleteBox experience --&gt;
        &lt;!-- Must be the last XAML in the Grid to ensure a top z-order --&gt;
        &lt;!-- It must span the entire grid, starting with row 0. --&gt;
        &lt;!-- Warning: the design surface does not like this template unfortunately --&gt;
        &lt;!-- AutoCompleteBox must be vertically aligned with the placeholder --&gt;
        &lt;Grid Grid.Row="0" Grid.RowSpan="2"&gt;
            &lt;toolkit:AutoCompleteBox
                ValueMemberBinding="{Binding LineOne}"
                FilterMode="ContainsCaseSensitive"
                x:Name="_autoCompleteBox"
                ItemsSource="{Binding Items}"
                VerticalAlignment="Top"&gt;
                &lt;toolkit:AutoCompleteBox.ItemTemplate&gt;
                    &lt;DataTemplate&gt;
                        &lt;TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/&gt;
                    &lt;/DataTemplate&gt;
                &lt;/toolkit:AutoCompleteBox.ItemTemplate&gt;
                &lt;toolkit:AutoCompleteBox.Template&gt;
                    &lt;ControlTemplate TargetType="toolkit:AutoCompleteBox"&gt;
                        &lt;Grid&gt;
                            &lt;Grid.RowDefinitions&gt;
                                &lt;RowDefinition Height="Auto"/&gt;
                                &lt;RowDefinition/&gt;
                            &lt;/Grid.RowDefinitions&gt;
                            &lt;TextBox
                                x:Name="Text"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                FontFamily="{TemplateBinding FontFamily}"
                                FontSize="{TemplateBinding FontSize}"
                                FontStyle="{TemplateBinding FontStyle}"
                                FontWeight="{TemplateBinding FontWeight}"
                                Foreground="{TemplateBinding Foreground}"
                                InputScope="{TemplateBinding InputScope}"
                                Opacity="{TemplateBinding Opacity}"
                                Padding="{TemplateBinding Padding}"
                                Style="{TemplateBinding TextBoxStyle}"/&gt;
                            &lt;ListBox
                                Margin="12"
                                Visibility="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource Vis}}"
                                Grid.Row="1"
                                x:Name="Selector"
                                Background="White"
                                FontFamily="{TemplateBinding FontFamily}"
                                FontSize="{TemplateBinding FontSize}"
                                FontStyle="{TemplateBinding FontStyle}"
                                FontWeight="{TemplateBinding FontWeight}"
                                Foreground="{TemplateBinding Foreground}"
                                IsTabStop="False"
                                ItemContainerStyle="{TemplateBinding ItemContainerStyle}"
                                ItemTemplate="{TemplateBinding ItemTemplate}"
                                Opacity="{TemplateBinding Opacity}"
                                BorderBrush="{StaticResource PhoneTextBoxEditBorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Padding="0,8"/&gt;
                        &lt;/Grid&gt;
                    &lt;/ControlTemplate&gt;
                &lt;/toolkit:AutoCompleteBox.Template&gt;
            &lt;/toolkit:AutoCompleteBox&gt;
        &lt;/Grid&gt;
    &lt;/Grid&gt;
&lt;/controls:PivotItem&gt;</pre>
</div>
<p>So, taking a few of the coloring concepts from earlier, you see we end up with this idea at runtime when entering text (coloring added to show separation, it won’t look like that in your app)</p>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/Grid3.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Grid3" border="0" alt="Grid3" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/Grid3_thumb.png" width="480" height="800" /></a></p>
<h2>Download the completed project</h2>
<p>I’ve zipped up the sample including the template. Make sure you have the <a href="http://silverlight.codeplex.com/">Silverlight for Windows Phone Toolkit</a> installed as well, you might have to re-add that reference to the sample.</p>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2011/03/AutoCompletePivot.zip">[<strong>ZIP</strong>] 31 KB &#8211; <strong>AutoCompletePivot.zip</strong></a></p>
<h2>Other notes</h2>
<h3>Selecting an item may require a few touches by default</h3>
<p>When you select an item in the AutoCompleteBox, it will fire SelectionChanged, etc., but you may find that the list shrinks (requiring another press), or that the software keyboard is still up. These need to be worked around today at the app level to match the experience you want to offer your users.</p>
<ul>
<li>Consider hooking up to the selection event in the control, then calling Focus() on a visual element elsewhere to remove the software keyboard </li>
<li>Consider a code fix where if a single item is selected currently, to assume that was the final selection by the user and dismiss the selection system – requires a code workaround since not all app authors may want this. </li>
</ul>
<h3>Enables Landscape page use as well</h3>
<p>This also enables using AutoCompleteBox on landscape pages, <em>although</em> it’s very difficult to control the software keyboard (SIP), so you may find that you can hardly see a single item while in landscape mode with the software keyboard up.</p>
<p>You may notice that the native Windows Phone experience rarely offers auto completion in landscape, and as always, Panorama pages should not be Landscape.</p>
<p><strong>IE NOTE</strong></p>
<p>The Internet Explorer browser has an auto complete box in Portrait mode only. In Landscape, it is hidden – and although I don’t have the official word, I believe it is because the software keyboard takes up most of the screen, leaving no space to select items.</p>
<p>So I think the UX guidance is to NOT show auto completes in landscape, but you’re welcome to try. You could add special app logic similar to this to try and fix the problem, but it isn’t pretty:</p>
<ul>
<li>Attach to the GotFocus and LostFocus events of the text box in the template (requires some visual tree logic code) </li>
<li>In your GotFocus handler, if the page is in one of the Landscape modes… you’ll want to open up additional visual space above your page content. </li>
<li>Temporarily collapse the page title and perhaps its header (very involved if it is a pivot control!) </li>
<li>When the focus is lost, you want to restore that content. The platform should handle “scrolling” around the viewport in this mode to maximize screen real estate. </li>
</ul>
<h3>Items source size warning</h3>
<p>One thing to callout is that the implementation of AutoCompleteBox was originally designed for use on powerful desktops, so the key code path for filtering is designed to be run on the user interface thread. On the Windows Phone, with a single core and mobile ARM hardware, this can be a bottleneck for apps.</p>
<p>Please consider keeping the number of items under 100 if possible, and if you need more, you may need to consider ways to use the “Populating” method to spin up your own filtering work on a background thread (not covered in this post).</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2011/03/acb-in-pivot/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Introducing the February 2011 Silverlight for Windows Phone Toolkit</title>
		<link>http://www.jeff.wilcox.name/2011/02/feb2011-sl4wptk/</link>
		<comments>http://www.jeff.wilcox.name/2011/02/feb2011-sl4wptk/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 02:48:58 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/?p=761</guid>
		<description><![CDATA[Announcing the Feb 2011 release of the Silverlight for Windows Phone Toolkit, adding tilt and performance progress bars, and addressing customer-reported issues.]]></description>
			<content:encoded><![CDATA[<p>Today we pushed the button on the <a href="http://silverlight.codeplex.com/releases/view/60291">February 2011 release</a> of the <a href="http://silverlight.codeplex.com/">Silverlight for Windows Phone Toolkit</a>. We’ve added a few new controls that previously app developers had to pick up separately while working on polishing their apps, including the tilt effect and performance progress bar. VB samples, too!</p>
<p><a href="http://silverlight.codeplex.com/releases/view/60291"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Feb 2011 Toolkit Release" border="0" alt="Februrary 2011 Toolkit Release" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/02/FeburaryToolkitRelease.png" width="685" height="78" /></a></p>
<p>Please download the new <a href="http://silverlight.codeplex.com/releases/view/60291">Silverlight for Windows Phone Toolkit release here</a>. This is a great download to pair with your updated <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=49B9D0C5-6597-4313-912A-F0CCA9C7D277">January 2011 Windows Phone Developer Tools</a> installation.</p>
<h2>What’s new?</h2>
<h3>Tilt effect</h3>
<p>We have integrated the TiltEffect attached property, allowing developers to really easily turn on the “tilt effect” in this apps, automatically giving buttons, hyperlinks and check boxes the desired tilt effect that is found in many parts of the Windows Phone experience.</p>
<p>MSDN documents are available for this feature:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ff941094(VS.92).aspx">Tilt Effect Overview for Windows Phone</a> </li>
<li><a href="http://msdn.microsoft.com/en-us/library/ff941108(v=VS.92).aspx">How to: Use the Control Tilt Effect for Windows Phone</a> </li>
</ul>
<p>This is the same control that was once presented on <a href="http://blogs.msdn.com/b/ptorr/archive/2010/08/11/updated-tilt-effect.aspx">Peter Torr’s blog</a> and became <a href="http://msdn.microsoft.com/en-us/library/ff941094(VS.92).aspx">a sample</a>, now much easier to use.</p>
<h3>PerformanceProgressBar</h3>
<p>There have been several PerformanceProgressBar iterations, and finally there is one available built-in to the Silverlight for Windows Phone Toolkit.</p>
<p>This version is very easy to use, you can just drop it on a page, without needing to specify styles like earlier workarounds. Also, it smoothly animates out in an improved way, improving the visual attractiveness of apps.</p>
<p>Simply bind to or set the IsIndeterminate property to get the visual effect. There is no need to visually collapse this implementation.</p>
<p>For some history and other information,</p>
<ul>
<li><a href="http://www.jeff.wilcox.name/2010/08/performanceprogressbar/">The original PerformanceProgressBar post</a> </li>
<li><a href="http://msdn.microsoft.com/en-us/library/gg442303(v=VS.92).aspx">MSDN documentation about the initial work-around I proposed</a> </li>
</ul>
<h3>Bug fixes and feature improvements</h3>
<p>We’ve addressed customer-requested issues and improvements, most in the LongListSelector and transitions space.</p>
<h2>VB.NET Samples</h2>
<p>Now that Visual Basic support is available for Windows Phone, we are pleased to now offer the same sample project we ship with the toolkit, now in VB.NET.</p>
<p>To use VB.NET with Windows Phone apps, you also need this <a href="http://create.msdn.com/en-US/vbrtm">easy download</a>.</p>
<h2>A 1 minute click-through of new features in the sample app</h2>
<p>Here’s a quick video of the emulator running the samples project included with the source download.</p>
<p><object width="680" height="540"><param name="movie" value="http://www.youtube-nocookie.com/v/iTl_MpbDeCQ?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/iTl_MpbDeCQ?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="680" height="540"></embed></object></p>
<p>In the video, you see:</p>
<ul>
<li>The tilt effect in use on the main page </li>
<li>The LongListSelector, which has received a number of improvements and bug fixes </li>
<li>The performance progress bar, including a quick demonstration where the blue progress bar (the PerformanceProgressBar in the toolkit) competes against the red standard ProgressBar with the user interface thread blocked. Also, the blue performance progress bar automatically fades out, yielding a smooth UX polish for your apps. </li>
<li>The tilt effect page, where you see a button, checkbox, and hyperlinkbutton being touched, responding with the tilt effect underneath. </li>
</ul>
<h2>Earlier phone toolkit features</h2>
<p>As always, there are other useful features for app developers built into the toolkit, including:</p>
<ul>
<li>AutoCompleteBox </li>
<li>ContextMenu </li>
<li>DatePicker &amp; TimePicker </li>
<li>Gestures </li>
<li>ListPicker </li>
<li>LongListSelector </li>
<li>ToggleSwitch </li>
<li>Transitions </li>
<li>WrapPanel </li>
</ul>
<h2>Addressing touch responsiveness and list scrolling</h2>
<p>One thing that we’re still trying to find the best solution to is list scrolling. The LongListSelector (LLS) control was designed to help address some of these issues, but we know that we aren’t there yet.</p>
<p>I’ve had conversations with a number of developers both at Microsoft, within the product teams, and with the community out there, to try and compile a list of issues, asks and possible solutions.</p>
<p>We know, for instance, that there are issues with the use of the TouchPanel component that the gesture service is built on, and we want to find a good solution for that.</p>
<p>At this time, LongListScroller is the best recommendation for most apps that need to do grouping, where the standard virtualizing ListBox is not enough.</p>
<h2>A more active CodePlex site</h2>
<p>Another administrative note, we’re trying to keep the CodePlex site at <a href="http://silverlight.codeplex.com/">http://silverlight.codeplex.com/</a> a little more up-to-date than in the past. You’ll notice that work items should be responded too, and we’re going to keep porting bugs between our Microsoft systems and the external site.</p>
<p>One experiment that we’re doing with the phone toolkit is that we are offering many bug fixes <strong>as they happen</strong> as opposed to at release time; in fact, since the November 2010 Silverlight for Windows Phone Toolkit release, we’ve checked in multiple updates to the source to address customer feedback, marketplace ingestion issues, and transition bugs.</p>
<p>You can view the latest source code and related check-ins at <a title="http://silverlight.codeplex.com/SourceControl/list/changesets" href="http://silverlight.codeplex.com/SourceControl/list/changesets">http://silverlight.codeplex.com/SourceControl/list/changesets</a>&#160;</p>
<p>Let us know what you think of this more transparent way of working. Hope this helps. (<a href="http://silverlight.codeplex.com/releases/view/60291">Download link</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2011/02/feb2011-sl4wptk/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Notes on Silverlight and Phone Toolkits, Testing and Other Phone Stuff</title>
		<link>http://www.jeff.wilcox.name/2011/02/notes-for-2011/</link>
		<comments>http://www.jeff.wilcox.name/2011/02/notes-for-2011/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 21:59:25 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2011/02/notes-for-2011/</guid>
		<description><![CDATA[Just a few notes: new phone tools, an upcoming phone toolkit, source is out already, and other things...]]></description>
			<content:encoded><![CDATA[<p>Hello readers, and happy 2011. It’s been a very busy January, and just now I am preparing a number of exciting new posts to get things going again. Until then, here are some small notes and previews on the Windows Phone tools, the Silverlight for Windows Phone Toolkit, the Silverlight Toolkit, and the Silverlight Unit Test Framework.</p>
<h2>Windows Phone Developer Tools January 2011 update</h2>
<p><a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=49B9D0C5-6597-4313-912A-F0CCA9C7D277"><img style="background-image: none; border-right-width: 0px; margin: 0px 6px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="January2011Tools" border="0" alt="January2011Tools" align="left" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/02/January2011Tools.png" width="128" height="128" /></a>The long-rumored Windows Phone 7 update is even closer, a <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=49B9D0C5-6597-4313-912A-F0CCA9C7D277">new developer release download is now available</a>. Please do update to the tools now! You can continue to use the tools to build apps for the marketplace today. (<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=49B9D0C5-6597-4313-912A-F0CCA9C7D277">Release notes</a>)</p>
<p>New functionality: <strong>Copy and paste support for apps</strong>. It just works in your apps, too, so that’s nice – no special action required to enable it for controls. Text boxes, password boxes, and the browser control “just work”.</p>
<p>This is yet another set of patches on top of the original tools download, so it’s not a pretty update, but it is worth the multiple downloads.</p>
<h3 style="clear: all">Rebuilding your applications that use Panorama, Pivot, and Maps</h3>
<p>You might want to rebuild your application and resubmit it to the marketplace if you meet a few conditions:</p>
<ul>
<li>Were using the Bing Maps control <em>without the October 2010 patch</em>. There were a number of key bugs fixed in that release. It is now build into the 1/2011 tools.</li>
<li>Were using text boxes inside of a Panorama or Pivot control. Copy and paste doesn’t work so hot due to some manipulation bugs in the Pano+Pivot libraries.</li>
<li>Were wanting to use a Bing Map inside of a Panorama or Pivot.</li>
</ul>
<p>The reason that you have to rebuild is because these are “client libraries” that are built into your actual .Xap that goes to end users, so to get the goodness of these changes, you have to resubmit a new Xap with these updated client library bits in them.</p>
<h3>Looking at Copy and Paste in action</h3>
<p>So if you have an app that uses text box, you’re ready to go. Here’s what it looks like when you use the newest tools build, that contains the ROM image with copy &amp; paste built into the framework.</p>
<h4>Select some text in the text box</h4>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2011/02/copy1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="copy1" border="0" alt="copy1" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/02/copy1_thumb.png" width="476" height="552" /></a></p>
<h4>Click the copy indicator button near the selection</h4>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2011/02/copy2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="copy2" border="0" alt="copy2" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/02/copy2_thumb.png" width="457" height="352" /></a></p>
<h4>In the SIP (software keyboard), click the paste icon to insert it!</h4>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2011/02/copy3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="copy3" border="0" alt="copy3" src="http://www.jeff.wilcox.name/wp-content/uploads/2011/02/copy3_thumb.png" width="449" height="203" /></a></p>
<p>There is no programmatic API to access the clipboard at this time.</p>
<h2>Silverlight for Windows Phone Toolkit February 2011 release is brewing</h2>
<p>We’ve been addressing customer-reported bugs and issues with the previous <a href="http://silverlight.codeplex.com/">Silverlight for Windows Phone Toolkit</a> release, and are getting close to having something ready. As we’ve always been a small, agile, dedicated team, we’re trying to fix up a few last-minute issues before pushing the button.</p>
<p>We will also be adding Visual Basic samples this time around.</p>
<p>Some of the fixes you can look forward to:</p>
<ul>
<li>Improved transitions experience including a timing fix and new easing functions to better match the phone UX. Oftentimes the transitions would not appear on the device when complex pages were being navigated to.</li>
<li>Large set of LongListSelector (LLS) control improvements and bug fixes.</li>
<li>An AutoCompleteBox crash fix.</li>
<li>Other minor customer bug fixes (as indicated in the work items tracker)</li>
<li>The November updates addressing marketplace ingestion issues</li>
</ul>
<h3>About bleeding-edge phone toolkit source</h3>
<p>Something we are trying with the phone toolkit now is offering important fixes and other changes directly in the source control, ahead of the next official binary release. This allows us to better serve folks by offering a preview of what’s coming.</p>
<p>Here’s where you go to list all the changesets we’ve submitted for the toolkit source: <a href="http://silverlight.codeplex.com/SourceControl/list/changesets">http://silverlight.codeplex.com/SourceControl/list/changesets</a>&#160;</p>
<p>If you build the source for the toolkit in your project, then you can easily get these new changes. And, you’re an honorary member of the Silverlight Toolkit testing team <img src='http://www.jeff.wilcox.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  since you can help us uncover issues and send feedback ahead of the larger release.</p>
<p>This kind of input is super important. We’ll try not to push bugs to the source control, but it can happen!</p>
<h2>Open source notes on the Silverlight Toolkit</h2>
<p>It’s very exciting being a part of the <a href="http://silverlight.codeplex.com/">Silverlight Toolkit</a> and its sister release, the Silverlight for Windows Phone Toolkit. The large source tree is a great learning resource for Silverlight developers everywhere w.r.t. custom control development. But it is also true that we don’t accept external contributions to the toolkit at this time, it is a pull-only repository. You’re free to fork it into your projects and enjoy it as you like, but if you submit patches to the site, we unfortunately cannot use them. Recently we updated the homepage of the Silverlight Toolkit to note this, since we don’t want to waste anyone’s time creating patches that cannot be used (sorry!).</p>
<p>Here are a few notes specific to the toolkit for Microsofties, however…</p>
<h3>If you are a Microsoft dev</h3>
<p>If you are a full-time Microsoft employee and using the Silverlight (or phone) Toolkit, we’re happy for that, and are definitely interested in accepting any bug fixes or improvements to the existing controls. Just send me an e-mail to talk about this, since we do have a set of guidelines and process for this sort of thing.</p>
<p>We recently had a number of great unit test fixes come in this way, and appreciate the help, since we often can only focus on one release of technology at a time.</p>
<h3>If you are a Microsoft team</h3>
<p>Microsoft teams looking to use the Silverlight Toolkit can find more information at <a href="http://devdiv/sites/controls/">this internal link</a>.</p>
<h3>If you want to be a Microsoft developer</h3>
<p>We’re always hiring – find out more at the <a href="http://careers.microsoft.com/">http://careers.microsoft.com/</a>.</p>
<h2>Silverlight Unit Testing Updates coming soon</h2>
<p>There have been a flurry of bug fixes checked into our source control system for the unit test framework, powered by customer-reported issues and a few generous developers inside Microsoft who have contributed improvements that their teams have been using.</p>
<p>Some of the fixes and changes include:</p>
<ul>
<li>Phone unit test framework interface fixes</li>
<li>Automated test service fixes (restores command-line test execution)</li>
<li>Browser automation fixes</li>
<li>Targets file fixes</li>
<li>Additional metadata for test methods</li>
</ul>
<p>When I have new builds ready and blogged, I’ll also be updating the source on the public CodePlex site. No timeline for this yet, though; sorry.</p>
<h2>Yup, I’m building an app…</h2>
<p>If you follow my Twitter stream (<a href="http://www.twitter.com/jeffwilcox">@jeffwilcox</a>), you know that I often spend my evenings and weekends coding. I’ve been building a social app for Windows Phone and it has been a really fun (and challenging) process building an app from the ground-up.</p>
<p>Once the app is finished, I will be covering in detail the challenges and issues I encountered, and strategies for dealing with many of the issues large apps are hitting. I’m also trying to get the best guidance on improving scrolling performance in lists, and have spoken with a number of devs about this recently.</p>
<h2>Great 2010</h2>
<p>I also wanted to take this time to thank everyone that I’ve had the pleasure of interacting with in the past year. It’s been exciting, bringing our new platform to light, leveraging years of hard work we have done on the Silverlight team.</p>
<p>This was nice for me as I was able to meet other folks at Microsoft worldwide, developers in so many places, and sit with smart engineers from other companies for a change. Well worth the price paid sitting in the back of planes. I swear I could walk through SEA-TAC airport with my eyes closed now.</p>
<p>Thanks, happy new year, and enjoy the Super Bowl if you’re in the states and into American football.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2011/02/notes-for-2011/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>A small but important UX improvement for ScrollViewer on the Windows Phone</title>
		<link>http://www.jeff.wilcox.name/2010/12/betterscrollviewer/</link>
		<comments>http://www.jeff.wilcox.name/2010/12/betterscrollviewer/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 07:32:13 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Control Development]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/12/betterscrollviewer/</guid>
		<description><![CDATA[Here’s a quick UX improvement to the scroll viewer that adds a visual indicator for the user showing them briefly the scroll bars. Interestingly, the actual phone operating system does have this concept of a hint, so I think it’s a smart addition any developer should consider while polishing their app before submission to the [...]]]></description>
			<content:encoded><![CDATA[<p>Here’s a quick UX improvement to the scroll viewer that adds a visual indicator for the user showing them briefly the scroll bars.</p>
<p>Interestingly, the actual phone operating system does have this concept of a hint, so I think it’s a smart addition any developer should consider while polishing their app before submission to the marketplace.</p>
<p>If you aren’t sure what the goal is here, go to the “settings” for the Windows Phone either in the emulator, on the real phone, or hey even the iPhone’s scroll bars all do this, so you have options.</p>
<h3>The user experience problem with the ScrollViewer for WP7</h3>
<p>There is no visual cue to the existence of the scroll bars in Silverlight applications for Windows Phone by default. I don’t know why this wasn’t done for the official control styles in the platform, but being so easy to fix, I think folks should pick this up.</p>
<p>Now that I’m finally doing some fun app coding on the weekends, I intend to share more small tidbits like this and I hope you all appreciate this sort of fit and finish attention.</p>
<p>I have also been downloading and experiencing many of the apps on the Windows Phone Marketplace, with varied success. I’ve had more than one occasion where I was briefly confused, not knowing there was more information just a pan away, since the scroll viewer is effectively invisible until you touch the surface.</p>
<h3>Triggers to the rescue</h3>
<p>Triggers were something WPF developers will remember; back in the day, before we had the magical and designable visual states system. Now if you’re saying “but dude Silverlight doesn’t support triggers,” you’re mostly right. There is, however, support for the Loaded event. So in XAML you can define a storyboard that will run when the control’s loaded event fires, super easy.</p>
<p>Exactly what we want! I want to animate that same opacity from 1 to 0 to match the normal state at startup.</p>
<h3>The BetterScrollViewer Template</h3>
<p>This is a control template, not a style. So remember to set the Template property to the static resource for it to work.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:1af282e3-c034-4a98-a13d-109139a98b23" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;ControlTemplate TargetType="ScrollViewer" x:Key="BetterScrollViewer"&gt;
    &lt;Grid Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}"&gt;
        &lt;Grid.Triggers&gt;
            &lt;EventTrigger RoutedEvent="Grid.Loaded"&gt;
                &lt;BeginStoryboard&gt;
                    &lt;Storyboard&gt;
                        &lt;DoubleAnimation Duration="00:00:01.5" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="VerticalScrollBar"/&gt;
                        &lt;DoubleAnimation Duration="00:00:01.5" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HorizontalScrollBar"/&gt;
                    &lt;/Storyboard&gt;
                &lt;/BeginStoryboard&gt;
            &lt;/EventTrigger&gt;
        &lt;/Grid.Triggers&gt;
        &lt;VisualStateManager.VisualStateGroups&gt;
            &lt;VisualStateGroup x:Name="ScrollStates"&gt;
                &lt;VisualStateGroup.Transitions&gt;
                    &lt;VisualTransition GeneratedDuration="00:00:00.5"/&gt;
                &lt;/VisualStateGroup.Transitions&gt;
                &lt;VisualState x:Name="Scrolling"&gt;
                    &lt;Storyboard&gt;
                        &lt;DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="VerticalScrollBar"/&gt;
                        &lt;DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HorizontalScrollBar"/&gt;
                    &lt;/Storyboard&gt;
                &lt;/VisualState&gt;
                &lt;VisualState x:Name="NotScrolling"/&gt;
            &lt;/VisualStateGroup&gt;
        &lt;/VisualStateManager.VisualStateGroups&gt;
        &lt;ScrollContentPresenter x:Name="ScrollContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}"/&gt;
        &lt;ScrollBar x:Name="VerticalScrollBar" HorizontalAlignment="Right" Height="Auto" IsHitTestVisible="False" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Opacity="0" Orientation="Vertical" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" VerticalAlignment="Stretch" Width="5"/&gt;
        &lt;ScrollBar x:Name="HorizontalScrollBar" HorizontalAlignment="Stretch" Height="5" IsHitTestVisible="False" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Opacity="0" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{TemplateBinding HorizontalOffset}" ViewportSize="{TemplateBinding ViewportWidth}" VerticalAlignment="Bottom" Width="Auto"/&gt;
    &lt;/Grid&gt;
&lt;/ControlTemplate&gt;</pre>
</div>
<h3>Using the template</h3>
<p>I place this template in my App.xaml then just set the template every time I use a scroll viewer.</p>
<p><div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:43ea7a63-08dc-4ee3-a1f5-b1a6c5210ff4" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;ScrollViewer
    Template="{StaticResource BetterScrollViewer}"&gt;
&lt;/ScrollViewer&gt;</pre>
</div>
<p>Now if you want this in ListBox, you need to (unfortunately, it’s a pain) re-template ListBox. So any ListBox needs to set the template to something like BetterListBox. This template is exactly the same as the standard one except of course the static resource set in there.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:7ea784f9-2e94-4dd5-924f-56932561e582" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;ControlTemplate TargetType="ListBox" x:Key="BetterListBox"&gt;
	&lt;ScrollViewer x:Name="ScrollViewer"
	Template="{StaticResource BetterScrollViewer}"
	BorderBrush="{TemplateBinding BorderBrush}"
	BorderThickness="{TemplateBinding BorderThickness}"
	Background="{TemplateBinding Background}"
	Foreground="{TemplateBinding Foreground}"
	Padding="{TemplateBinding Padding}"&gt;
		&lt;ItemsPresenter/&gt;
	&lt;/ScrollViewer&gt;
&lt;/ControlTemplate&gt;</pre>
</div>
<p>And to use this with just regular scroll bars, well, you’re on your own, but can use the same trigger mechanism to add it easily I bet.</p>
<h3>Notes + I removed the border!</h3>
<p>This scroll viewer template I modified also reduces the visual count by 1. I didn’t like the idea of having the scroll viewer wrapped in a border and supporting those properties, since I don’t use them. If you want to use those properties though you’ll want to build your own template from the standard to keep those template bindings in place.</p>
<p>If you’re using one of the controls like panorama or pivot, that may do some pre-loading offscreen of items, it is likely that the Loaded event will fire and trigger this animation when the user&#160; cannot actually see it.</p>
<p>So don’t expect this behavior to help in those scenarios. To really polish those you’ll need to jump into code.</p>
<p>And I picked the time of 1.5 seconds for that initial scroll appearance. If I find out from any UX folks I will try and learn what the official value is that’s used on the phone, but in the meantime, 1.5 looks about right to me.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/12/betterscrollviewer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PhoneHyperlinkButton updated: now supports web, email, text and phone call tasks</title>
		<link>http://www.jeff.wilcox.name/2010/12/updated-phone-hyperlink-button/</link>
		<comments>http://www.jeff.wilcox.name/2010/12/updated-phone-hyperlink-button/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 03:06:38 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Control Development]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/12/updated-phone-hyperlink-button/</guid>
		<description><![CDATA[I’ve updated my extended HyperlinkButton control for Windows Phone 7 to now support all the key tasks. This makes it really easy to build up about pages, user profiles, and of course fully supports data binding. So the core phone tasks work well with this. Same story, you set the Tag to be effectively the [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve updated my extended HyperlinkButton control for Windows Phone 7 to now support all the key tasks. This makes it really easy to build up about pages, user profiles, and of course fully supports data binding.</p>
<p>So the core phone tasks work well with this. Same story, you set the Tag to be effectively the Uri. There are a few reasons for this but I admit Tag is the ultimate hack/general property. I’ve also incorporated some earlier feedback from the first version I did; I’m using StartsWith instead of indexing into the Uris.</p>
<p>I’ve also added simple query string support for the tasks, so you can set the basic properties on the messages as well. Note that with the SMS and phone tasks I’ve deviated from the standard RFC 2806 here, so this syntax is specific to this control and supports additional properties that aren’t standard. So the links build on the standard (like you use when building web apps for phones).</p>
<h2>Adding the control to your project</h2>
<p>Just add the following as a class file in VS or Blend. Then, make sure you setup an xmlns for the namespace, and you use it much like a regular HyperlinkButton at that point, except please set or data bind the Tag property as a string or Uri, instead of NavigateUri.</p>
<h2>Example Tags (URIs) &amp; Tasks</h2>
<p>Here are some examples and the specific tasks that are used. Remember in the tag that, to make the XAML parser happy, you need to escape the ampersand as “&amp;amp;”.</p>
<h3>Phone call</h3>
<p>To allow the user the choice of placing a call, use this syntax in the tag. Understand that this won’t actually place the call; the user will be prompted with a allow/don’t allow prompt. It’s up to you to send it a valid phone number though, I’m not error checking this first!</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:52de7dc4-7186-4698-89cf-8d4f6859a9e4" class="wlWriterSmartContent">
<pre class="xml" name="code">&lt;unofficial:PhoneHyperlinkButton
    Tag=&quot;tel:8005551212&quot;
    Content=&quot;Call customer support&quot;/&gt;</pre>
</div>
<p>Optionally you can include a “displayname” property, which will appear to the user along with the phone number that is to be called. Note I’ve encoded the spaces as %20.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:2b5d63c3-b486-4ec9-aca5-c797cb8ea2a7" class="wlWriterSmartContent">
<pre class="xml" name="code">&lt;unofficial:PhoneHyperlinkButton
    Tag=&quot;tel:8005551212?displayname=Some%20Company%20Support&quot;
    Content=&quot;Call customer support&quot;/&gt;</pre>
</div>
<h3>Text message</h3>
<p>Just like the “tel” URI syntax, text messaging starts with “sms:” and I’ve added another parameter, body, which will be the initial text message content. The user can add to it, remove that body, or use the back button to cancel the sending of the text.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:eea462bb-3f27-4424-bf01-b64c68d817e2" class="wlWriterSmartContent">
<pre class="xml" name="code">&lt;unofficial:PhoneHyperlinkButton
    Tag=&quot;sms:8005551212&quot;
    Content=&quot;Text a friend&quot; /&gt;

&lt;unofficial:PhoneHyperlinkButton
    Tag=&quot;sms:8005551212?body=Hello&quot;
    Content=&quot;Text a friend hello&quot; /&gt;</pre>
</div>
<h3>Email composition</h3>
<p>Building on the earlier implementation that only supported the “to” address, I’m matching most of the standard mailto: URI expectations by now adding support for body, cc, and subject query string parameters.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:4dbd85d2-8872-49cc-9ce2-cd6c83b360e6" class="wlWriterSmartContent">
<pre class="xml" name="code">&lt;unofficial:PhoneHyperlinkButton
    Tag=&quot;mailto:spam@spam.com?subject=Hello%20World&amp;cc=spammer@spam.com&amp;body=Hey%20spam.&quot;
    Content=&quot;Send an email&quot; /&gt;</pre>
</div>
<h3>Default task: Web browser</h3>
<p>Anything that doesn’t start with mailto, sms, or tel, will be sent to the web browser.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:4db236e2-5c4f-4070-9a01-dfddf68703cc" class="wlWriterSmartContent">
<pre class="xml" name="code">&lt;unofficial:PhoneHyperlinkButton
    Tag=&quot;http://create.msdn.com/&quot;
    Content=&quot;Develop Windows Phone Apps&quot; /&gt;</pre>
</div>
<h2>Styling note</h2>
<p>So the default hyperlink button will show the text as content, underlined, but I actually prefer a slightly different set of styles in my own applications. Here are two I use: “EmptyHyperlinkButton” and “AccentHyperlinkButton”.</p>
<p>These can be used with <em>any</em> hyperlink button, even if they aren’t my PhoneHyperlinkButton, since the control template is simple and shared among all derived types.</p>
<h3>EmptyHyperlinkButton</h3>
<p>I use this for more complex user interface areas, where I might actually have a stack panel full of a few different things as the content. This is a hyperlink button technically, but hardly looks like it, other than respecting very basic padding/margin values, it has no appearance. I’ve also removed the VSM styles to make it very simple.</p>
<p>I’m also using a content presenter here.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:624b4134-610c-440e-b628-77efd2603a40" class="wlWriterSmartContent">
<pre class="xml" name="code">&lt;Style x:Key=&quot;EmptyHyperlink&quot; TargetType=&quot;HyperlinkButton&quot;&gt;
    &lt;Setter Property=&quot;Background&quot; Value=&quot;Transparent&quot; /&gt;
    &lt;Setter Property=&quot;Padding&quot; Value=&quot;0&quot; /&gt;
    &lt;Setter Property=&quot;Template&quot;&gt;
        &lt;Setter.Value&gt;
            &lt;ControlTemplate TargetType=&quot;HyperlinkButton&quot;&gt;
                &lt;Border Background=&quot;{TemplateBinding Background}&quot; Margin=&quot;{StaticResource PhoneHorizontalMargin}&quot; Padding=&quot;{TemplateBinding Padding}&quot;&gt;
                    &lt;ContentPresenter HorizontalAlignment=&quot;{TemplateBinding HorizontalContentAlignment}&quot; VerticalAlignment=&quot;{TemplateBinding VerticalContentAlignment}&quot; Content=&quot;{TemplateBinding Content}&quot; /&gt;
                &lt;/Border&gt;
            &lt;/ControlTemplate&gt;
        &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
&lt;/Style&gt;</pre>
</div>
<h3>AccentHyperlinkButton</h3>
<p>I like this simple style. It gives the text a semi-bold effect, colors them to the user’s personalized accent color.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:c040e984-a44c-4fc4-8e5b-f43ccbddb93f" class="wlWriterSmartContent">
<pre class="xml" name="code">&lt;Style
    x:Key=&quot;AccentHyperlink&quot;
    TargetType=&quot;HyperlinkButton&quot;&gt;
    &lt;Setter
        Property=&quot;Foreground&quot;
        Value=&quot;{StaticResource PhoneAccentBrush}&quot; /&gt;
    &lt;Setter
        Property=&quot;Background&quot;
        Value=&quot;Transparent&quot; /&gt;
    &lt;Setter
        Property=&quot;FontSize&quot;
        Value=&quot;{StaticResource PhoneFontSizeMedium}&quot; /&gt;
    &lt;Setter
        Property=&quot;FontFamily&quot;
        Value=&quot;{StaticResource PhoneFontFamilySemiBold}&quot; /&gt;
    &lt;Setter
        Property=&quot;Padding&quot;
        Value=&quot;0&quot; /&gt;
    &lt;Setter
        Property=&quot;Template&quot;&gt;
        &lt;Setter.Value&gt;
            &lt;ControlTemplate
                TargetType=&quot;HyperlinkButton&quot;&gt;
                &lt;Border
                    Background=&quot;{TemplateBinding Background}&quot;
                    Margin=&quot;{StaticResource PhoneHorizontalMargin}&quot;
                    Padding=&quot;{TemplateBinding Padding}&quot;&gt;
                    &lt;VisualStateManager.VisualStateGroups&gt;
                        &lt;VisualStateGroup
                            x:Name=&quot;CommonStates&quot;&gt;
                            &lt;VisualState
                                x:Name=&quot;Normal&quot; /&gt;
                            &lt;VisualState
                                x:Name=&quot;MouseOver&quot; /&gt;
                            &lt;VisualState
                                x:Name=&quot;Pressed&quot;&gt;
                                &lt;Storyboard&gt;
                                    &lt;DoubleAnimation
                                        Duration=&quot;0&quot;
                                        Storyboard.TargetName=&quot;TextElement&quot;
                                        Storyboard.TargetProperty=&quot;Opacity&quot;
                                        To=&quot;0.5&quot; /&gt;
                                &lt;/Storyboard&gt;
                            &lt;/VisualState&gt;
                            &lt;VisualState
                                x:Name=&quot;Disabled&quot;&gt;
                                &lt;Storyboard&gt;
                                    &lt;ObjectAnimationUsingKeyFrames
                                        Storyboard.TargetName=&quot;TextElement&quot;
                                        Storyboard.TargetProperty=&quot;Foreground&quot;&gt;
                                        &lt;DiscreteObjectKeyFrame
                                            KeyTime=&quot;0&quot;
                                            Value=&quot;{StaticResource PhoneDisabledBrush}&quot; /&gt;
                                    &lt;/ObjectAnimationUsingKeyFrames&gt;
                                &lt;/Storyboard&gt;
                            &lt;/VisualState&gt;
                        &lt;/VisualStateGroup&gt;
                    &lt;/VisualStateManager.VisualStateGroups&gt;
                    &lt;TextBlock
                        x:Name=&quot;TextElement&quot;
                        Text=&quot;{TemplateBinding Content}&quot;
                        HorizontalAlignment=&quot;{TemplateBinding HorizontalContentAlignment}&quot;
                        VerticalAlignment=&quot;{TemplateBinding VerticalContentAlignment}&quot; /&gt;
                &lt;/Border&gt;
            &lt;/ControlTemplate&gt;
        &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
&lt;/Style&gt;</pre>
</div>
<h2>PhoneHyperlinkButton.cs</h2>
<p>And the goods to drop in your project:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:d01b176e-253c-4bb7-8286-429a58a869bb" class="wlWriterSmartContent">
<pre class="c-sharp" name="code">// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Windows.Controls;
using Microsoft.Phone.Tasks;

namespace Microsoft.Phone.Controls.Unofficial
{
    /// &lt;summary&gt;
    /// An extended HyperlinkButton control that uses the Tag property to
    /// open the web browser, compose an e-mail, text message, or make a call.
    /// &lt;/summary&gt;
    public class PhoneHyperlinkButton : HyperlinkButton
    {
        /// &lt;summary&gt;
        /// Handles the click event.
        /// &lt;/summary&gt;
        protected override void OnClick()
        {
            base.OnClick();

            Debug.Assert(Tag is string, &quot;You need to set the Tag property!&quot;);
            string tag = Tag as string;
            if (tag == null)
            {
                // This should support data binding to Uri.
                tag = Tag.ToString();
            }

            IDictionary&lt;string, string&gt; d;

            if (tag.StartsWith(&quot;mailto:&quot;))
            {
                Email(tag.Substring(7));
            }
            else if (tag.StartsWith(&quot;tel:&quot;))
            {
                // RFC 2806 only defines the basics of a number component.
                // However, since the Windows Phone supports the concept of
                // sending a name to display as well, I have deviated.
                // tel:8005221212&amp;displayname=Unknown%20Caller
                PhoneCallTask pct = new PhoneCallTask();
                pct.PhoneNumber = GetAddress(tag.Substring(4), out d);

                string name;
                if (d.TryGetValue(&quot;displayname&quot;, out name))
                {
                    pct.DisplayName = name;
                }

                pct.Show();
            }
            else if (tag.StartsWith(&quot;sms:&quot;))
            {
                // Also not really an official syntax for SMS.
                // sms:8005551212&amp;body=Hello%20there!
                SmsComposeTask sct = new SmsComposeTask();
                sct.To = GetAddress(tag.Substring(4), out d);

                string body;
                if (d.TryGetValue(&quot;body&quot;, out body))
                {
                    sct.Body = body;
                }

                sct.Show();
            }
            else
            {
                // Assume the web.
                WebBrowserTask wbt = new WebBrowserTask
                {
                    URL = (string)Tag,
                };
                wbt.Show();
            }
        }

        private void Email(string s)
        {
            IDictionary&lt;string, string&gt; d;
            string to = GetAddress(s, out d);

            EmailComposeTask ect = new EmailComposeTask
            {
                To = to,
            };

            string cc;
            if (d.TryGetValue(&quot;cc&quot;, out cc))
            {
                ect.Cc = cc;
            }

            string subject;
            if (d.TryGetValue(&quot;subject&quot;, out subject))
            {
                ect.Subject = subject;
            }

            string body;
            if (d.TryGetValue(&quot;body&quot;, out body))
            {
                ect.Body = body;
            }

            ect.Show();
        }

        private static string GetAddress(string input, out IDictionary&lt;string, string&gt; query)
        {
            query = new Dictionary&lt;string, string&gt;(StringComparer.Ordinal);
            int q = input.IndexOf('?');
            string address = input;
            if (q &gt;= 0)
            {
                address = input.Substring(0, q);
                ParseQueryStringToDictionary(input.Substring(q + 1), query);
            }
            return address;
        }

        private static void ParseQueryStringToDictionary(string queryString, IDictionary&lt;string, string&gt; dictionary)
        {
            foreach (string str in queryString.Split(&quot;&amp;&quot;.ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
            {
                int index = str.IndexOf(&quot;=&quot;, StringComparison.Ordinal);
                if (index == -1)
                {
                    dictionary.Add(HttpUtility.UrlDecode(str), string.Empty);
                }
                else
                {
                    dictionary.Add(HttpUtility.UrlDecode(str.Substring(0, index)), HttpUtility.UrlDecode(str.Substring(index + 1)));
                }
            }
        }
    }
}</pre>
</div>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/12/updated-phone-hyperlink-button/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>A quick and easy extension to HyperlinkButton for Windows Phone 7</title>
		<link>http://www.jeff.wilcox.name/2010/11/phonehyperlinkbutton/</link>
		<comments>http://www.jeff.wilcox.name/2010/11/phonehyperlinkbutton/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 04:48:01 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Control Development]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/11/phonehyperlinkbutton/</guid>
		<description><![CDATA[A quick and easy HyperlinkButton-derived control for Windows Phone that lets you set the Tag to an e-mail or web address and get the associated task goo for free.]]></description>
			<content:encoded><![CDATA[<p>While doing some application building, I naively assumed that I could just put a web address in the NavigateUri field of the HyperlinkButton control (Windows Phone 7) and have it just magically work.</p>
<p><strong><font color="#ff0000">UPDATED 12/3/2010: </font></strong>I’ve made improvements that you will find here: <a title="http://www.jeff.wilcox.name/2010/12/updated-phone-hyperlink-button/" href="http://www.jeff.wilcox.name/2010/12/updated-phone-hyperlink-button/">http://www.jeff.wilcox.name/2010/12/updated-phone-hyperlink-button/</a>&#160;</p>
<p>Turns out you need to actually handle the Click event yourself and setup the proper task for that, unless you’re doing local within-the-app navigation.</p>
<p>I wrote a super simple PhoneHyperlinkButton control that derives from HyperlinkButton. No custom template or style, so just drop the file into any project and you’re off and running.</p>
<p>Set the “Tag” property of your instance to be the URI or e-mail address you’d like the message to go to: if it starts with mailto:, then it’ll use the EmailComposeTask. Otherwise, the web browser task.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:74b46341-d5c2-4642-906e-feed833d31b7" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System.Diagnostics;
using System.Windows.Controls;
using Microsoft.Phone.Tasks;

namespace Microsoft.Phone.Controls.Unofficial
{
    /// &lt;summary&gt;
    /// An extended HyperlinkButton control that uses the Tag property to
    /// handle web browser or e-mail compose task intended use on the phone.
    /// &lt;/summary&gt;
    public class PhoneHyperlinkButton : HyperlinkButton
    {
        protected override void OnClick()
        {
            base.OnClick();

            Debug.Assert(Tag is string, "You need to set the Tag property!");
            string tag = (string)Tag;

            int i = tag.IndexOf("mailto:");
            if (i &gt;= 0)
            {
                tag = tag.Substring(i + 7);
                EmailComposeTask ect = new EmailComposeTask
                {
                    To = tag,
                };
                ect.Show();
            }
            else
            {
                // Assume the web.
                WebBrowserTask wbt = new WebBrowserTask
                {
                    URL = (string)Tag,
                };
                wbt.Show();
            }
        }
    }
}</pre>
</div>
<p>Hope this helps. Oh, and remember that once the task completes, your app will likely be tombstoned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/11/phonehyperlinkbutton/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MyPhotoApp: Sample project from my Windows Phone development series at Øredev</title>
		<link>http://www.jeff.wilcox.name/2010/11/demo-myphotoapp/</link>
		<comments>http://www.jeff.wilcox.name/2010/11/demo-myphotoapp/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 17:52:51 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[demos]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[oredev]]></category>
		<category><![CDATA[pivot]]></category>
		<category><![CDATA[samples]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/11/demo-myphotoapp/</guid>
		<description><![CDATA[Last week I gave a multi-part series on Windows Phone development at the Øredev conference in Malmö, Sweden. Here is the sample app that was built throughout the talk. It’s a simple app that lets you pick a photoset from Flickr for a given user, then browse the photos in a nice slideshow format (swipe&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I gave a multi-part series on Windows Phone development at the <a href="http://www.oredev.org/2010">Øredev conference</a> in Malmö, Sweden. Here is the sample app that was built throughout the talk. It’s a simple app that lets you pick a photoset from Flickr for a given user, then browse the photos in a nice slideshow format (swipe&#160; to move between the photos). It’s all setup with sweet data binding and goodness.</p>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2010/11/MyPhotoApp.zip">Download the zip</a> and make sure that you have the <a href="http://create.msdn.com/">Windows Phone Development Tools</a> and also the <a href="http://silverlight.codeplex.com/">Silverlight for Windows Phone Toolkit</a>.</p>
<p>This app has a number of things inside it:</p>
<ul>
<li>Simple view models</li>
<li>Simple Flickr web service layer</li>
<li>Integration of the service into the view model</li>
<li>Navigation service passing parameters to pages</li>
<li>Makes use of the <a href="http://json.codeplex.com/">JSON</a> library on CodePlex</li>
<li>Makes use of the Silverlight Toolkit for page transitions and the list picker control</li>
<li>Various examples of templating and styling</li>
<li>The Pivot control for the phone is used as a photo slide show with built-in flick and pan manipulations by not using the header or title properties, and binding the actual items to the photos to be shown</li>
<li>PerformanceProgressBar</li>
</ul>
<p>Things you need to do to get this working:</p>
<ul>
<li>You may need to add the references to the <a href="http://json.codeplex.com/">JSON library</a> as well as the toolkit before it will build for you.</li>
<li>You need a Flickr API key, <a href="http://www.flickr.com/services/apps/create/apply/">get one here</a>.</li>
<li>You need to put your API key inside the FlickrService.cs file on line 23.</li>
<li>Unless you want to browse all my photosets, you’ll want to put your own Flickr user ID string inside of MainPageViewModel.cs line 74.</li>
</ul>
<p>The talks in the series will be uploaded in the coming weeks I’ve been told, but they are not yet available.</p>
<h2>Pivot as a slide show component for photos</h2>
<p>Since pivot has the nice manipulations support built into it, it was super simple to use as a slide show-style photo viewer. Here’s the XAML I used for the slide show page:</p>
<p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:4e3632a9-9910-4c5c-80fd-455485423650" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;controls:Pivot
    ItemsSource="{Binding Photos}"&gt;
    &lt;controls:Pivot.HeaderTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;Grid Height="1" Width="1"/&gt;
        &lt;/DataTemplate&gt;
    &lt;/controls:Pivot.HeaderTemplate&gt;
    &lt;controls:Pivot.ItemTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;Image Source="{Binding ImageUrl}"
                    /&gt;
        &lt;/DataTemplate&gt;
    &lt;/controls:Pivot.ItemTemplate&gt;
    &lt;controls:Pivot.ItemContainerStyle&gt;
        &lt;Style TargetType="controls:PivotItem"&gt;
            &lt;Setter Property="Margin" Value="0"/&gt;
            &lt;Setter Property="Padding" Value="0"/&gt;
        &lt;/Style&gt;
    &lt;/controls:Pivot.ItemContainerStyle&gt;
&lt;/controls:Pivot&gt;</pre>
</div>
<p>Walking through the elements, here is what they do.</p>
<h3>ItemsSource binding</h3>
<p>The view model for the slide show page includes a property that exposes the photo objects. This binds the pivot to that list. This means that without any of the other elements and templates being set, the pivot control will show the type name (Photo) instead of the actual photos.</p>
<p>Here’s the slide show view model file btw:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:fd4331ad-ca66-49f3-843a-ffd56e1de05c" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">public class SlideshowViewModel : ViewModel
{
    private readonly IFlickrService _flickr;
    private bool _isLoading;
    private IEnumerable&lt;Photo&gt; _photos;

    public SlideshowViewModel()
        : this(new FlickrService())
    {
    }

    public SlideshowViewModel(IFlickrService flickrService)
    {
        _flickr = flickrService;
    }

    public bool IsLoading
    {
        get { return _isLoading; }
        private set
        {
            _isLoading = value;
            RaisePropertyChanged("IsLoading");
        }
    }

    public IEnumerable&lt;Photo&gt; Photos
    {
        get { return _photos; }
        set
        {
            _photos = value;
            RaisePropertyChanged("Photos");
        }
    }

    public void LoadPhotos(string photosetId)
    {
        IsLoading = true;
        _flickr.LoadPhotoset(photosetId, photos =&gt; Dispatch(() =&gt;
            {
                if (photos != null)
                {
                    Photos = photos;
                }
                IsLoading = false;
            }));
    }
}</pre>
</div>
<h3>HeaderTemplate data template</h3>
<p>This is a little bit of a Pivot control hack. You actually can set the header to x:Null, but then when you run this under the debugger, you may get a first-chance exception. The pivot control catches and continues, but it’s annoying as a developer.</p>
<p>This workaround, a 1&#215;1 grid, enables a “screen capture” to be taken of the header, avoiding the exception when it isn’t of size:</p>
<p><div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:31221d9d-7cf4-4cb7-885f-2839df85da02" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;controls:Pivot.HeaderTemplate&gt;
    &lt;DataTemplate&gt;
        &lt;Grid Height="1" Width="1"/&gt;
    &lt;/DataTemplate&gt;
&lt;/controls:Pivot.HeaderTemplate&gt;</pre>
</div>
<p>This is all because for this slide show page, we don’t even want to show any headers, we aren’t using that visual part of the pivot ux – we’re just using the slick built-in manipulations logic and animations plus data binding.</p>
<h3>ItemTemplate data template</h3>
<p>This is what translates the data object (Photo) into an actual image that can be loaded.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:ada8f8f9-4a63-4fce-9168-957f065bd307" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;controls:Pivot.ItemTemplate&gt;
    &lt;DataTemplate&gt;
        &lt;Image Source="{Binding ImageUrl}"
                /&gt;
    &lt;/DataTemplate&gt;
&lt;/controls:Pivot.ItemTemplate&gt;</pre>
</div>
<p>The binding to ImageUrl is for the property on the Photo data object. Sorry it was a string instead of a Uri, cheap and easy on my side I suppose.</p>
<p><div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:b0ad5a43-253a-44f7-8085-79cd22a7296e" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">namespace MyPhotoApp.Flickr
{
    public class Photo
    {
        public string Id { get; set; }
        public string Title { get; set; }
        public string ImageUrl { get; set; }
    }
}
</pre>
</div>
<p>So this way the image will automatically load. A nice improvement I should have made was write some better code to make sure the images are ready to go and maybe even fade in as they’re downloaded, but for a two-minute slide show, this was all pretty easy.</p>
<h3>ItemContainerStyle for PivotItems</h3>
<p>By default, the user experience guidelines for the pivot control and pivot items are nicely set in the default styles and templates. You’ll note without using the item container style that there is spacing between the edge of the photos and the edge of the phone’s screen.</p>
<p>This is the 12 pixel margin on the left and right of the pivot items; when using the standard phone styles for things like buttons and textblocks, which include another 12px margin, this means there should be 24px on the left and right of the actual visual things inside the pivot. Things align nicely in that situation.</p>
<p>But this is a photo viewer, so we actually want to show as much of the photos as possible – so this container style says “for each new item we are creating, let’s just set the margin and padding properties to 0!”.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:3010caac-244d-49bd-9501-20d2479d30bd" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;controls:Pivot.ItemContainerStyle&gt;
    &lt;Style TargetType="controls:PivotItem"&gt;
        &lt;Setter Property="Margin" Value="0"/&gt;
        &lt;Setter Property="Padding" Value="0"/&gt;
    &lt;/Style&gt;
&lt;/controls:Pivot.ItemContainerStyle&gt;</pre>
</div>
<h2>Navigation service usage</h2>
<p>Inside this app, the navigation service is used to go to the slideshow page. Since the slideshow page has its nice view model data bound into the DataContext, I need to use the navigation service to get the photoset ID into the page. By using the URI inside the nav service instead of using a global variable or app-level call or property set, this means that the tombstoning for the app just works.</p>
<p>If you press the Start key while in a photoset, then hit back, you’ll come back to that photoset instead of the homepage for the app.</p>
<p>Now being a sample/demo app, I didn’t fully implement the right tombstoning behavior: I also should have actually stored the pivot selected index and restored that, so they would be on the same photo, etc. I also don’t using isolated storage in this app for simplicity sake, but that must be done for a real production app of course.</p>
<p>I also don’t properly do null/empty string checks in the calls, so if no photosets are returned and you try navigating, you’ll get a null ref exception. It’s demo code!</p>
<h3>Moving to the sub-page</h3>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:bff2b55a-702b-4780-8075-74eb3c8981fa" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">private void OnButtonClick(object sender, RoutedEventArgs e)
{
    NavigationService.Navigate(new Uri(
        string.Format(
        "/Views/SlideshowPage.xaml?id={0}",
        ((Photoset)SetList.SelectedItem).Id),
        UriKind.Relative));
}</pre>
</div>
<h3>Getting the photoset from the URI in the slideshow page</h3>
<p>In the page’s OnNavigatedTo event handler, I read the property from the query string if I can. I only load photos if I find a photoset ID. This does have the trouble that you’ll see a blank bit of nothing if there are no photos returned.</p>
<p>Also if you look at the implementation, you’ll note that the loading automatically happens in the view model – so I don’t have to have the code in the slideshow file worry at all about whether to show the loading indicator or not. That’s all declaratively setup in XAML. Nice.</p>
<p><div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:959455a6-6054-43c1-bd52-7195040c4e1b" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">protected override void OnNavigatedTo(NavigationEventArgs e)
{
    base.OnNavigatedTo(e);

    var context = DataContext as SlideshowViewModel;
    if (context != null)
    {
        string id;
        if (NavigationContext.QueryString.TryGetValue("id", out id))
        {
            context.LoadPhotos(id);
        }
    }
}
</pre>
</div>
<p>And since all IDs in Flickr are to be treated as UTF8 strings, I don’t have to parse or convert the string value from the query string into an integer or anything like that.</p>
<h4>General memory note</h4>
<p>Note that you’ll want to watch your <a href="http://blogs.msdn.com/b/ptorr/archive/2010/10/30/that-memory-thing-i-promised-you.aspx">memory consumption</a> if you go this route.</p>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2010/11/MyPhotoApp.zip">MyPhotoApp.zip download</a>. Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/11/demo-myphotoapp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WP7 Panorama: Smoothly fading the background (and enabling fading when changing, too)</title>
		<link>http://www.jeff.wilcox.name/2010/11/wp7-panorama-smooth-background-changing/</link>
		<comments>http://www.jeff.wilcox.name/2010/11/wp7-panorama-smooth-background-changing/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 02:08:47 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/11/wp7-panorama-smooth-background-changing/</guid>
		<description><![CDATA[I’ve heard a number of conversations with developers about wanting to smoothly fade in background image changes within the Panorama control that ships in the Windows Phone 7 Developer Tools. I spent the better part of this rainy Seattle Sunday looking into this. I actually had a conversation with the famed Kelly Sommers (@kellabyte) a [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve heard a number of conversations with developers about wanting to smoothly fade in background image changes within the Panorama control that ships in the <a href="http://create.msdn.com/">Windows Phone 7 Developer Tools</a>.</p>
<p>I spent the better part of this rainy Seattle Sunday looking into this. I actually had a conversation with the famed <a href="http://kellabyte.com/">Kelly Sommers</a> (<a href="http://twitter.com/kellabyte">@kellabyte</a>) a few months ago about implementing a Panorama whose Background was automatically set to the daily Bing image, and was recently inspired by an internal developer discussion at Microsoft.</p>
<p>Here’s a video of the sample project where I was able to do just that, and more! The control takes care of smoothly fading any background property change, and the sample project grabs the daily Bing image to show in there as a sample, too.</p>
<p><object type="application/x-shockwave-flash" width="685" height="389" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&amp;photo_secret=d96b9daf9e&amp;photo_id=5176150607&amp;hd_default=false"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&#038;photo_secret=d96b9daf9e&#038;photo_id=5176150607&#038;hd_default=false" height="389" width="685"></embed></object></p>
<p>So if you just want to jump in, the source is all up in the sample project in <a href="http://www.jeff.wilcox.name/wp-content/uploads/2010/11/DynamicPanoramaBackgrounds.zip">DynamicPanoramaBackgrounds.zip download (1.2 MB)</a>.</p>
<p>Feel free to use this in your own projects, it’s a simple set of extensions. This sort of effect is nice, but I’m personally glad that it isn’t built into the framework by default: there’s definitely some fixed performance cost to this sort of dynamic effect in the platform today.</p>
<p>I did a lot of testing on my phone and didn’t run into any noticeable performance issues, but beware that this implementation will increase the fill rate and have an effect over the standard, so don’t just use it without evaluating how important the scenario is to your apps. Note that this isn’t designed to do well when moving between background Brush types, or images of massively different sizes – but if they are all the same or similar, it should just work well!</p>
<h2>Using ‘DynamicBackgroundPanorama’</h2>
<p>Just set the Background property of the Panorama!</p>
<p>You can use data binding, or just straight code, for this. The example sample I wrote has two sub pages: one which just shows the current Bing search background for your region, and another which shows some photos that are just built into the project. No special work required!</p>
<p>I’ve packaged the control and its various components into the sample project instead of building out a standalone class library, so if you place it in your project, make sure you pick up all its individual files, including the Generic\Themes.xaml file that contains the default styles.</p>
<h3>Contrasting image note</h3>
<p>I haven’t addressed the contrasting image issue in this implementation. Ideally a second brush might be exposed, to allow for a translucent overlay of color such as a transparent black, over the backgrounds. This would help with keeping the contrast more appropriate, but I didn’t want to as it would increase the fill rate even more.</p>
<h2>Designing the primitive(s)</h2>
<p>It’s pretty straightforward to think about, but difficult to implement without also building out a few primitive controls to help with the re-templating experience.</p>
<p>So in designing the right implementation, I decided to mimic the same design ideas that went into the TransitioningContentControl (TCC) that is built into the <a href="http://silverlight.codeplex.com/">Silverlight Toolkit</a>’s layout control library. With that control, the Content property (or bound Content) is used in a cycle to smoothly animate out the old content and bring in the new content.</p>
<p>I wanted the same effect, but instead with just a Brush – in most situations an ImageBrush. I went ahead and started from the open source code to the TCC, changed the content presenters in the default style and control template to no longer be needed in the same way (I just derived from Control instead of ContentControl).</p>
<p>So here are the primitive components I built out:</p>
<h3>DynamicBackgroundPanorama</h3>
<p>A one-line control that derives from the official Panorama control. The constructor sets the DefaultStyleKey to the type, enabling the style from the Generic.xaml file to be pulled in automatically.</p>
<p>This is important because this scenario is built on re-templating and just a few primitive changes, and this type lets a developer use it without having to work very hard at all.</p>
<h3>UpdatingPanningLayer</h3>
<p>This is a one-method derived control, deriving from the primitive PanningBackgroundLayer. The purpose is to call the UpdateWrappingRectangles method, a protected method. This will cause the writeable bitmaps in the control to update so that the updated image changes will also update the “ears” or left/right wrapping rectangles used to show the wrap-around effect.</p>
<h3>TransitioningBackgroundControl</h3>
<p>Starting with the Silverlight Toolkit’s TransitioningContentControl created by <a href="http://www.sitechno.com/blog/">Mr. Ruurd Boeke</a>, I changed it up to instead work from the brushes. In case anyone is interested, changes from that were basically:</p>
<ul>
<li>Moving the ContentPresenter sites from typeof ContentPresenter to Grid </li>
<li>Updating the code to specific issues with image brushes, where I’d like to wait to kick off the transition until <em>after</em> the image actually loads. Most of this code is done in the StartTransition method, plus the addition of the Loading visual state. </li>
<li>I dropped a subset of the VisualStates internal class from the toolkit into the file, just to reduce the number of unique files needed for the solution. </li>
<li>Added a dependency property of type Brush and name DynamicBackground. I could have used just the standard Background property, but that actually takes more work to wire up to ‘change’ events than to just define a new property like this. </li>
<li>A special workaround in the OnApplyTemplate to walk up the visual tree and identify the UpdatingPanningLayer, if any. This lets me force the Panorama control to effectively bump and update the side images of the control used when you scroll beyond the edges of the extreme items. </li>
<li>Updating the template:
<ul>
<li>Removing the alternative defined transitions </li>
<li>Changing the default fade-in template by removing the fade out of the current – leads to a smoother look in my opinion </li>
<li>Adding a Loading visual state to help with the delay-load effect of loading an image brush from a URI, for smoothness. </li>
<li>Adding BitmapCache settings to the two individual sites (Grids) </li>
</ul>
</li>
</ul>
<h3>Themes\Generic.xaml</h3>
<p>This file contains the custom template for Panorama as well as the important default style and template for the TransitioningBackgroundControl that I built. The differences from the official Panorama template are:</p>
<ul>
<li>The PanningLayer primitive is replaced by my UpdatingPanningLayer </li>
<li>The Border and background set in the content of the background panning layer has been replaced by my TransitioningBackgroundControl </li>
<li>The background has the margin offset to eliminate the seam </li>
<li>There is no BitmapCache setting on the background in Panorama, instead it is set within the transitioning control, for performance reasons. </li>
</ul>
<p>I’ve also taken guidance from Panorama developer extraordinaire Dave Relyea’s posts:</p>
<ul>
<li><a href="http://blogs.msdn.com/b/devdave/archive/2010/09/17/panorama-tricks-how-to-eliminate-blending-seams.aspx">Eliminating seams</a> </li>
<li><a href="http://blogs.msdn.com/b/devdave/archive/2010/09/20/panorama-using-xaml-for-your-background.aspx">Using XAML for your Background</a> </li>
</ul>
<p>Note that this project makes use of the Silverlight for Windows Phone Toolkit for transitions, so make sure you have it installed if you want to use the sample code.</p>
<h2>Download the sample project</h2>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2010/11/DynamicPanoramaBackgrounds.zip">Sample Project and Control Implementation [ZIP]</a> (1.2 MB)     <br />Dependencies: Windows Phone developer tools and the <a href="http://silverlight.codeplex.com/">Silverlight for Windows Phone Toolkit</a> (for transitions in the example only. The control does not have this dependency)</p>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/11/wp7-panorama-smooth-background-changing/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>“The Future of Silverlight” keynote by ScottGu starts off the 12/2/10 FireStarter event</title>
		<link>http://www.jeff.wilcox.name/2010/11/dec2010-firestarter-event/</link>
		<comments>http://www.jeff.wilcox.name/2010/11/dec2010-firestarter-event/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 18:47:03 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/11/dec2010-firestarter-event/</guid>
		<description><![CDATA[As a developer on the Silverlight team, I get the joy of seeing the many code review and checkin e-mails that our dev team is doing. It’s exciting, and sometimes I do wish I could share that sort of thing with the world. We’ve been hosting Silverlight FireStarter events for some time, but in light [...]]]></description>
			<content:encoded><![CDATA[<p>As a developer on the Silverlight team, I get the joy of seeing the many code review and checkin e-mails that our dev team is doing. It’s exciting, and sometimes I do wish I could share that sort of thing with the world.</p>
<p>We’ve been hosting Silverlight FireStarter events for some time, but in light of recent confusion and happenings in the world of the Silverlight, the next one on 12/2/10 is just that much more important: the keynote by Scott Guthrie will be on “Future of Silverlight”.</p>
<p>Here’s the marketing graphic for the event, please tune in!</p>
<p><a href="http://www.silverlight.net/news/events/firestarter/"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Firestarter" border="0" alt="Firestarter" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/11/Firestarter.png" width="579" height="154" /></a></p>
<p><a title="http://www.silverlight.net/news/events/firestarter/" href="http://www.silverlight.net/news/events/firestarter/">http://www.silverlight.net/news/events/firestarter/</a></p>
<p>There is actually a lot more on the schedule than just that keynote, too. Here’s the latest schedule I have seen floating around:</p>
<p><strong>8:00 am</strong>    <br />Breakfast</p>
<p><strong>9:00 am</strong>    <br />Scott Guthrie    <br />The Future of Silverlight </p>
<p><strong>10:45 am</strong>    <br />Jesse Liberty    <br />Data Binding Strategies with Silverlight and WP7</p>
<p><strong>11:30 am</strong>    <br />Yavor Georgiev    <br />Building Compelling Apps with WCF using REST and LINQ</p>
<p><strong>12:15 pm</strong>    <br />Lunch</p>
<p><strong>1:00 pm</strong>    <br />Dan Wahlin    <br />Building Feature Rich Business Apps Today with RIA Services</p>
<p><strong>1:45 pm</strong>    <br />John Papa    <br />MVVM: Why and How? Tips and Patterns using MVVM and Service Patterns with Silverlight and WP7</p>
<p><strong>2:45 pm</strong>    <br />Tim Heuer    <br />Tips and Tricks for a Great Installation Experience</p>
<p><strong>3:30 pm</strong>    <br />Mike Cook &amp; Jossef Goldberg    <br />Tune Your Application: Profiling and Performance Tips</p>
<p><strong>4:30 pm</strong>    <br />Jaime Rodriguez    <br />Performance Tips for Silverlight Windows Phone 7</p>
<p><strong>5:15 pm</strong>    <br />After Party!</p>
<p>If you’re in the area, try attending – I hope to be there and as always I enjoy meeting folks in the industry and getting their thoughts on all the hard work we do, so I’ll see y’a there – or on the Internets!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/11/dec2010-firestarter-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

