<?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.timheuer.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:image="http://purl.org/rss/1.0/modules/image/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
    <channel>
        <title>Method ~ of ~ failed by Tim Heuer</title>
        <link>http://timheuer.com/blog/Default.aspx</link>
        <description>ramblings from the digital underbelly</description>
        <language>en-US</language>
        <copyright>Tim Heuer</copyright>
        <generator>Subtext Version 2.5.2.0</generator>
        <creativeCommons:license>http://creativecommons.org/licenses/by-nd/3.0/</creativeCommons:license>
        <image><link>http://timheuer.com/blog/</link><url>http://storage.timheuer.com/timheuer-171-seattleb.jpg</url><title>Tim Heuer</title></image>
        <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.timheuer.com/timheuer" /><feedburner:info uri="timheuer" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>33.227266</geo:lat><geo:long>-111.610876</geo:long><feedburner:emailServiceId>timheuer</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.timheuer.com/timheuer" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.timheuer.com%2Ftimheuer" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><feedburner:browserFriendly>Thank you for subscribing to my feed!</feedburner:browserFriendly><item>
            <title>Priorities, passion and employment</title>
            <category>community</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/wQHbSjDXVxM/priorities-passion-employment-work-life-balance.aspx</link>
            <description>&lt;p&gt;Those of us who work for corporations/companies/whatever (read: not self-employed) usually get an allotment of vacation (or ‘PTO’ – personal time off) each year.  Most companies have policies that put a cap on the amount of PTO you can carry over year after year.  Anything you don’t use, you lose.  You’d be an idiot to lose PTO (which is effectively &lt;strong&gt;paid days of work&lt;/strong&gt;).  &lt;/p&gt;  &lt;p&gt;I was an idiot last year.&lt;/p&gt;  &lt;p&gt;At the end of the year I got the email from HR indicating that I was going to forfeit a lot of vacation if I didn’t use it.  The problem?  The math didn’t even work out that I could even use it.  It was forfeiture by idiocy for sure.  I left money on the table, but more importantly it led me to a realization that has been obvious to me, of course, for a long time.&lt;/p&gt;  &lt;p&gt;I work too much.&lt;/p&gt;  &lt;p&gt;I love my job.  I really do.  I enjoy going to work every day, I enjoy the people I work with, and I love the technology that I’m working with daily.  My work is also my hobby/passion.  This presents a problem for my non-work life and a conflict in what people call ‘work/life balance.’&lt;/p&gt;  &lt;h2&gt;Working from home&lt;/h2&gt;  &lt;p&gt;For the first 5 years working for Microsoft I was able to work from home.  This provided me the flexibility (an incredible flexibility I might add) of being there for my family when I needed as well as being able to succeed at work.  My commute was downstairs.  I ate lunch with my friends (yes, I realize work folks can be friends as well, but not always the case).  I was able to take/pickup my kids from school.  In the hot summer days I could go outside and jump in the pool.  Okay I rarely did that, but I could.  Reflecting on this time, I never really cared about vacation because I truly did have a decent work/life balance.  Yes, I still worked a lot, but felt I was “there” for my family.  They may disagree, of course.&lt;/p&gt;  &lt;h2&gt;Working in an office&lt;/h2&gt;  &lt;p&gt;3 years ago I moved to our corporate offices in Washington.  Aside from the other challenges of relocating a family, my fundamental work structure changed.  I don’t work from home.  I go into an office, mingle with co-workers, drown in meetings and lose track of time to realize that I’m not making it home for dinner at times.  Vacation has a different meaning and is more important…or should be.  Since I spend more time away from those niceties of seeing friends/family very frequently during the day, my perspective has certainly changed.&lt;/p&gt;  &lt;p&gt;I spend more awake time in my office than I do in my home during the week.  Think about that.  If you work at a company, you likely do as well.  So why are us workaholics giving up so much time given to us in our vacation?&lt;/p&gt;  &lt;h2&gt;Philosophy conflicts with career growth&lt;/h2&gt;  &lt;p&gt;In reflecting on this work/life balance (or imbalance) I have, a co-worker pointed me to a &lt;a href="http://blog.jongallant.com/2013/05/work-life-balance-at-microsoft.html"&gt;blog post from Jon Gallant&lt;/a&gt; on this very topic.  It is a good read and resonated (too well) with me likely because he also works at Microsoft.  I shared this post with some other community-driven guys in the company and started some more thoughts.  One of which (and somewhat pointed out in Jon’s post) is that establishing a real work/life balance is in conflict with career growth, stack ranking systems, etc.  On this point I agree.  However, it all comes down to priorities.  If you want upward career growth you are sacrificing something.  If you want massive family time, you are likely sacrificing career growth.  A small discussion happened about how you can’t even be in the middle and have a job.  I don’t subscribe to that, but understand that every org/division/manager is different and that is something you have to manage against in your role at work.  One thing pointed out in Jon’s post is so true:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“At work you can be replaced in about 5 minutes, but you are effectively irreplaceable at home. Keep that in mind. I think about it every day.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I shared some thoughts with Jon via email, thanking him for writing what was in my head for so long and we shared some more thoughts.  In the end, his final comments to me were something I don’t think anyone could argue with (note the ‘number’ refers to the stack ranking system), emphasis mine:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;The [&lt;strong&gt;rank&lt;/strong&gt;] [your company] &lt;strong&gt;gives you doesn’t mean anything&lt;/strong&gt;.  No one is EVER going to bring it up in my house – except me. &lt;strong&gt;No one cares.  Especially my 2 year old&lt;/strong&gt;.  I’ll get whatever rank I get this year...it doesn’t bother me because I know that the time I would have put in to always getting the absolute top rank I was at the playground with my kid or teaching him how to ask to be excused from the table.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It made me pause and realize how true that is.  I need to get better at this.  I need to stop saying “just wait one second” to my kids so much.  In fact, Jon got an email from a co-worker that I thought was funny as well…his co-worker *who was on vacation even* said:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“One of my directs was on the beach celebrating his kid’s birthday when he read it.  He put down his phone and went to play with his kid.”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Yep…been there.  Bottom line, there is NEVER a good time to take vacation.  I’ve used that excuse too much.  I need to stop.  My career may suffer.  My thirst for knowing everything around me may suffer.  My family and my own personal sanity will not suffer.  I hope that I can find that right balance as I continue to grow both as a parent/husband and a professional.  I’m not perfect, haven’t found it, but strive to achieve a true work/life balance.&lt;/p&gt;  &lt;p&gt;Anyhow, I hope you read his post.  And I hope you are better and balance than I am currently.&lt;/p&gt;  &lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c08279b6-5b28-4c33-9e6f-10589613553b" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/balance/default.aspx" rel="tag"&gt;balance&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/work%2flife/default.aspx" rel="tag"&gt;work/life&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/microsoft/default.aspx" rel="tag"&gt;microsoft&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/stack+rank/default.aspx" rel="tag"&gt;stack rank&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/vacation/default.aspx" rel="tag"&gt;vacation&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/life/default.aspx" rel="tag"&gt;life&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14849.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/wQHbSjDXVxM" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2013/05/03/priorities-passion-employment-work-life-balance.aspx</guid>
            <pubDate>Fri, 03 May 2013 17:59:28 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2013/05/03/priorities-passion-employment-work-life-balance.aspx#feedback</comments>
            <slash:comments>13</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14849.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14849.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2013/05/03/priorities-passion-employment-work-life-balance.aspx</feedburner:origLink></item>
        <item>
            <title>Ensuring your Windows store app knows of a language change</title>
            <category>devdays</category>
            <category>developer</category>
            <category>silverlight</category>
            <category>tech stuff</category>
            <category>ux</category>
            <category>windows</category>
            <category>xaml</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/AnTS0MRx0DM/howto-refresh-languages-winrt-xaml-windows-store.aspx</link>
            <description>&lt;p&gt;In my working with Windows Store apps, I’ve become increasingly fond/aware of the advantages for app localization.  There are a lot of resources out there for you to localize your app using a good-better-best approach as well.  I’ve &lt;a href="http://timheuer.com/blog/archive/2012/04/26/localize-windows-8-application.aspx"&gt;previously written about localizing a Windows Store app&lt;/a&gt; using some of these methods and what the WinRT platform supports to make this easier in most cases.&lt;/p&gt;  &lt;p&gt;Now that you’ve localized your app, you may be faced with the question of how you might want to respond to language choice changes by the user.  Remember that the Windows Store app model is that it honors the user’s language choice preferences matching that with the available languages the app indicates it supports.  This may not always map to the user’s installed OS language.  For instance I can have an English OS install but prefer German in my apps and set my language preference to: de-DE, en-US.  If a Windows Store app was localized in German, then I would see that version instead of English because my preferences say so, regardless of my OS install.&lt;/p&gt;  &lt;h2&gt;Language switching problem&lt;/h2&gt;  &lt;p&gt;Now, I’m not as proficient in German as I’d like to be, so there may be times where I need to flip back to English to understand certain areas of an app.  I can do this easily by going to the languages panel and switching my order of preference:&lt;/p&gt;  &lt;p&gt;&lt;img style="float: none; margin-left: auto; display: block; margin-right: auto" src="http://storage2.timheuer.com/langpanelchange.png" /&gt;&lt;/p&gt;  &lt;p&gt;But when I go back to my app, it is still in German…until I terminate/restart the app.  Let’s say I started the app and it honors my language preference:&lt;/p&gt;  &lt;p&gt;&lt;img style="float: none; margin-left: auto; display: block; margin-right: auto" src="http://storage2.timheuer.com/german-page1.png" /&gt;&lt;/p&gt;  &lt;p&gt;Now I go and change back to English and click the button to take me to page 2.  It is still in German even though my language preference list is now: en-US; de-DE.&lt;/p&gt;  &lt;p&gt;The XAML framework doesn’t automatically re-evaluate the resource cache in response to these changes.  This is something the developer has to manage and luckily there are some easy steps you can do to make this experience better for your users.&lt;/p&gt;  &lt;p&gt;We should point out that this is likely a rare case that a user of your app is constantly switching languages and switching back to your app, but having your app support this is a delighter for your users when it does happen.&lt;/p&gt;  &lt;h2 /&gt;  &lt;h2&gt;Solution: listening to qualifier updates&lt;/h2&gt;  &lt;p&gt;There are APIs to the rescue here!  When you switch your language preferences, the system actually is aware of it, however the context that your app already had at launched has been cached…and thus it will still be delivering the original context-aware resources.  Good for us is that the APIs can let us know when this happens and we can respond.&lt;/p&gt;  &lt;p&gt;Since most apps have only a single Window object and since this change is likely rare, we should manage this call and not put it on every Page load, for example, but rather higher up in the App because it will likely be rare that it happens.  In our activation code path we can listen for the resource context to change&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;     &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnLaunched(LaunchActivatedEventArgs args)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     ...&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;     ResourceManager.Current.DefaultContext.QualifierValues.MapChanged += QualifierValues_MapChanged;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;     ...&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In this snippet we are using the default &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.resources.core.resourcecontext.aspx"&gt;ResourceContext&lt;/a&gt; and listening for when its qualifier map changes.  The qualifier map is the set of context for resources like language, but also scale, phonetics (for Japanese), high contrast, etc.  Once that map changes we can force a refresh of the cache essentially:&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; QualifierValues_MapChanged(IObservableMap&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt; sender, IMapChangedEventArgs&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt; @&lt;span style="color: #0000ff"&gt;event&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     ResourceManager.Current.DefaultContext.Reset();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This simple flow basically says “hey, when a qualifier has changed, reset the context map so that I get the new data” and our app in subsequent calls to the resources will get the updated resources.&lt;/p&gt;

&lt;p&gt;Here’s a video demonstrating the completed before/after approach.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="560" height="315" src="http://www.youtube.com/embed/PAhs3pdsotk" frameborder="0" allowfullscreen=""&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;p&gt;There is a big caveat to this approach.  The change doesn’t automatically affect your current view.  So your page has rendered and is in German.  If I go and change it to English, then go back to my page…it isn’t automatically in English.  &lt;strong&gt;Subsequent&lt;/strong&gt; view loads (and even going back to this page) will get the new resources, but already-rendered ones do not.  The developer can, of course, implement way more logic to refresh the view, traverse the tree, etc. to manage this, but that experience is up to the app developer to determine what is most appropriate for the app itself.&lt;/p&gt;

&lt;p&gt;This is a little subtle but helpful tip in enabling your localized apps to be flexible to these types of changes by users when that happens.&lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;

&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9088e39c-d2f2-4676-9e8f-e5882e78291e" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/xaml/default.aspx" rel="tag"&gt;xaml&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/winrt/default.aspx" rel="tag"&gt;winrt&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/win8appdev/default.aspx" rel="tag"&gt;win8appdev&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/winappdev/default.aspx" rel="tag"&gt;winappdev&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/windows+8/default.aspx" rel="tag"&gt;windows 8&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/localization/default.aspx" rel="tag"&gt;localization&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14848.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/AnTS0MRx0DM" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2013/03/26/howto-refresh-languages-winrt-xaml-windows-store.aspx</guid>
            <pubDate>Tue, 26 Mar 2013 20:05:10 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2013/03/26/howto-refresh-languages-winrt-xaml-windows-store.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14848.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14848.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2013/03/26/howto-refresh-languages-winrt-xaml-windows-store.aspx</feedburner:origLink></item>
        <item>
            <title>Implement a &amp;lsquo;smart banner&amp;rsquo; for your Windows Store app</title>
            <category>apple</category>
            <category>developer</category>
            <category>devdays</category>
            <category>design</category>
            <category>silverlight</category>
            <category>tech stuff</category>
            <category>ux</category>
            <category>windows</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/iwgWZTYKB3M/implement-a-smart-app-banner-for-windows-store-app.aspx</link>
            <description>&lt;p&gt;As someone who uses a few iOS devices around the house, I’ve become fond of visiting sites and seeing a little banner that lets me know that a native app is available for the web app I’m using.  This concept was introduced in iOS 6 and called “&lt;a href="http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html"&gt;Smart App Banners&lt;/a&gt;” in the developer documentation.  You may have seen them as well&lt;/p&gt;  &lt;p&gt;&lt;img title="Smart App Banner example" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Smart App Banner example" src="http://storage2.timheuer.com/smartappbanner.png" /&gt;&lt;/p&gt;  &lt;p&gt;I wanted to provide the same affordance for Windows Store apps and recalled there are already two ways to integrate the web app browsing experience with the native app in the Windows Store:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/Hh974767.aspx"&gt;Linking to your app&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ie/hh781489%28v=vs.85%29.aspx"&gt;Connect your web site to your Windows Store app&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/ie/archive/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8.aspx"&gt;High quality visuals for Pinned Sites in Windows 8&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In iOS, this is implemented a bit natively in mobile Safari, not through any additional JavaScript files/functions.  As with any random idea I have, I always set out to search if it has been done before (often it already has).  I couldn’t find something like this specifically for Windows Store apps, however I did find an implementation for pre-iOS6 browsers as well as Android.  It was from &lt;a href="https://twitter.com/ArnoldDaniels"&gt;Arnold Daniels&lt;/a&gt; and hosted on GitHub, so what’s a guy to do?  Fork it!&lt;/p&gt;  &lt;p&gt;And that’s what I did: &lt;a title="https://github.com/timheuer/jquery.smartbanner" href="https://github.com/timheuer/jquery.smartbanner"&gt;https://github.com/timheuer/jquery.smartbanner&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;With a few more conditional checks, if you put this in your web app/site now you’ll get it automatically linked to your Windows Store app if you have the correct meta tags.  For the implementation for Windows Store apps I’ve made some assumptions about the meta tags used.  The following would get you a good experience:&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;     &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Hulu Plus&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;meta&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="author"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;content&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Hulu LLC"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;meta&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="msApplication-ID"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;content&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="App"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;meta&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="msApplication-PackageFamilyName"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;content&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="HuluLLC.HuluPlus_fphbd361v8tya"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;link&lt;/span&gt; &lt;span style="color: #ff0000"&gt;rel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="stylesheet"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="jquery.smartbanner.css"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="text/css"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;media&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="screen"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;meta&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="msapplication-TileImage"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;content&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="http://wscont1.apps.microsoft.com/winstore/1x/c8ac8bab-d412-4981-8f31-2d163815afe4/Icon.6809.png"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;         &amp;lt;script src=&lt;span style="color: #006080"&gt;"jquery.smartbanner.js"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;         &amp;lt;script type=&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;             $(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () { $.smartbanner() })&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;         &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;If you have the combination of &lt;a href="http://msdn.microsoft.com/en-us/library/ie/hh781489%28v=vs.85%29.aspx"&gt;linking your app&lt;/a&gt; using the msApplication-ID and msApplication-PackageFamilyName values and the &lt;a href="http://blogs.msdn.com/b/ie/archive/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8.aspx"&gt;pinned sites high fidelity&lt;/a&gt; msApplication-TileImage value to deliver the combined experience.  If you have all these, then the banner “just works” for you.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Because the Microsoft documentation mixes msApplication and msapplication (note the casing on the “A”), you should use the capitalization (which is more consistent in the documentation) for ensuring it all works smoothly.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now some may use a different pinned site TileImage than that of what they may use for the app tile, however this can also be overridden in the options:&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; $(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () { $.smartbanner({ icon:&lt;span style="color: #006080"&gt;'http://some/url/to/tile/image.png'&lt;/span&gt; }) })&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;When done the web app/site would display a dismissable banner (using Hulu as an example here) on a machine running Windows 8:&lt;/p&gt;

&lt;p&gt;&lt;img title="Hulu smart app banner example" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Hulu smart app banner example" src="http://storage2.timheuer.com/hulusmartbanner.png" /&gt;&lt;/p&gt;

&lt;p&gt;So adding one reference, 2 files and an initialization and you’ll help give your app a bit more promotional flare for those viewing in browsers other than the ‘modern’ IE view.  As you can see the screenshot above is from the desktop version which doesn’t take advantage of the other msApplication-** attribute usage in desktop mode.  The one thing it doesn’t do that the iOS system-level banner does is detect if the app is installed and change “view” to “open” however there isn’t a mechanism to easily detect if the app is installed using JavaScript from a web app.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: While the ‘View in Store’ button works in IE, Safari and Firefox it does not work in Chrome.  I’m not sure what any timeframe it would be for Chrome to support the store launch protocol.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Anyhow, I thought this might be a useful addition to app developers web apps that have a Windows Store app counterpart (and perhaps already have an iOS and Androi counterpart as well).  I’ve submitted a pull request to the project I forked from, but you can get it from my &lt;a href="https://github.com/timheuer/jquery.smartbanner"&gt;GitHub repository for jquery.smartbanner&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;

&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:347281d6-82d9-4751-8237-e38d6df818ca" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/winappdev/default.aspx" rel="tag"&gt;winappdev&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/win8/default.aspx" rel="tag"&gt;win8&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/windows+8/default.aspx" rel="tag"&gt;windows 8&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/smartbanner/default.aspx" rel="tag"&gt;smartbanner&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/jquery/default.aspx" rel="tag"&gt;jquery&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/github/default.aspx" rel="tag"&gt;github&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14847.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/iwgWZTYKB3M" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2013/02/18/implement-a-smart-app-banner-for-windows-store-app.aspx</guid>
            <pubDate>Mon, 18 Feb 2013 16:25:43 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2013/02/18/implement-a-smart-app-banner-for-windows-store-app.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14847.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14847.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2013/02/18/implement-a-smart-app-banner-for-windows-store-app.aspx</feedburner:origLink></item>
        <item>
            <title>Remote Debugging your Windows Store app on your Surface</title>
            <category>developer</category>
            <category>tech stuff</category>
            <category>windows</category>
            <category>visual studio</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/xap8mNzhXZw/remote-debugging-windows-store-apps-on-surface-arm-devices.aspx</link>
            <description>&lt;p&gt;So you got that shiny new Surface device today?  I’m sure you spent the first few hours just opening it up, setting your personal experiences to your desire, re-installing and discovering new apps.&lt;/p&gt;  &lt;p&gt;But you are a developer and now you want to see how your app looks on this great device…Here are some tips to get you quickly started.&lt;/p&gt;  &lt;h2&gt;Setting up the tools&lt;/h2&gt;  &lt;p&gt;One thing to keep in mind is that Surface is NOT a full ‘desktop’ machine and runs on an ARM processor.  This means to that you cannot install Visual Studio directly on the Surface RT device.  You will need to still ensure that you have a full development environment set up.  But the first thing you will need is to get the remote developer tools for Visual Studio *for your target remote device* architecture.  For Surface RT, this is the ARM tools.&lt;/p&gt;  &lt;p&gt;You can get them here: &lt;a href="http://go.microsoft.com/fwlink/?linkid=219549"&gt;Microsoft Visual Studio Downloads&lt;/a&gt;.  Scroll down a bit and look in the “Additional Software” section.  Grab the &lt;strong&gt;Remote Tools for Visual Studio 2012&lt;/strong&gt; section.  &lt;/p&gt;  &lt;p&gt;&lt;img title="Remote tools for VS download" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Remote tools for VS download" src="http://storage2.timheuer.com/remotetoolsvs.png" /&gt;&lt;/p&gt;  &lt;p&gt;You can do this either from the desktop browser on the Surface or from your own desktop and download the remote tools for ARM to a USB key.&lt;/p&gt;  &lt;p&gt;On your device, install the remote tools for ARM.  No other Visual Studio installation is required here.  Just run the installer.  When completed you should have a tile on your screen for the tools:&lt;/p&gt;  &lt;p&gt;&lt;img title="Remote Debugger tile" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Remote Debugger tile" src="http://storage2.timheuer.com/remotedebugtile.png" /&gt;&lt;/p&gt;  &lt;p&gt;Now you can get started with your remote debug session!&lt;/p&gt;  &lt;h2&gt;Configuring the Remote Debugger&lt;/h2&gt;  &lt;p&gt;After install go ahead and launch the Remote Debugger on your device.  You’ll be presented with (maybe after some firewall questions you need to authorize) the remote debugger now running and in default mode:&lt;/p&gt;  &lt;p&gt;&lt;img title="Remote Debugger launched" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Remote Debugger launched" src="http://storage2.timheuer.com/remotedebuglaunched.png" /&gt;&lt;/p&gt;  &lt;p&gt;By default, it is set up secure.  This means that in order to attach a remote session you’d need to ensure permissions are correct, etc.  Now since your ARM device isn’t likely on the same domain/workgroup as your developer machine this may be tricky.  Personally, I turn off the authentication options to make my developer experience smoother.  Now of course, you shouldn’t leave your device in this state, but you can close the remote debugger when complete.  Here is the config that I use on my remote debugger:&lt;/p&gt;  &lt;p&gt;&lt;img title="Remote Debugger config" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Remote Debugger config" src="http://storage2.timheuer.com/remotedebugconfig.png" /&gt;&lt;/p&gt;  &lt;p&gt;This allows me to just launch the app on the remote machine without having to use any special authentication tricks since the machine isn’t on my domain, etc.  My remote environment is now set up and ready for me to launch an app and start debugging!&lt;/p&gt;  &lt;h2&gt;Launching an App on the remote debugger&lt;/h2&gt;  &lt;p&gt;Now that your remote device is configured and listening, you want to start your app and debug remotely.  Once you have your app in Visual Studio you’ll want to change your launch target to “Remote Device” in the IDE.  This is in the toolbar or in the project properties.  For a C# application it looks like this:&lt;/p&gt;  &lt;p&gt;&lt;img title="Select Remote Machine target" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Select Remote Machine target" src="http://storage2.timheuer.com/selectremotelaunch.png" /&gt;&lt;/p&gt;  &lt;p&gt;Once you launch that you’ll be able to select your device.  Now if you are on your home network, with no domains and all on the same subnet, you may just be able to discover your device in the remote debugger connections window.  However you can also just specify the machine name.  Be sure to match the authentication method in this window with what you chose when you set up the remote debugger…in my case “none.”&lt;/p&gt;  &lt;p&gt;&lt;img title="Remote Debugger connections window" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Remote Debugger connections window" src="http://storage2.timheuer.com/remotedebuggerconnections.png" /&gt;&lt;/p&gt;  &lt;p&gt;Now that the configuration is there (and selected), when I run (F5) the application it will attempt to deploy it on the remote device.  When you run you’ll notice the remote debugger will show the connections:&lt;/p&gt;  &lt;p&gt;&lt;img title="Remote debugger connected window" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Remote debugger connected window" src="http://storage2.timheuer.com/remotedebuggerconnected.png" /&gt;&lt;/p&gt;  &lt;p&gt;And in your developer workstation you’ll be able to set breakpoints, investigate watch parameters, etc.  All the same stuff you normally do is still available to you.&lt;/p&gt;  &lt;h2&gt;Summary&lt;/h2&gt;  &lt;p&gt;Now that you have a Surface (or other Windows RT device) running on an ARM processor, this remote debugging toolset/workflow will be important to you.  The great thing is that once it is set up and you understand the flow, it is very simple and seamless to use.  This presents a great opportunity for you to debug and &lt;strong&gt;profile&lt;/strong&gt; your apps on Windows RT to see any areas that you might be able to optimize for the target device.  And all you need is &lt;a href="http://www.microsoft.com/visualstudio/eng/downloads"&gt;Visual Studio Express for Windows 8&lt;/a&gt; (free) and the &lt;a href="http://www.microsoft.com/visualstudio/eng/downloads#remote-tools"&gt;Remote Debugger tools for Visual Studio 2012&lt;/a&gt; (free)&lt;/p&gt;  &lt;p&gt;Hope this helps!&lt;/p&gt;      &lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4ef1836e-9ec5-486c-816a-26fe021cb9ea" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/windows+8/default.aspx" rel="tag"&gt;windows 8&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/winrt/default.aspx" rel="tag"&gt;winrt&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/windows+rt/default.aspx" rel="tag"&gt;windows rt&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/surface/default.aspx" rel="tag"&gt;surface&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/arm/default.aspx" rel="tag"&gt;arm&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/remote+debugging/default.aspx" rel="tag"&gt;remote debugging&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/debugging/default.aspx" rel="tag"&gt;debugging&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/visual+studio/default.aspx" rel="tag"&gt;visual studio&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/xaml/default.aspx" rel="tag"&gt;xaml&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14846.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/xap8mNzhXZw" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2012/10/26/remote-debugging-windows-store-apps-on-surface-arm-devices.aspx</guid>
            <pubDate>Fri, 26 Oct 2012 17:24:26 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2012/10/26/remote-debugging-windows-store-apps-on-surface-arm-devices.aspx#feedback</comments>
            <slash:comments>35</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14846.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14846.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2012/10/26/remote-debugging-windows-store-apps-on-surface-arm-devices.aspx</feedburner:origLink></item>
        <item>
            <title>Using Azure Web Sites to market your Windows App</title>
            <category>azure</category>
            <category>developer</category>
            <category>windows</category>
            <category>tech stuff</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/xr5owfWFJyA/use-azure-free-web-site-for-windows-store-app-content.aspx</link>
            <description>&lt;p&gt;In some of our internal discussion lists there was some questions about how to host certain content for their application.  Most of the discussion came up from apps needing a privacy policy (Rule 4.1 from the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh694083.aspx"&gt;Windows Store App Certification Requirements&lt;/a&gt;).  Some folks had apps they just developed, but no “site” or service they were using.  But they needed to host a privacy policy.  Lots of thoughts were floated around and I suggested Azure Free Web Sites as an option.  I originally suggested it as a simple way you could just have a URL to a privacy policy, but…duh, you could easily use it as a very quick marketing site for your app.&lt;/p&gt;  &lt;h2&gt;Creating a web site in Windows Azure&lt;/h2&gt;  &lt;p&gt;If you didn’t know, Windows Azure allows you to create a &lt;a href="http://weblogs.asp.net/scottgu/archive/2012/06/07/meet-the-new-windows-azure.aspx"&gt;free web site&lt;/a&gt;!  It is very quick and simple to set up once you have your Azure account set up.  After doing that go to the portal and choose to create a new Web Site.  I recommend picking from the gallery and choosing WordPress.  There is such a vast ecosystem around WordPress as a CMS system that it is simple to use and set up.  &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;NOTE: Of course you can use others, even a static web site using the TFS/Git deploy feature even.  Do whatever you want.  I just think WordPress is great and allows you to scale your site features without writing code, etc.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Choose to create a site from the gallery:&lt;/p&gt;  &lt;p&gt;&lt;img title="Azure Find Apps image" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Azure Find Apps image" src="http://storage2.timheuer.com/azureapp-findapps.png" /&gt;&lt;/p&gt;  &lt;p&gt;This will walk you through a wizard to pick some names and options.  It is pretty self explanatory.  Once completed you will see your site provisioned in the portal.&lt;/p&gt;  &lt;p&gt;&lt;img title="Azure web sites image" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Azure web sites image" src="http://storage2.timheuer.com/azureapp-website.png" /&gt;&lt;/p&gt;  &lt;p&gt;Just click that link and you will be taken to your site…which for WordPress will be the initial setup page to choose your login.&lt;/p&gt;  &lt;h2&gt;Choosing a WordPress Theme&lt;/h2&gt;  &lt;p&gt;Once in the WordPress admin site, choose the Appearance option on the left, then the Themes sub-menu.  Once there, go to the Install Themes tab to pick a theme from the gallery.  Optionally you can grab a premium theme from various sites.  There is one called “Responsive” (search for that term) that is in the built-in gallery, free, and actually serves the basic needs well.  We’ll choose that one:&lt;/p&gt;  &lt;p&gt;&lt;img title="Responsive theme install image" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Responsive theme install image" src="http://storage2.timheuer.com/azureapp-responsivetheme.png" /&gt;&lt;/p&gt;  &lt;p&gt;After you pick it you’ll want to Activate it as the current theme.  Now let’s do some simple configuration.&lt;/p&gt;  &lt;h2&gt;Configure the WordPress site&lt;/h2&gt;  &lt;p&gt;In order to serve the goal of making this more of a marketing site and to host our privacy policy we don’t need commenting on pages.  Additionally we want “nice” URLs for our site.  Let’s start with a few simple tweaks.&lt;/p&gt;  &lt;p&gt;First (in the WordPress admin site) go to Settings-&amp;gt;Permalinks.  Choose the “Post name” option.&lt;/p&gt;  &lt;p&gt;&lt;img title="WordPress permalink settings image" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="WordPress permalink settings image" src="http://storage2.timheuer.com/azureapp-permalinks.png" /&gt;&lt;/p&gt;  &lt;p&gt;Next go to Settings-&amp;gt;Discussions.  In the top uncheck the “Allow people to post comments on new articles” in the top:&lt;/p&gt;  &lt;p&gt;&lt;img title="WordPress discussion settings image" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="WordPress discussion settings image" src="http://storage2.timheuer.com/azureapp-comments.png" /&gt;&lt;/p&gt;  &lt;p&gt;This will prevent commenting on content.  Next using the Responsive theme we can configure the home page.  Go to the Appearance-&amp;gt;Theme Options section.  You’ll see a “Home Page” option for the Responsive theme.  You can set the main text, tagline and two other options.  This gives you the chance to set the URL for your app that is provided from the Windows Store.  &lt;/p&gt;  &lt;p&gt;Here are some posts to help you find URLs for your app: &lt;a href="http://blogs.msdn.com/b/windowsstore/archive/2012/02/22/linking-to-your-apps-on-the-web.aspx"&gt;Linking your apps on the web&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ie/hh781489(v=vs.85).aspx"&gt;Connect your web site to your store app&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Here is an example:&lt;/p&gt;  &lt;p&gt;&lt;img title="Responsive theme home page config image" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Responsive theme home page config image" src="http://storage2.timheuer.com/azureapp-homepage2.png" /&gt;&lt;/p&gt;  &lt;p&gt;Now go to Appearance-&amp;gt;Widgets to modify some information on the home page for the 3 widget areas.  These could be simple things like a quick blurb about what the app is, maybe some top features, or whatever.  In the admin widget area you’ll see Home Page Widget 1,2,3.  Simply add the “Text” widget to these and you can add the title/text for this:&lt;/p&gt;  &lt;p&gt;&lt;img title="Home page widget image" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Home page widget image" src="http://storage2.timheuer.com/azureapp-homepage-widget.png" /&gt;&lt;/p&gt;  &lt;p&gt;You can also remove the theme logo to provide your own logo in the Appearance-&amp;gt;Header section to provide your own image.  You can also specify a custom image on the main “hero” section of the home page instead of the default image and specify that.  Once all these quick tweaks are done, your home page is done.  Visit the site to see the quick changes.&lt;/p&gt;  &lt;p&gt;Now let’s add our privacy policy so we have a permanent place for our privacy details.&lt;/p&gt;  &lt;h2&gt;Add a Privacy Policy page&lt;/h2&gt;  &lt;p&gt;From the WordPress admin site, go to Pages-&amp;gt;Add Page.  Name it “Privacy Policy” and then type in your privacy policy text.  You can modify the text using HTML formatting to fit your needs.  Make sure to use the “Full Width Page” template so that it shows the entire page.  Notice the URL for the permalink.  I recommend keeping it simple with “privacy” or “privacy-policy” as the name (which should be default):&lt;/p&gt;  &lt;p&gt;&lt;img title="Privacy page editing image" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Privacy page editing image" src="http://storage2.timheuer.com/azureapp-privacypage.png" /&gt;&lt;/p&gt;  &lt;p&gt;Once you Publish the page, your site will now have a link to “Privacy Policy” on the home page and you can use that in your site, for your certification process and other areas you may need it.&lt;/p&gt;  &lt;p&gt;You can now provide a link within your app to your privacy policy as well.  Andy has a &lt;a href="http://www.andybeaulieu.com/Default.aspx?tabid=67&amp;amp;EntryID=228"&gt;simple method of adding it to the Settings charm&lt;/a&gt; and simply linking to your online site now.  You can visit the site to confirm it looks as you wish:&lt;/p&gt;  &lt;p&gt;&lt;img title="Privacy page image" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Privacy page image" src="http://storage2.timheuer.com/azureapp-privacy.png" /&gt;&lt;/p&gt;  &lt;p&gt;Done!  You can see this example at &lt;a href="http://timscoolapp.azurewebsites.net"&gt;http://timscoolapp.azurewebsites.net&lt;/a&gt;.  &lt;/p&gt;  &lt;h2&gt;Profit!&lt;/h2&gt;  &lt;p&gt;Now you have a free site on Azure to host marketing your app.  Of course this helps those getting over the hump with providing a nice place for a simple privacy page, but also enables you to have a way to provide other pages for your app.  You could provide more detail on features, have a form to collect feature requests, whatever.  WordPress is very flexible and the same process you used to create the privacy page can be used for other full-page content.  Or you can explore what WordPress has to offer you.  Again, there are many different ways you can do this and even within WordPress other themes you could choose.  However I think the Responsive one is a simple one to get started with as a base.&lt;/p&gt;  &lt;p&gt;You may want to not have “azurewebsites.net” as your site URL as well.  If you wanted you can migrate to a &lt;a href="http://weblogs.asp.net/scottgu/archive/2012/09/17/announcing-great-improvements-to-windows-azure-web-sites.aspx"&gt;shared instance&lt;/a&gt; (not free) and have custom domain name resolution on your Azure site as well.&lt;/p&gt;  &lt;p&gt;Hope this helps!&lt;/p&gt;  &lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:33e646cd-10e1-4053-8925-e58f983a4c13" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/windows+8/default.aspx" rel="tag"&gt;windows 8&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/win8appdev/default.aspx" rel="tag"&gt;win8appdev&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/win8/default.aspx" rel="tag"&gt;win8&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/xaml/default.aspx" rel="tag"&gt;xaml&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/winrt/default.aspx" rel="tag"&gt;winrt&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/azure/default.aspx" rel="tag"&gt;azure&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/privacy+policy/default.aspx" rel="tag"&gt;privacy policy&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/window+store/default.aspx" rel="tag"&gt;window store&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14845.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/xr5owfWFJyA" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2012/09/26/use-azure-free-web-site-for-windows-store-app-content.aspx</guid>
            <pubDate>Thu, 27 Sep 2012 03:39:03 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2012/09/26/use-azure-free-web-site-for-windows-store-app-content.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14845.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14845.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2012/09/26/use-azure-free-web-site-for-windows-store-app-content.aspx</feedburner:origLink></item>
        <item>
            <title>Using vector data for AppBar icons in XAML</title>
            <category>devdays</category>
            <category>developer</category>
            <category>expression</category>
            <category>tech stuff</category>
            <category>ux</category>
            <category>windows</category>
            <category>xaml</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/YH0H-uHI7JI/using-vectors-as-appbar-button-icons.aspx</link>
            <description>&lt;p&gt;I was helping a friend today doing some over-the-shoulder code review and suggestions for his Windows app he’s writing for the store.  In doing this I asked a question about how to perform a certain action.  He indicated that he put those functions in the AppBar and was it not obvious I was supposed to use them.  I looked at the AppBar again and found out why I wasn’t drawn to them.  First, the labels he used weren’t descriptive to me and relied too much on me looking at the actual icon.  Second, however, is that when I hovered over them I received no visual feedback I was expecting and immediately thought they were just disabled (the color was slightly gray as well which probably didn’t help this).&lt;/p&gt;  &lt;p&gt;I mentioned these to him and noted he should use the AppBarButtonStyle base definition that comes in the Visual Studio templates as a guide and just set the appropriate content.  He proceeded to let me know that he received the vector data from &lt;strong&gt;&lt;a href="http://www.syncfusion.com/downloads/metrostudio"&gt;Syncfusion’s Metro Studio&lt;/a&gt; &lt;/strong&gt;product.  We then began to examine the vector data.  Metro Studio is doing probably too much than it needs to for AppBar button definitions.  To be fair, it serves a goal to get Windows UI style icons for the developers in XAML form.  This is great!  However, if my intention is to use them for AppBar buttons, then it is doing too much.  It led me down a path to see how easy it was to use vector data with the default AppBarButtonStyle definition.  Turns out it wasn’t as simple as I thought.  Let me first explain the core issue then walk through a step on how to do this with vector data.&lt;/p&gt;  &lt;h2 /&gt;  &lt;h2&gt;Fill versus Foreground&lt;/h2&gt;  &lt;p&gt;The main culprit is Fill vs. Foreground.  The default AppBarButtonStyle has the different visual states for setting the correct default/inverted colors for your icon within the ellipse.  These visual states however set these colors based on changing the &lt;strong&gt;Foreground&lt;/strong&gt; property of the ContentPresenter.  When your content is text – as is the case with the default styles that are commented out – this works fine.  However the &lt;strong&gt;Path&lt;/strong&gt; element in XAML understands Fill and Foreground doesn’t really apply.  So while the vector data could be represented in the icon location, it wasn’t working on the different states because the Foreground value changing had no effect!&lt;/p&gt;  &lt;p&gt;Let’s see how we can accomplish this…&lt;/p&gt;  &lt;h2&gt;Step 1: Get your vector data&lt;/h2&gt;  &lt;p&gt;I mentioned that we discovered this using Syncfusion’s Metro Studio, but this is one way where you can get vector-based artwork for XAML.  Another is &lt;a href="http://xamlproject.com"&gt;http://xamlproject.com&lt;/a&gt; which is similar in how it does things.  Both will give you vector data based on a selected icon.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;NOTE: The one thing I don’t like about The XAML Project site is the sizer doesn’t tell me what size I’m using.  Metro Studio gave me the option to set a specific size.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When we launch Metro Studio we can search for different items based on keywords.  Since the Segoe UI Symbol font includes a ton of these for us (all of which are represented in a commented-out style definition in StandardStyles.xaml you can just uncomment and use) I will pick an obscure one called “wash” from Metro Studio.  When I select to edit it I’m presented with a default UI to modify the data:&lt;/p&gt;  &lt;p&gt;&lt;img title="Metro Studio user interface" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Metro Studio user interface" src="http://storage2.timheuer.com/wash.png" width="640" height="431" /&gt;&lt;/p&gt;  &lt;p&gt;Now notice how it gives me options for background shapes, etc.?  For an AppBar button you &lt;strong&gt;do not these shapes&lt;/strong&gt; so you can uncheck that option.  Secondarily the ideal size is 20px with no padding.  The colors (background color and icon color) don’t really matter here as we aren’t going to use them to get the default AppBar button style.  My final options look like this:&lt;/p&gt;  &lt;p&gt;&lt;img title="Metro Studio user interface" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Metro Studio user interface" src="http://storage2.timheuer.com/wash-fixed.png" width="640" height="431" /&gt;&lt;/p&gt;  &lt;p&gt;Notice I unchecked the Background Shapes option, chose Custom Size and entered 20 with 0 padding.&lt;/p&gt;  &lt;p&gt;Now what I do is click the XAML button and am presented with the full definition.  You don’t need it all.  Just copy only the path Data to your clipboard or wherever you can get it later.&lt;/p&gt;  &lt;p&gt;&lt;img title="Metro Studio path data export" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Metro Studio path data export" src="http://storage2.timheuer.com/wash-data.png" /&gt;&lt;/p&gt;  &lt;p&gt;Now that we have our vector data we need to put it in our button.&lt;/p&gt;      &lt;h2&gt;Step 2: Creating the path button definition&lt;/h2&gt;  &lt;p&gt;Because of the Fill versus Foreground issue we can’t just simply use the AppBarButtonStyle as the button style and just set our vector data.  We will not receive the correct state visuals when it is used.  So we first need to re-define a base that we can use.  Since I may use other vector data in the future, I’ll encapsulate this in a new base style I’ll call PathBasedAppBarButtonStyle.  This will allow me to remap Foreground to my Fill property to achieve the desired outcome.  The resulting style is this:&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;     &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Style&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Key&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="PathBasedAppBarButtonStyle"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;BasedOn&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="{StaticResource AppBarButtonStyle}"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;TargetType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="ButtonBase"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Setter&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="ContentTemplate"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Path&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="20"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="20"&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;             &lt;span style="color: #ff0000"&gt;Stretch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Uniform"&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;             &lt;span style="color: #ff0000"&gt;Fill&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="{Binding Path=Foreground, RelativeSource={RelativeSource Mode=TemplatedParent}}"&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;             &lt;span style="color: #ff0000"&gt;Data&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="{Binding Path=Content, RelativeSource={RelativeSource Mode=TemplatedParent}}"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Setter&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Style&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Notice that for Fill and Data I’m using Binding with the RelativeSource being the TemplatedParent…the actual Button.  This allows me to essentially get at those properties that will be set and put them in my Path element that makes up the container for the vector data. &lt;/p&gt;

&lt;h2&gt;Step 3: Setting our custom vector data&lt;/h2&gt;

&lt;p&gt;Using the exported definition from my “wash” icon above, I can now use the style in my AppBar resulting in something like this:&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Page.BottomAppBar&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;AppBar&lt;/span&gt; &lt;span style="color: #ff0000"&gt;IsOpen&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="True"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Button&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Style&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="{StaticResource PathBasedAppBarButtonStyle}"&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;                 &lt;span style="color: #ff0000"&gt;AutomationProperties&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Wash"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;AutomationProperties&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;AutomationId&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="WashAppBarButton"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;                 &lt;span style="color: #ff0000"&gt;Content&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="M9.6803506,4.8474294C10.209365 ... 3.5652149,0z"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;AppBar&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Page.BottomAppBar&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Please note that I trimmed the Path data so as not to take up so much space for your reading.  I set my Button to use the base style, then set my label (via AutomationProperties.Name) and the Content is the exported vector data from the tool.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: AutomationProperties.Name is used here in the base AppBarButtonStyle to enable us to expose the Content property as the icon and still have a label.  By using this property you also get accessibility for free in using these styles for this particular instance.  Screen readers will read out the name you set when using this.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The resulting visual is correct in the AppBar UI guidelines:&lt;/p&gt;

&lt;p&gt;&lt;img title="Wash AppBar Icon displayed" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Wash AppBar Icon displayed" src="http://storage2.timheuer.com/wash-final.png" /&gt;&lt;/p&gt;



&lt;p&gt;Now when my users mouse-hover or press this button the correct visuals and state changes will happen.&lt;/p&gt;

&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;The default AppBarButtonStyle base definition provided from the Visual Studio templates is optimized for the 150+ styles provided in StandardStyles.xaml and font-based vector data.  For most, this is likely more than enough to use the same icons that are used throughout the operating system to give a consistent feel.  If you find one in the 150+ styles provided you should use that.  However if there is something entirely custom or not available in those, you can use your own vector data to provide your AppBar icon.  Using fonts and vectors make it easy to scale up to the different resources without having to provide different images if you used that method.  Defining a new base for vector data isn’t difficult and provides us the flexibility when we need it!&lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;

&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:91f843e4-a8d3-463f-85c8-5d3dbd5bc8bb" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/winrt/default.aspx" rel="tag"&gt;winrt&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/xaml/default.aspx" rel="tag"&gt;xaml&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/windows+8/default.aspx" rel="tag"&gt;windows 8&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/windows/default.aspx" rel="tag"&gt;windows&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/metro/default.aspx" rel="tag"&gt;metro&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/vector/default.aspx" rel="tag"&gt;vector&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/appbar/default.aspx" rel="tag"&gt;appbar&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14844.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/YH0H-uHI7JI" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2012/09/03/using-vectors-as-appbar-button-icons.aspx</guid>
            <pubDate>Mon, 03 Sep 2012 23:36:12 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2012/09/03/using-vectors-as-appbar-button-icons.aspx#feedback</comments>
            <slash:comments>14</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14844.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14844.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2012/09/03/using-vectors-as-appbar-button-icons.aspx</feedburner:origLink></item>
        <item>
            <title>New-DiffGist: a powershell cmdlet for posting diffs fast</title>
            <category>developer</category>
            <category>tech stuff</category>
            <category>windows</category>
            <category>open source</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/Aw051Qfx4Zk/new-diffgist-powershell-cmdlet-github-gist.aspx</link>
            <description>&lt;p&gt;In the late nights when I have time to work on &lt;strong&gt;&lt;a href="http://timheuer.com/blog/archive/2012/05/31/introducing-callisto-a-xaml-toolkit-for-metro-apps.aspx"&gt;Callisto&lt;/a&gt;&lt;/strong&gt; (my &lt;strong&gt;Windows 8 XAML toolkit&lt;/strong&gt;), I often am making changes that I really wish I could either pair with someone on or at a minimum solicit some feedback.  Primarily single-person open source projects are lonely :-).&lt;/p&gt;  &lt;p&gt;Last night was no different.  I had a user of Callisto having a problem with a specific code path.  While my testing of the fix was fine, I didn’t want to rush it without him understanding the simple fix.  I had no good way of showing him a combined diff to comment on at the time.  My problem was, what I thought, simple: &lt;strong&gt;how do I quickly share a diff from a GitHub project without requiring them to have a fork?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I set out to the best place to have an argument, Twitter.  I asked the same question and got a lot of different responses, but almost all of them pointing to what appears to be the typical git flow in this matter is to use pull requests for code reviews and sharing potential updates.  This really frustrated me as I thought it was unnatural to the goal I was trying to accomplish.  Lots of folks told me this was the way to do it and that I was thinking about it wrong.  To them I say &lt;a href="http://www.ted.com/talks/seth_godin_this_is_broken_1.html"&gt;this is broken&lt;/a&gt;.  I didn’t want to pollute pull requests to be a mix of legitimate pull requests to “in-flight” code changes that shouldn’t be even considered for merge yet.  I simply wanted a quick, light-weight way to share a diff graph.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;a href="http://twitter.com/xpaulbettsx"&gt;Paul Betts&lt;/a&gt;&lt;/strong&gt; (as he has always awesomely helped with my GitHub questions) pointed me to the thing I was ultimately looking for:&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;     &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; git diff &amp;gt; current.diff&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This gave me the output that I needed and &lt;strong&gt;&lt;a href="http://gist.github.com/"&gt;Gist&lt;/a&gt;&lt;/strong&gt; understands color coding for this data so I just needed to post it there.  Good thing is that GitHub has an &lt;a href="http://api.github.com/"&gt;API&lt;/a&gt; that is relatively simple to understand.  Since I’ve been using &lt;strong&gt;&lt;a href="https://github.com/dahlbyk/posh-git"&gt;poshgit&lt;/a&gt;&lt;/strong&gt; as my shell lately I set out to create a CmdLet for my flow.  I wanted one command that would grab the diff and post to a Gist and give me the URL.  I’ve never touched a line of PowerShell programming before and set out to start.&lt;/p&gt;

&lt;p&gt;Honestly, it was painful to understand PowerShell for me in this simple task.  The PowerShell “IDE” is slow to help with any really good flow.  I wanted some VS experience to bootstrap me and I knew I didn’t want a full-on assembly approach.  A PowerShell script should do me just fine.  I scoured many sites online and started out with my script.  After a few hours of searching/trying I was almost there but still not successful.  I ended the night posting back to Twitter with a &lt;a href="https://gist.github.com/3422592"&gt;Gist of my attempt&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It was late, I went to bed.  As is how most things happen on the interwebs, I awoke to some pointers to where someone has already done most of the work!  Despite my searching I never found something that basically took me 90% there already.  This was in the form of &lt;strong&gt;&lt;a href="https://github.com/cromwellryan/psgist"&gt;PsGist&lt;/a&gt;&lt;/strong&gt;.  Boom!  This is exactly what I needed.  I just needed to modify the input from a literal file to the source of the diff.  I spent an unnecessary hour fighting with an unauthorized error on the GitHub API due to some unexpected value being in the string captured after entering credentials, but after that was solved I was done.  I decided to merge this back to PsGist and submit a pull request for the new command.  A few minutes later and after a few questions/quick modification, it was merged.  I now have a simple/fast flow to quickly say “hey, here’s what I’m working on, what do you think?” to anyone without having to do any different branching that isn’t currently in my flow.&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; New-DiffGist -Description &lt;span style="color: #006080"&gt;"SettingsFlyout fix"&lt;/span&gt; -Public&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;After the module is imported the above command will perform a diff, and immediately post that to Gist and give you the URL (and optionally launch in browser if you use the –Launch param).  I know it may sound trivial, but it helps my flow and is the simple thing that I was looking for.  Thanks Ryan for the PsGist starting point (and for merging my new CmdLet)!&lt;/p&gt;

&lt;p&gt;Hope this helps someone!&lt;/p&gt;

&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8480c225-ba5a-464f-bb1b-d1751c949042" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/gist/default.aspx" rel="tag"&gt;gist&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/github/default.aspx" rel="tag"&gt;github&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/poshgit/default.aspx" rel="tag"&gt;poshgit&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/psgist/default.aspx" rel="tag"&gt;psgist&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/powershell/default.aspx" rel="tag"&gt;powershell&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/callisto/default.aspx" rel="tag"&gt;callisto&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14843.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/Aw051Qfx4Zk" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2012/08/22/new-diffgist-powershell-cmdlet-github-gist.aspx</guid>
            <pubDate>Thu, 23 Aug 2012 00:05:14 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2012/08/22/new-diffgist-powershell-cmdlet-github-gist.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14843.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14843.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2012/08/22/new-diffgist-powershell-cmdlet-github-gist.aspx</feedburner:origLink></item>
        <item>
            <title>UPDATED HOWTO: SQLite with Windows 8 apps</title>
            <category>developer</category>
            <category>tech stuff</category>
            <category>windows</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/wKz1YcXByUc/updated-how-to-using-sqlite-from-windows-store-apps.aspx</link>
            <description>&lt;p&gt;I’ve previously posted a few things about SQLite including a &lt;a href="http://timheuer.com/blog/archive/2012/06/05/howto-video-using-sqlite-in-metro-style-app.aspx"&gt;HOWTO on how to build&lt;/a&gt; from their source code.  If you still want to build your own DLL from their source code that is totally fine, but not necessary in most every single case I’ve seen in app usage.  One of the challenges I noted is that since SQLite is a native component and if you are a managed (.NET) app you can’t be architecture neutral anymore (AnyCPU).  What this means is that you have to build your app for each architecture you want to support: x86, x64 and ARM.  The flow of this using SQLite3.dll was that you would have to package, change the DLL, re-package.  &lt;/p&gt;  &lt;p&gt;Not anymore.&lt;/p&gt;  &lt;p&gt;In working with the great folks on the &lt;a href="http://www.sqlite.org"&gt;&lt;strong&gt;SQLite&lt;/strong&gt;&lt;/a&gt; team, they’ve packaged the binaries up (for Windows 8 apps) in a nice installer using the Extension SDK format.  What this means is you now add a ‘reference’ to the SQLite binary and based on the architecture being built for your package, it will pull in the right DLL without you having to manage that yourself.  Here’s some step-by-step…&lt;/p&gt;  &lt;h2&gt;Installing the SQLite for Windows Runtime package&lt;/h2&gt;  &lt;p&gt;The first thing you want to do is install the package.  You can do this from within Visual Studio itself in all editions.  From the Tools menu, choose &lt;em&gt;Extensions and Updates&lt;/em&gt; and then choose the Online section (on the left of the dialog) and search for ‘sqlite’ in the search term.  This will show you the &lt;strong&gt;SQLite for Windows Runtime&lt;/strong&gt; package:&lt;/p&gt;  &lt;p&gt;&lt;img title="Visual Studio Extensions dialog" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Visual Studio Extensions dialog" src="http://storage2.timheuer.com/sqliteext.png" width="866" height="446" /&gt;&lt;/p&gt;  &lt;p&gt;Click install my friends.  You will be prompted to restart Visual Studio which you should do.  Go ahead…I’ll wait.&lt;/p&gt;  &lt;h2&gt;Using the new package in your C#/VB app&lt;/h2&gt;  &lt;p&gt;Now that you have the SQLite for Windows Runtime package installed in your Visual Studio environment, you want to use it.  In a managed (.NET) app you would do the following steps.&lt;/p&gt;  &lt;p&gt;First, create your app (e.g., a Blank XAML app is fine).  Once within your app, use the &lt;em&gt;Add Reference&lt;/em&gt; mechanism to get to the next step.  Now you will not be browsing for any DLL directly like you would in a traditional .NET.  What we are adding here is a reference to the Extension SDK…not the library itself, a small but important distinction.  Once in the Add Reference dialog choose the Windows\Extensions view (see on left) and you’ll see SQLite for Windows Runtime. &lt;/p&gt;  &lt;p&gt;To correctly use this in a managed app you’ll need to select that &lt;strong&gt;*and*&lt;/strong&gt; the C++ runtime as seen below:&lt;/p&gt;  &lt;p&gt;&lt;img title="Add Reference dialog" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="Add Reference dialog" src="http://storage2.timheuer.com/sqliterefadd.png" width="835" height="269" /&gt;&lt;/p&gt;  &lt;p&gt;The reason for this is to ensure that your app declares the right dependencies that are needed for the app to run.  The likelihood of the C++ runtime not being on a Windows machine where your app will be installed is extremely rare, but you need to declare this anyway.  Failure to do so will fail your app certification tests.&lt;/p&gt;  &lt;p&gt;Now with this involved you can grab a managed wrapper to call the SQLite APIs as I’ve previously described in my HOWTO video.  I personally recommend the &lt;a href="http://www.nuget.org/packages/sqlite-net"&gt;&lt;strong&gt;sqlite-net&lt;/strong&gt;&lt;/a&gt; library (available via NuGet) to make this easier for you.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: sqlite-net is available as source in C#.  If you are using a VB app, you would first need to compile the sqlite-net source in a separate DLL so you can just add a reference to that in your VB project.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Using the sqlite-net library you can perform tasks using a model similar to LINQ2SQL where you can have types represent database entities:&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;     &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;sealed&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; MainPage : Page&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; MainPage()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InitializeComponent();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;         LoadData();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; LoadData()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;         var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, &lt;span style="color: #006080"&gt;"db.sqlite"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (var db = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SQLite.SQLiteConnection(dbPath))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum14" style="color: #606060"&gt;  14:&lt;/span&gt;             db.CreateTable&amp;lt;Person&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum15" style="color: #606060"&gt;  15:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum16" style="color: #606060"&gt;  16:&lt;/span&gt;             db.RunInTransaction(() =&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum17" style="color: #606060"&gt;  17:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum18" style="color: #606060"&gt;  18:&lt;/span&gt;                     db.Insert(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Person() { FirstName = &lt;span style="color: #006080"&gt;"Tim"&lt;/span&gt;, LastName = &lt;span style="color: #006080"&gt;"Heuer"&lt;/span&gt; });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum19" style="color: #606060"&gt;  19:&lt;/span&gt;                 });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum20" style="color: #606060"&gt;  20:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum21" style="color: #606060"&gt;  21:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum22" style="color: #606060"&gt;  22:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum23" style="color: #606060"&gt;  23:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum24" style="color: #606060"&gt;  24:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Person&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum25" style="color: #606060"&gt;  25:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum26" style="color: #606060"&gt;  26:&lt;/span&gt;     [SQLite.AutoIncrement, SQLite.PrimaryKey]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum27" style="color: #606060"&gt;  27:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; ID { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum28" style="color: #606060"&gt;  28:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; FirstName { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum29" style="color: #606060"&gt;  29:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; LastName { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum30" style="color: #606060"&gt;  30:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now you just need to specify your architecture for your app (x86, x64, ARM) and when you build, the appropriate sqlite3.dll will be packaged in your app automatically.  This also happens during the packaging step for the store so the right item is included for each architecture-specific package.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;: Do not package in DEBUG mode as you will fail certification.  Ensure that you build/package in RELEASE mode prior to submitting to the store or running the app certification toolkit (also referred to as WACK in some places).  You will get false positives if you are compiled in DEBUG mode.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This should make your development much easier without having to  swap out DLL files each time.&lt;/p&gt;



&lt;h2&gt;Using the new package in your C++ app&lt;/h2&gt;

&lt;p&gt;If you are a C++ developer you will do the same steps for installing and adding as a reference to your app.  In the C++ project system there is no 'Add Reference’ menu on the project context menu, but you will choose References and then the Add Reference button shows up.&lt;/p&gt;

&lt;p&gt;Once you have the reference to the SQLite SDK then as a C++ developer you can just #include the header and go to work:&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &amp;lt;sqlite3.h&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Since C++ projects are already architecture-specific you don’t have to worry about the AnyCPU situation because there isn’t one!  You’ll get IntelliSense on the API by just including the header.  The Extension SDK mechanism already includes the C++ props file to help the project system know where to get the header for development and the lib for linking when building.  Most C++ developers will interact with SQLite using the native APIs and not need any additional wrapper library.&lt;/p&gt;

&lt;h2&gt;Using the new package in your JavaScript app&lt;/h2&gt;

&lt;p&gt;If you are using JavaScript/HTML to developer your app, you will follow the same flow as the C#/VB flow.  Add a reference to both the SQLite SDK as well as the C++ runtime (to declare the dependency).  As to accessing SQLite in your app, you’ll need a WinRT wrapper library to do that.  The one that seems to be gaining favor is the &lt;strong&gt;&lt;a href="https://github.com/doo/SQLite3-WinRT"&gt;SQLite3-WinRT&lt;/a&gt;&lt;/strong&gt; library on GitHub.  I have not personally used this, but seen a lot of people using this.  It allows you to use the JavaScript programming model in a familiar way:&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; dbPath = Windows.Storage.ApplicationData.current.localFolder.path + &lt;span style="color: #006080"&gt;'\\db.sqlite'&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; SQLite3JS.openAsync(dbPath)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;   .then(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (db) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; db.runAsync(&lt;span style="color: #006080"&gt;'CREATE TABLE Item (name TEXT, price REAL, id INT PRIMARY KEY)'&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;   })&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt;   .then(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (db) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; db.runAsync(&lt;span style="color: #006080"&gt;'INSERT INTO Item (name, price, id) VALUES (?, ?, ?)'&lt;/span&gt;, [&lt;span style="color: #006080"&gt;'Mango'&lt;/span&gt;, 4.6, 123]);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;   })&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;   .then(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (db) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; db.eachAsync(&lt;span style="color: #006080"&gt;'SELECT * FROM Item'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (row) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;       console.log(&lt;span style="color: #006080"&gt;'Get a '&lt;/span&gt; + row.name + &lt;span style="color: #006080"&gt;' for $'&lt;/span&gt; + row.price);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt;     });&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt;   })&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum14" style="color: #606060"&gt;  14:&lt;/span&gt;   .then(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (db) {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum15" style="color: #606060"&gt;  15:&lt;/span&gt;     db.close();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum16" style="color: #606060"&gt;  16:&lt;/span&gt;   });&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;If using JavaScript this might be the way to go for your app.&lt;/p&gt;

&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;I’m very glad the SQLite team worked to get this deployment package out there.  I think for some Microsoft developers, using SQLite is fairly new and this SDK package will make it easier to ensure you have the right bits at the right time.  Of course you are free to do it your own way, but I think this will ease the process a little bit.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Why no NuGet? Well, the NuGet infrastructure right now doesn’t support some of these semantics around native components to deal with headers, linking and architecture-specific deployments.  We’ll continue to work with them to see if we can drive these changes into that platform.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So please feel free to download via the Visual Studio ‘Extensions and Updates’ option from within VS, download directly from the &lt;a href="http://visualstudiogallery.msdn.microsoft.com/23f6c55a-4909-4b1f-80b1-25792b11639e"&gt;Visual Studio Gallery&lt;/a&gt;, or download from the &lt;a href="http://sqlite.org/download.html"&gt;SQLite site&lt;/a&gt; themselves.  Once installed, once an update is available, VS will notify you that an update is available and you can install it.&lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;

&lt;p&gt;
  &lt;/p&gt;&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5fdb5a3d-4631-497a-8ebb-2f3fdeaf5500" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/sqlite/default.aspx" rel="tag"&gt;sqlite&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/sqlite-net/default.aspx" rel="tag"&gt;sqlite-net&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/sql/default.aspx" rel="tag"&gt;sql&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/metro/default.aspx" rel="tag"&gt;metro&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/win8appdev/default.aspx" rel="tag"&gt;win8appdev&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/win8/default.aspx" rel="tag"&gt;win8&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/windows+8/default.aspx" rel="tag"&gt;windows 8&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14842.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/wKz1YcXByUc" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx</guid>
            <pubDate>Tue, 07 Aug 2012 21:05:09 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx#feedback</comments>
            <slash:comments>111</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14842.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14842.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx</feedburner:origLink></item>
        <item>
            <title>Seeding your Metro style app with a SQLite database</title>
            <category>developer</category>
            <category>silverlight</category>
            <category>tech stuff</category>
            <category>xaml</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/KRrW1SMwUSo/seeding-your-metro-style-app-with-sqlite-database.aspx</link>
            <description>&lt;p&gt;It looks like people are really glad about being able to use SQLite within their Metro style apps.  I had written two previous posts (&lt;a href="http://timheuer.com/blog/archive/2012/05/20/using-sqlite-in-metro-style-app.aspx"&gt;Using SQLite in your Metro style app&lt;/a&gt; and &lt;a href="http://timheuer.com/blog/archive/2012/06/05/howto-video-using-sqlite-in-metro-style-app.aspx"&gt;HOWTO: Build and include SQLite&lt;/a&gt;) about this topic.  I’m pleased to report that since those posts the SQLite team released a build (3.7.13 as of the datestamp on this post) which also provides the binary (32- and 64-bit versions) pre-compiled for you for inclusion in your Metro style app.  You can get them from the SQLite download page.&lt;/p&gt;  &lt;p&gt;I’ve received a few comments/questions that I thought I might clarify in my own opinion (and some facts) about using SQLite in your app.&lt;/p&gt;  &lt;h2&gt;Creating new databases&lt;/h2&gt;  &lt;p&gt;The first thing to understand is that your app lives in a secure sandbox during operation.  This is also referred to as the AppContainer in the Metro style app world.  What this means is that you can only do certain operations in certain places or through brokers provided by the various WinRT APIs.  The first stumbling block I’ve seen people try to do is create a database in places where they cannot create databases.  When using SQLite, regardless of whatever client method you use to program with it, you need to pass in a full path to where the database should be created (or an existing one that you are opening).  Simply passing “foo.db” in the open method is not enough as that will assume an incorrect path to create the database file.  Another incorrect thing that folks are doing is using the &lt;em&gt;Windows.ApplicationModel.Package.Current.InstalledLocation.Path&lt;/em&gt; API.  This represents the location of where your app is &lt;strong&gt;installed&lt;/strong&gt; which is not an area you can directly write files/content.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: SQLite uses the CreateFile2 API which is not a WinRT broker API.  This means that it is restricted to certain areas of the AppContainer.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The other area where people are trying to create files is in the document library location for the user.  If you have declared the Document Library capability as well as provided a file association for the file you want to create, then you can read/write files in the Document Library &lt;strong&gt;using the WinRT broker APIs.&lt;/strong&gt;  This, however, is not possible using the CreateFile2 Win32 APIs.  &lt;/p&gt;  &lt;p&gt;This leaves the app’s ApplicationData location.  So the correct path to create your database from your app is &lt;em&gt;Windows.Storage.ApplicationData.Current.LocalFolder.Path&lt;/em&gt; as a starting point.  Here’s an example (using the sqlite-net library and C#):&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;     &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (var db = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SQLiteConnection(Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, &lt;span style="color: #006080"&gt;"foo.db"&lt;/span&gt;)))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// do stuff here&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now whenever I need to query this database I would use that same path from my app.&lt;/p&gt;

&lt;h2&gt;Seeding your app with starting data&lt;/h2&gt;

&lt;p&gt;Some folks want to start their application with some seed data.  There are a few ways that you could do this.  One way would be to create a database during startup and execute SQL statements against the newly-created database.  You would basically be shipping a script in your app that you’d run on the first run of the app after install.  If you went this route, then you’d use the method above to create the database and then execute your INSERT statements.&lt;/p&gt;

&lt;p&gt;Another method is to use an existing database file that perhaps you’ve already created.  The misconception here that people have is that since they include a seed database in their app that they can just open that database file and read/write on it.  The read part is correct, however you will fail to write to that file as it is in the package install location and not the ApplicationData location.  The first step you want to do in this approach is move your seed database to the place where you can write to it.  You can use the Windows.Storage APIs to accomplish this.  Here’s an example of how you might do this.  This assumes that your app has a file named “Northwind.sqlite” in your package:&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;// grab the file from the package installed location into a StorageFile&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; StorageFile seedFile = await StorageFile.GetFileFromPathAsync(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;     Path.Combine(Windows.ApplicationModel.Package.Current.InstalledLocation.Path,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #006080"&gt;"Northwind.sqlite"&lt;/span&gt;));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #008000"&gt;// copy the StorageFile to the ApplicationData folder&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt; await seedFile.CopyAsync(Windows.Storage.ApplicationData.Current.LocalFolder);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now the code above does the copy.  Of course you would want to add some logic to verify that you aren’t overwriting an existing database.  Just like anything else there are various ways to do this so I am not prescribing any one way.  Once you get the data where you need it to be, then you can work with the database how you’d like.&lt;/p&gt;

&lt;p&gt;I hope this helps understand the method of creating (in the right place) and seeding your app with a SQLite database.  Hope this helps!&lt;/p&gt;

&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c9ed0920-011d-4495-b984-25f98acb7cf2" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/sqlite-net/default.aspx" rel="tag"&gt;sqlite-net&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/sqlite/default.aspx" rel="tag"&gt;sqlite&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/winrt/default.aspx" rel="tag"&gt;winrt&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/xaml/default.aspx" rel="tag"&gt;xaml&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/metro/default.aspx" rel="tag"&gt;metro&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14841.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/KRrW1SMwUSo" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2012/06/28/seeding-your-metro-style-app-with-sqlite-database.aspx</guid>
            <pubDate>Thu, 28 Jun 2012 15:59:48 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2012/06/28/seeding-your-metro-style-app-with-sqlite-database.aspx#feedback</comments>
            <slash:comments>43</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14841.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14841.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2012/06/28/seeding-your-metro-style-app-with-sqlite-database.aspx</feedburner:origLink></item>
        <item>
            <title>AutoHotkey&amp;ndash;my new snippet tool</title>
            <category>blogging</category>
            <category>community</category>
            <category>silverlight</category>
            <category>tech stuff</category>
            <category>visual studio</category>
            <category>xaml</category>
            <link>http://feeds.timheuer.com/~r/timheuer/~3/aXJDeBxIJy0/autohotkey-a-useful-snippet-macro-tool.aspx</link>
            <description>&lt;p&gt;This week was &lt;strong&gt;&lt;a href="http://www.msteched.com"&gt;TechEd North America&lt;/a&gt;&lt;/strong&gt;, a conference from Microsoft for technical professionals covering the span of pretty much everything Microsoft produces to support IT professionals and software developers.  I was pleased to have been invited to speak on &lt;a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV353"&gt;developing Metro style apps in XAML for .NET developers&lt;/a&gt;.  Like most developer presenters, I planned on showing a lot of demos, using different tools, editors, and varying code samples, URLs, etc.  When you are a presenter at a conference you usually don’t have the luxury of sitting in your office and doing things without distractions.  You want to get across your message of your presentation and also be able to have some good demonstrations articulating your points.  When you have a lot of demos, most of the time presenters will rely on some form of snippets – something for them to either type in quickly, copy/paste, or drag/drop onto editors.&lt;/p&gt;  &lt;p&gt;I’ve used various snippet concepts over the years:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Using the Visual Studio Toolbox area and dragging text there (yes, did you know you can do that) &lt;/li&gt;    &lt;li&gt;VS Code Snippets &lt;/li&gt;    &lt;li&gt;Custom WPF “always on top” snippet utility (developed by a WPF team member when she was doing presentations) &lt;/li&gt;    &lt;li&gt;Other 3rd party macro tools &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;But mostly I, like others, have relied on good ol’ notepad.  For each presentation I have a file and just blocks of code separated with headers denoting to me which step the snippet is for in the demonstration.  I don’t &lt;em&gt;always&lt;/em&gt; use snippets because I do have some sense of pride in being able to demonstrate &lt;strong&gt;yes, I do actually know what I’m talking about and not just always copy/pasting!&lt;/strong&gt;  However, again, for efficiency and to get many points across, it is an effective way to start from a blank slate (project) and build up how code gets structured for your particular concept.&lt;/p&gt;  &lt;p&gt;Notepad has been great and reliable so I’ve always used it.  The other methods are more laborious to set up and sometimes error prone…aside from the fact they don’t work in all scenarios (i.e., VS code snippets don’t work in XAML…argh).  &lt;/p&gt;  &lt;p&gt;This week while preparing in the speaker room with my colleague &lt;a href="http://twitter.com/john_lam"&gt;&lt;strong&gt;John Lam&lt;/strong&gt;&lt;/a&gt; (who also &lt;a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV350"&gt;gave a presentation on the Windows Runtime&lt;/a&gt;) he was using a new utility I hadn’t heard of before.  I usually get my little widgets of knowledge from &lt;strong&gt;&lt;a href="http://www.hanselman.com/blog/ScottHanselmans2011UltimateDeveloperAndPowerUsersToolListForWindows.aspx"&gt;Scott Hanselman’s massive list of tools&lt;/a&gt;&lt;/strong&gt;.  Most I don’t use, but there are some really helpful gems in there.  So I was surprised about this new tool John was showing me I hadn’t heard of before.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;YES, I realize this is probably not a new tool and this invites comments of ‘duh, this has been around forever dude’ so feel free to not post those.  It is new to me, like in that new used car kind of way.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When John was walking through his demo he was typing what seemed like random keystrokes in various places: VS, Blend, Notepad, dialogs, command prompt, web apps.  All of these were translating into blocks of text, shell commands, etc.  He lit up showing me about this new tool, &lt;strong&gt;&lt;a href="http://www.autohotkey.com/"&gt;AutoHotkey&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;AutoHotkey is a very small tool that basically is a mini macro language.  I’m going to completely under-sell it for it’s likely true abilities, but even for the simplest use it has been a new favorite.  AutoHotkey works by listening to the accessibility features in Windows (also referred to UIA) for anything that has input focus.  Yes, that’s right, anything.  You define a ‘macro’ keyword and then what the command defines.  For me, this was just needing to be a series of copy/paste automation.  Here’s an example of one of my snippets:&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;     &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; ; clear clipboard&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; ^+x::&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt; clipboard = ; null&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; return&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; ; Initial StackPanel stubs&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt; ::d1::&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt; clipboard = &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt; (&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;StackPanel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;TextBlock&lt;/span&gt; &lt;span style="color: #ff0000"&gt;FontSize&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="53"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="FirstName"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Button&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Content&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Click Me"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Click&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Button_Click_1"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;StackPanel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum14" style="color: #606060"&gt;  14:&lt;/span&gt; )&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum15" style="color: #606060"&gt;  15:&lt;/span&gt; send ^v&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span id="lnum16" style="color: #606060"&gt;  16:&lt;/span&gt; return&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Anything preceded with a semicolon is a comment.  The next line is the macro command it will listen for when input has focus.  In the above there are two “^+x” means CTRL+SHIFT+X.  The command is followed by two colons which is the delimiter for the command.  The simpler one for “d1” shows how you issue a copy/paste.  I tell it what I want to put on the clipboard, then say to send a CTRL+V (paste) and end the script with a ‘return’ statement.&lt;/p&gt;

&lt;p&gt;The beauty is that there is no “app” that you have to run – your script is basically the app.  You create your script in a text file named with an .ahk extension.  When your script is complete, double-click on it and it is now listening.  You’ll get an icon in the system tray showing you that it is running and some options (i.e., you can pause it, edit, reload to tweak):&lt;/p&gt;

&lt;p&gt;&lt;img title="AutoHotkey example" style="float: none; margin-left: auto; display: block; margin-right: auto" alt="AutoHotkey example" src="http://storage2.timheuer.com/autohotkey.gif" /&gt;&lt;/p&gt;

&lt;p&gt;What is cool is that if you want to see how it is working and what it is doing you can look at the “spy” feature:&lt;/p&gt;

&lt;p&gt;&lt;img title="AutoHotkey spy " style="float: none; margin-left: auto; display: block; margin-right: auto" alt="AutoHotkey spy " src="http://storage2.timheuer.com/autohotkeysp.PNG" width="640" height="322" /&gt;&lt;/p&gt;

&lt;p&gt;to see how it is listening to automation events and input focus.  &lt;/p&gt;

&lt;p&gt;The other great feature it has is that you can compile your script.  What this does is take your script (ahk file) and compiles the AutoHotkey runtime into it as well, producing an EXE.  Now you can take that EXE to any machine and double-click and boom, your snippets are available and listening.  So now I can can compile my snippets for each presentation and put them alongside my other presentation materials on my SkyDrive…keeping everything together and quickly restorable to any machine.  Awesome.&lt;/p&gt;

&lt;p&gt;I immediately started using it and became an instant evangelist to other presenters that moment.  &lt;strong&gt;&lt;a href="http://twitter.com/John_Papa"&gt;John Papa&lt;/a&gt;&lt;/strong&gt; used it in his presentation as well and &lt;strong&gt;&lt;a href="http://twitter.com/Pete_Brown"&gt;Pete Brown&lt;/a&gt; &lt;/strong&gt;I think is now converted as well.  For me it worked great, no issues.  &lt;/p&gt;

&lt;p&gt;Creating the script was a bit of trial and error because the documentation is, well, not great.  It does SO MUCH MORE than what I’m using it for which is why I felt the docs lacking for the simple cases.  The ‘return’ keyword was critical for me to get mine working without error.  When you install AutoHotkey there is also an “Extras” folder that contains plugins for various editors: VIM, Emacs, TextPad, SciTE, Notepad++ and more.  These allow you to get syntax highlighting in these editors quickly.&lt;/p&gt;

&lt;p&gt;Thanks to John Lam for turning me on to this. &lt;strong&gt;UPDATE&lt;/strong&gt;: I’m the idiot because it *is* on Scott’s list.  My search wasn’t good enough apparently :-) &lt;strike&gt;and maybe &lt;strong&gt;&lt;a href="http://twitter.com/shanselman"&gt;Scott Hanselman&lt;/a&gt;&lt;/strong&gt; will consider it for his ultimate tools list this year&lt;/strike&gt;.  What is also awesome is that there is a &lt;a href="http://chocolatey.org/packages/autohotkey"&gt;Chocolatey installer&lt;/a&gt; for it so I just added this to my personal just-repaved-my-machine-please-give-me-my-utilities package.  Be sure to check it out if you find yourself doing a lot of snippets.&lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;

&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:38921844-e919-40bc-90b1-aacac7f29299" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px"&gt;&lt;span class="tags"&gt;tags: &lt;a href="http://timheuer.com/blog/Tags/snippets/default.aspx" rel="tag"&gt;snippets&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/visual+studio/default.aspx" rel="tag"&gt;visual studio&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/autohotkey/default.aspx" rel="tag"&gt;autohotkey&lt;/a&gt;, &lt;a href="http://timheuer.com/blog/Tags/tools/default.aspx" rel="tag"&gt;tools&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;hr /&gt;&lt;div class="cc-license"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://timheuer.com/blog/aggbug/14840.aspx" width="1" height="1" /&gt;&lt;img src="http://feeds.feedburner.com/~r/timheuer/~4/aXJDeBxIJy0" height="1" width="1"/&gt;</description>
            <dc:creator>Tim Heuer</dc:creator>
            <guid isPermaLink="false">http://timheuer.com/blog/archive/2012/06/13/autohotkey-a-useful-snippet-macro-tool.aspx</guid>
            <pubDate>Wed, 13 Jun 2012 13:43:20 GMT</pubDate>
            <comments>http://timheuer.com/blog/archive/2012/06/13/autohotkey-a-useful-snippet-macro-tool.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://timheuer.com/blog/comments/commentRss/14840.aspx</wfw:commentRss>
            <trackback:ping>http://timheuer.com/blog/services/trackbacks/14840.aspx</trackback:ping>
        <feedburner:origLink>http://timheuer.com/blog/archive/2012/06/13/autohotkey-a-useful-snippet-macro-tool.aspx</feedburner:origLink></item>
    </channel>
</rss>
