<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Josh Einstein</title>
	
	<link>http://josheinstein.com/blog</link>
	<description>I should be sleeping.</description>
	<lastBuildDate>Sat, 15 Oct 2011 17:37:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/josheinstein" /><feedburner:info uri="josheinstein" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjosheinstein" 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.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjosheinstein" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/josheinstein" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fjosheinstein" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fjosheinstein" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fjosheinstein" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><item>
		<title>Running out of iCloud space? Trim your backups.</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/M8i7q61G6UA/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/10/running-out-of-icloud-space-trim-your-backups/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 17:33:13 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[iCloud]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2011/10/running-out-of-icloud-space-trim-your-backups/</guid>
		<description><![CDATA[One thing I have been hearing a lot lately from several friends is that after attempting to back up their iPhone or iPad to the all new iCloud service, it&#8217;s telling them that the backup size is too big for the initial free 5GB quota and that they need to purchase more space. This might <a href='http://josheinstein.com/blog/index.php/2011/10/running-out-of-icloud-space-trim-your-backups/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>One thing I have been hearing a lot lately from several friends is that after attempting to back up their iPhone or iPad to the all new iCloud service, it&#8217;s telling them that the backup size is too big for the initial free 5GB quota and that they need to purchase more space.</p>

<p>This might seem logical on the surface. I have a 32GB iPhone that is nearly full, how can I possibly expect that to fit in a 5GB space? But when it comes to the size of your backup, what&#8217;s really important is what kind of data is filling up your device.</p>

<h3>What is not backed up</h3>

<p>Not all data stored on your device is backed up. So a whole lot of the 32GB of space that I&#8217;m using up is not included at all in the backup size. This is okay though because the things that aren&#8217;t backed up don&#8217;t need to be. Just like on a computer, there&#8217;s little value in backing up the Windows directory when Windows can just be reinstalled from the DVD.</p>

<p>So what kind of data is not included in the backup?</p>

<ul>
<li><p>The operating system itself and any system updates are not included in the backup.</p></li>
<li><p>Music, photos, videos, etc sync&#8217;d from your computer are not backed up (the idea being that they already exist on your computer so there is no need to back it up.)</p></li>
<li><p>Apps and other content purchased from the app store are not backed up because the app store already has a copy and they can be re-downloaded at any time.</p></li>
<li><p>Properly developed applications that cache large amounts of data (for example the Maps app) keep this data in a location that is not backed up because cached data is safe to delete.</p></li>
</ul>

<p>In reality, the items listed above make up the bulk of the data on your device. So then what does need to get backed up? And why are some people finding that 5GB isn&#8217;t enough to cut it?</p>

<h3>What is backed up?</h3>

<p>So what is really taking up all that space? Most likely it&#8217;s either pictures in your camera roll or applications that store large amounts of data in locations that are backed up. If like me, you rarely pull your photos out of your camera roll, you will probably want to do that periodically because it can significantly bloat the size of your backup.</p>

<p>But each application also stores it&#8217;s own private data in locations that may or may not be backed up depending on how it&#8217;s used. Unlike the Maps application I gave in the earlier example, the iBooks application stores a potentially large amount of data such as PDF&#8217;s and other ebooks that you really do want to get backed up.</p>

<p>But sometimes the decision is not so obvious. For example, back issues of &#8220;The Economist&#8221; magazine? I&#8217;ll never look at them again after I read them and they are potentially huge. But by default, they are going to get backed up. So how do I tell iCloud to ignore them?</p>

<h3>Telling iCloud which apps to back up</h3>

<p>Fortunately iCloud gives you a pretty easy to use interface for toggling on and off which applications you want to include in your backup. Remember that the applications themselves are never backed up, but this controls whether or not the data stored in those applications is.</p>

<ol>
<li>Open the Settings app</li>
<li>Tap iCloud in the list</li>
<li>Tap &#8220;Storage and Backup&#8221; at the bottom</li>
<li>If &#8220;iCloud Backup&#8221; is not switched on, switch it on</li>
<li>Tap &#8220;Manage Storage&#8221;</li>
<li>Tap on your device at the top of the page</li>
</ol>

<p>Here, you will see a list of applications with on/off switches next to them and the approximate size of the data in those apps. Look over the list for large amounts of data in applications that you might not want backed up. For example, my preferred podcast app &#8220;Downcast&#8221; defaults to being backed up but by nature, podcasts are relatively useless after they are listened to and get more irrelevant the older they get. Recent podcasts can always be downloaded again. So I turned that off and saved a lot of space in my backup.</p>

<p>From this screen you can also see the size of your camera roll. If it&#8217;s very large, you probably ought to pull the photos off onto your computer and try to do that more regularly.</p>

<p>With a few tweaks, I am sure you can get your backup size to well within the 5GB allotment.</p>

<p><img src="http://josheinstein.com/blog/wp-content/uploads/2011/10/20111015-133156.jpg" alt="iCloud Backup Options" /></p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/M8i7q61G6UA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/10/running-out-of-icloud-space-trim-your-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/10/running-out-of-icloud-space-trim-your-backups/</feedburner:origLink></item>
		<item>
		<title>Do you use SQL Server? If you don’t follow Conor, you are probably a moron.</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/AhSlGQXxQaE/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/09/do-you-use-sql-server-if-you-dont-follow-conor-you-are-probably-a-moron/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 00:58:23 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2011/09/do-you-use-sql-server-if-you-dont-follow-conor-you-are-probably-a-moron/</guid>
		<description><![CDATA[Yep. Conor vs SQL]]></description>
			<content:encoded><![CDATA[<p>Yep. <a href="http://blogs.msdn.com/b/conor_cunningham_msft">Conor vs SQL</a></p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/AhSlGQXxQaE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/09/do-you-use-sql-server-if-you-dont-follow-conor-you-are-probably-a-moron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/09/do-you-use-sql-server-if-you-dont-follow-conor-you-are-probably-a-moron/</feedburner:origLink></item>
		<item>
		<title>[Solved] This program can’t start because mscoree.dll is missing from your computer.</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/QIAmy5R0i5o/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/09/solved-this-program-cant-start-because-mscoree-dll-is-missing-from-your-computer/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 15:40:41 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[server-core]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/?p=535</guid>
		<description><![CDATA[While trying to download and install some Windows updates on a machine running Windows 2008 R2 Server Core, I got the following message and the updates failed. This program can&#8217;t start because mscoree.dll is missing from your computer. The updates in question are listed below. KB2468871 &#8211; Update for Microsoft .NET Framework 4 on Windows <a href='http://josheinstein.com/blog/index.php/2011/09/solved-this-program-cant-start-because-mscoree-dll-is-missing-from-your-computer/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>While trying to download and install some Windows updates on a machine running
Windows 2008 R2 Server Core, I got the following message and the updates failed.</p>

<blockquote>
  <p>This program can&#8217;t start because mscoree.dll is missing from your computer.</p>
</blockquote>

<p>The updates in question are listed below.</p>

<ol>
<li><p>KB2468871 &#8211; Update for Microsoft .NET Framework 4 on Windows XP,
Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008,
Windows Server 2008 R2 for x64-based Systems</p></li>
<li><p>KB2533523 &#8211; Update for Microsoft .NET Framework 4 on Windows XP,
Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008,
Windows Server 2008 R2 for x64-based Systems</p></li>
<li><p>KB2539636 &#8211; Security Update for Microsoft .NET Framework 4 on
Windows XP, Windows Server 2003, Windows Vista, Windows 7,
Windows Server 2008, Windows Server 2008 R2 for x64-based Systems</p></li>
</ol>

<p>I couldn&#8217;t find anything on Google that was relevant so I started poking around
in the Windows system directories, .NET Framework directories, and the registry
to see what was going on.</p>

<p>The machine itself is running the x64 flavor of Windows, but apparently I did
not install the WoW64 support for .NET and PowerShell.</p>

<p>A quick check at a PowerShell prompt confirmed this.</p>

<pre><code>PS&gt; Get-WindowsFeature Wow64*

Display Name                                            Name
------------                                            ----
[X] WoW64 Support                                       WoW64-Support
    [X] WoW64                                           WoW64-ServerCore
    [ ] WoW64 for .NET Framework 2.0 and Windows Pow... WoW64-NetFx2-Support
        [ ] WoW64 for .NET Framework 2.0                WoW64-NetFx2
        [ ] WoW64 for Windows PowerShell                WoW64-PowerShell
    [ ] WOW64 for .NET Framework 3.0 and 3.5            WoW64-NetFx3
    [ ] WoW64 for Print Services                        WoW64-PrintServices
    [ ] WoW64 for Input Method Editor                   WoW64-InputMethodEditor
    [ ] WoW64 for Subsystem for UNIX-based Applications WoW64-SUA
</code></pre>

<p>Once I installed those features (and restarted the server for good measure) all
was well.</p>

<pre><code>PS&gt; Get-WindowsFeature Wow64-NetFx*,Wow64-PowerShell | Add-WindowsFeature
PS&gt; Restart-Computer
</code></pre>

<p>Just putting this out there in the hopes that it helps someone else.</p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/QIAmy5R0i5o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/09/solved-this-program-cant-start-because-mscoree-dll-is-missing-from-your-computer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/09/solved-this-program-cant-start-because-mscoree-dll-is-missing-from-your-computer/</feedburner:origLink></item>
		<item>
		<title>How easy it would be to harvest passwords at a bar</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/MSNGKTLpbSw/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/09/how-easy-it-would-be-to-harvest-passwords-at-a-bar/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 00:53:36 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2011/09/how-easy-it-would-be-to-harvest-passwords-at-a-bar/</guid>
		<description><![CDATA[I&#8217;m here at my favorite bar to kick off the start of the NFL season (and some guy on TV keeps interrupting about some jobs &#8220;plan&#8221;) and I noticed there&#8217;s a strong wifi signal where there used to be none. Huh? Did this place get wifi since last time I was here? I asked around <a href='http://josheinstein.com/blog/index.php/2011/09/how-easy-it-would-be-to-harvest-passwords-at-a-bar/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m here at my favorite bar to kick off the start of the NFL season (and some guy on TV keeps interrupting about some jobs &#8220;plan&#8221;) and I noticed there&#8217;s a strong wifi signal where there used to be none. Huh? Did this place get wifi since last time I was here? I asked around and apparently it&#8217;s news to them too.</p>

<p>But actually it&#8217;s not just one wifi signal&#8230; There&#8217;s three! But they all have the exact same signal strength even though they have very different SSID&#8217;s.</p>

<p><a href="http://josheinstein.com/blog/wp-content/uploads/2011/09/20110908-085130.jpg"><img src="http://josheinstein.com/blog/wp-content/uploads/2011/09/20110908-085130.jpg" alt="20110908-085130.jpg" class="alignnone size-full" /></a></p>

<p>Now I have no idea if these 3 companies are in cahoots or what but it seems odd to me that three cable companies are providing wifi hotspots from the same device. There is a hotel next to the bar but it&#8217;s much too far to get a signal. Trust me, I&#8217;ve tried.</p>

<p>What the hell, all my shit is SSL protected, I decide to check it out. All three networks give the same private IP range and each one prompts for my credentials with their respective service. The pages are pretty authentic looking (as compared to the usual illiterate Nigerian Paypal hacker&#8217;s work).</p>

<p><a href="http://josheinstein.com/blog/wp-content/uploads/2011/09/20110908-085159.jpg"><img src="http://josheinstein.com/blog/wp-content/uploads/2011/09/20110908-085159.jpg" alt="20110908-085159.jpg" class="alignnone size-full" /></a></p>

<p>Maybe they are legit, but I&#8217;m not taking any chances. But it got me thinking, how easy would it be to go around to various bars, malls, coffee shops, etc and just drop off a rogue battery-powered access point in a bush that just prompts people for their Gmail or Apple ID&#8217;s. Even people that are trained to ignore phishing emails will probably gladly <a href="http://www.whoswatchingcharlottesville.org/password.html">hand over the keys to the castle</a> in their desperate search for connectivity.</p>

<p>I&#8217;m paranoid about this stuff. And so far, (knock wood) I&#8217;ve never been hacked.</p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/MSNGKTLpbSw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/09/how-easy-it-would-be-to-harvest-passwords-at-a-bar/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/09/how-easy-it-would-be-to-harvest-passwords-at-a-bar/</feedburner:origLink></item>
		<item>
		<title>Another handy iOS tip: Folders the the dock</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/yLQq98QjAi0/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/09/another-handy-ios-tip-folders-the-the-dock/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 21:43:14 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2011/09/another-handy-ios-tip-folders-the-the-dock/</guid>
		<description><![CDATA[Did you know you can put a folder in the icon dock on iPhone or iPad? If you have a lot of home screens and you&#8217;re having a hard time deciding which of your apps are worthy enough to be accessible from all of them, this technique can save you a few swipes. Follow me]]></description>
			<content:encoded><![CDATA[<p>Did you know you can put a folder in the icon dock on iPhone or iPad? If you have a lot of home screens and you&#8217;re having a hard time deciding which of your apps are worthy enough to be accessible from all of them, this technique can save you a few swipes.</p>

<p><a href="http://about.me/josheinstein">Follow me</a></p>

<p><a href="http://josheinstein.com/blog/wp-content/uploads/2011/09/20110902-054031.jpg"><img src="http://josheinstein.com/blog/wp-content/uploads/2011/09/20110902-054031.jpg" alt="20110902-054031.jpg" class="alignnone size-full" /></a></p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/yLQq98QjAi0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/09/another-handy-ios-tip-folders-the-the-dock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/09/another-handy-ios-tip-folders-the-the-dock/</feedburner:origLink></item>
		<item>
		<title>Major update to Parallels iPhone/iPad app</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/5clhF6Qbia0/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/09/major-update-to-parallels-iphoneipad-app/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 05:19:55 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2011/09/major-update-to-parallels-iphoneipad-app/</guid>
		<description><![CDATA[The updated version of Parallels Mobile for iPhone and iPad allows you to remotely control your Mac the same way it lets you remotely control your virtual machine. This eliminates the need to use a combination of VPN and VNC to remotely access your Mac and in most cases it’ll be a much smoother experience <a href='http://josheinstein.com/blog/index.php/2011/09/major-update-to-parallels-iphoneipad-app/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>The updated version of <a href="http://itunes.apple.com/us/app/parallels-mobile/id295531450?mt=8&amp;ls=1">Parallels Mobile for iPhone and iPad</a> allows you to remotely control your Mac the same way it lets you remotely control your virtual machine. This eliminates the need to use a combination of VPN and VNC to remotely access your Mac and in most cases it’ll be a much smoother experience as well since VNC sucks. Now if they could just find the time to bake in a general purpose RDP client I could be down to just one remoting app.</p>

<p>It also adds some welcome features such as clipboard sharing and audio playback.</p>

<p><strike>It&#8217;s free for all registered users of Parallels Desktop so go grab it.</strike></p>

<p><em>Update: I&#8217;m not sure why I thought it was free. It has a $4.99 introductory price tag.</em></p>

<p><img src="http://josheinstein.com/blog/wp-content/uploads/2011/09/20110901-011815.jpg" alt="20110901-011815.jpg" class="alignnone size-full" /></p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/5clhF6Qbia0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/09/major-update-to-parallels-iphoneipad-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/09/major-update-to-parallels-iphoneipad-app/</feedburner:origLink></item>
		<item>
		<title>Re: 15 million tablets; What might Microsoft do?</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/M8XzLeNdB6M/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/08/re-15-million-tablets-what-might-microsoft-do/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 19:17:58 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tablet PC]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/?p=522</guid>
		<description><![CDATA[I posted a response to Rob Bushway&#8217;s post: 15 million tablets; What might Microsoft do? I vented a bit of my frustration with how Microsoft has totally blown their leadership position in the tablet industry and I figured I would re-post it here. Here&#8217;s the closing statement on the original post: Is it possible that <a href='http://josheinstein.com/blog/index.php/2011/08/re-15-million-tablets-what-might-microsoft-do/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.tumblr.com/tumblr_lqala67P8K1qkd790.jpg" alt="Motion LE1600" /></p>

<p>I posted a response to Rob Bushway&#8217;s post: <a href="http://www.robbushway.com/2011/08/21/15-million-tablets-what-might-microsoft-do/">15 million tablets; What might Microsoft do?</a> I vented a bit of my frustration with how Microsoft has totally blown their leadership position in the tablet industry and I figured I would re-post it here.</p>

<p>Here&#8217;s the closing statement on the original post:</p>

<blockquote>
  <p>Is it possible that Microsoft might finally bite the bullet
  and seriously undertake the overhaul of Windows’ and
  Office’s tablet features that we’ve all been begging for?
  Incorporate the Intel shell software that allows iPad-like
  responsiveness? Pair this with a properly-designed hardware
  platform that complements the new software features? In
  short, is it possible that this order might cause Microsoft
  to finally, seriously, design the tablet that they’ve always
  talked about? I think the possibilities here might be huge,
  but only time will tell.</p>
  
  <p>What do you think..???</p>
</blockquote>

<p>I think it’s a lost cause for them. The blew the tablet opportunity. They couldn’t get on the same page. They couldn’t even sell the concept internally. Apple came along and wiped the floor with them right out of the gate by doing what we all told them they had to do years ago – build an OS and apps with the tablet form factor in mind from birth.</p>

<p>The whole running on top of Windows thing was a good option back in the early days when there would have been no tablet apps. But they never led the charge with tablet-specific apps the way Apple did. They couldn’t rally developers because those developers would go broke trying to prop up a system Microsoft couldn’t even unite behind.</p>

<p>Finally, Apple has proven that when it comes to hardware, choice sucks. The old model of shipping an OS to a variety of OEM’s is simply a losing model. The OEM’s have no interest in the long term success of Microsoft’s tablet strategy. They just want to make payroll in an industry with razor-thin margins and in doing so they crap up every machine they make and skimp on parts and materials. (I’m giving Motion Computing a pass here, their LE1600 was a thing of beauty.)</p>

<p>In order for Microsoft to get people to pay attention to their tablets, there needs to be a reason for me to put down my iPad for a second and take notice. At this point, the damned thing would have to make me breakfast for me to even consider it.</p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/M8XzLeNdB6M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/08/re-15-million-tablets-what-might-microsoft-do/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/08/re-15-million-tablets-what-might-microsoft-do/</feedburner:origLink></item>
		<item>
		<title>Is the home button on your iPhone 4 acting up?</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/scjXLrZqN_c/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/07/is-the-home-button-on-your-iphone-4-acting-up/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 16:00:35 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/?p=510</guid>
		<description><![CDATA[Recently I&#8217;ve noticed two problems with my iPhone 4. First, the home button was &#8220;missing&#8221; clicks half the time. Trying to double click the home button became increasingly more difficult. The button moved freely enough and did not seem stuck, but the press just didn&#8217;t register. Then when attached to my car charger, after a <a href='http://josheinstein.com/blog/index.php/2011/07/is-the-home-button-on-your-iphone-4-acting-up/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve noticed two problems with my iPhone 4. First, the home button was &#8220;missing&#8221; clicks half the time. Trying to double click the home button became increasingly more difficult. The button moved freely enough and did not seem stuck, but the press just didn&#8217;t register.</p>

<p>Then when attached to my car charger, after a few minutes it would throw up a message saying &#8220;Charging is not supported with this accessory.&#8221; and sure enough the charging indicator showed that the battery was no longer charging.</p>

<p>After searching online I found some suggestions indicating that slapping the phone against your leg could fix the home button issue and others suggested blowing compressed air into the charging port. This leads me to believe the issue is due to gunk in the charging port which finds it&#8217;s way under the home button, preventing contact behind an otherwise freely moving button.</p>

<p>My charging port looked pretty filthy so I tried the compressed air and it seems to have worked pretty well&#8230; For now.</p>

<p><img src="http://josheinstein.com/blog/wp-content/uploads/2011/07/20110701-115821.jpg" alt="iPhone charging port" /></p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/scjXLrZqN_c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/07/is-the-home-button-on-your-iphone-4-acting-up/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/07/is-the-home-button-on-your-iphone-4-acting-up/</feedburner:origLink></item>
		<item>
		<title>Remote lock my iPad (just in case)</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/2oU9uouo1q4/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/05/remote-lock-my-ipad-just-in-case/#comments</comments>
		<pubDate>Sun, 15 May 2011 02:24:28 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2011/05/remote-lock-my-ipad-just-in-case/</guid>
		<description><![CDATA[Anyone that knows me knows full well I am the farthest thing possible from an Apple fan boy. But I&#8217;ve slowly but surely been sucked into the blissful white and brushed aluminum dream world. This fact bothers me enough that I&#8217;ve considered giving Windows Phone 7 a &#8220;pity fuck&#8221; just to strike some balance in <a href='http://josheinstein.com/blog/index.php/2011/05/remote-lock-my-ipad-just-in-case/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Anyone that knows me knows full well I am the farthest thing possible from an Apple fan boy. But I&#8217;ve slowly but surely been sucked into the blissful white and brushed aluminum dream world. This fact bothers me enough that I&#8217;ve considered giving Windows Phone 7 a &#8220;pity fuck&#8221; just to strike some balance in my technical world.</p>

<p>However, I did have a moment of brilliance earlier that would not have been possible unless I was locked into the Apple monoculture.</p>

<p>I left my iPad in my car while I was in the movies with my son. I was pretty sure I locked the car but not 100%. We were already seated by the time I realized this and dragging a 4 year old back to the car was going to be a huge pain, especially considering I was fairly certain it was locked.</p>

<p>But then I remembered that I could remotely set a lock code on my iPad from my iPhone (using the <a href="http://bit.ly/kqeNd3">Find My iPhone</a> application) and that was enough peace of mind for me. The hardware is replaceable. Of course a sophisticated thief that really wanted the data could bypass the lock or shut down the radio so it couldn&#8217;t be tracked, but by remotely locking or wiping an iPad you are much better off than never knowing what happened to it.</p>

<p><img src="http://josheinstein.com/blog/wp-content/uploads/2011/05/20110514-102247.jpg" alt="20110514-102247.jpg" class="alignnone size-full" />
<img src="http://josheinstein.com/blog/wp-content/uploads/2011/05/20110514-102302.jpg" alt="20110514-102302.jpg" class="alignnone size-full" /></p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/2oU9uouo1q4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/05/remote-lock-my-ipad-just-in-case/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/05/remote-lock-my-ipad-just-in-case/</feedburner:origLink></item>
		<item>
		<title>Supporting markdown in applications</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/zLT8qx6hTJQ/</link>
		<comments>http://josheinstein.com/blog/index.php/2011/04/supporting-markdown-in-applications/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 20:10:26 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Markdown]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/?p=488</guid>
		<description><![CDATA[In just about every application I&#8217;ve ever developed, there&#8217;s at least one multi-line text box that takes free form input from the user. In some applications (such as email, Twitter, log entry, etc.) this might be the primary use case. In other applications it might be a simple &#8220;description&#8221; box hidden away in a properties <a href='http://josheinstein.com/blog/index.php/2011/04/supporting-markdown-in-applications/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>In just about every application I&#8217;ve ever developed, there&#8217;s at least one multi-line text box that takes free form input from the user. In some applications (such as email, Twitter, log entry, etc.) this might be the primary use case. In other applications it might be a simple &#8220;description&#8221; box hidden away in a properties dialog.</p>

<p>But in any case, it&#8217;s always a challenge to use anything more than plain text for a variety of reasons. First of all, even though WPF, Silverlight, and Windows Forms all have built-in rich text controls, they lack the basic UI elements such as toolbars for formatting. In web applications it&#8217;s even worse because there is no native rich text control so you gotta find a component.</p>

<p>Then there is the issue of what to do with the data. Windows Forms produces RTF formatted text. WPF and Silverlight produce XAML. Web browsers produce HTML. But these three formats aren&#8217;t easily interchangeable and they all suffer from the fact that they look terrible when circumstances require you to present it as plain text.</p>

<p>There is a solution! It&#8217;s called <a href="http://daringfireball.net/projects/markdown">markdown</a>. And it&#8217;s something you&#8217;ve probably used before if you&#8217;ve ever used StackOverflow.</p>

<p>With markdown, you can input and store the content as plain text but render it as rich formatted text. The advantage over <em>markup</em> such as HTML is that the syntax is designed to be very readable as plain text. And since the formatting characters are so intuitive and natural, you don&#8217;t need superfluous toolbars or menus to format your content. Since there is no need to strip the formatting when displaying as plain text, you don&#8217;t need to worry about how it looks on devices or application screens that don&#8217;t support rich text.</p>

<p><img src="http://josheinstein.com/blog/wp-content/uploads/2011/04/20110430-051727.jpg" alt="Markdown" /></p>

<p>Of course it&#8217;s not HTML so it doesn&#8217;t support anything like layout or complicated formatting. It&#8217;s simply rich text. But it does support links, headings, lists, and images. You can refer to <a href="http://daringfireball.net/projects/markdown">John Gruber&#8217;s markdown</a> page for a more thorough explanation of where and how markdown fits in the context of HTML.</p>

<p>So I&#8217;m making more of an effort to support and promote markdown everywhere that I use multi-line text boxes and hopefully you&#8217;ll consider it too. I set up a WordPress plugin created by <a href="http://michelf.com/projects/php-markdown">Michel Fortin</a> that allows me to compose my posts in markdown. Now I can write blog posts on my iPad much more easily. Next I&#8217;ll be looking for ways to translate markdown to XAML FlowDocuments so that I can use it in WPF and Silverlight applications.</p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/zLT8qx6hTJQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2011/04/supporting-markdown-in-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2011/04/supporting-markdown-in-applications/</feedburner:origLink></item>
		<item>
		<title>Abusing Dynamic Binding in C# – Regex Matches</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/d8IY2v7RjLI/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/12/abusing-dynamic-binding-in-c-regex-matches/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 00:21:46 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[CSharp]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2010/12/abusing-dynamic-binding-in-c-regex-matches/</guid>
		<description><![CDATA[Sometimes it&#8217;s fun to do something that any self-respecting developer would cringe if they saw someone else do it. That&#8217;s kind of how I feel about abusing the capabilities of C# 4&#8242;s dynamic binding capabilities. Even though I stubbornly resisted the idea of adding dynamic binding to C#, I find myself playing around with it <a href='http://josheinstein.com/blog/index.php/2010/12/abusing-dynamic-binding-in-c-regex-matches/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s fun to do something that any self-respecting developer would cringe if they saw someone else do it. That&#8217;s kind of how I feel about abusing the capabilities of C# 4&#8242;s dynamic binding capabilities. Even though I stubbornly resisted the idea of adding dynamic binding to C#, I find myself playing around with it every now and then to make really ugly code look nicer.</p>

<p>For example, let&#8217;s consider the case where you&#8217;re matching a US telephone number (with optional extension) against a regular expression and separating the individual components into separate variables. In the US telecom industry it&#8217;s very common to deal with 10 digit numbers without having to worry about international phone formats, but the regular expression is still ugly. Unfortunately there&#8217;s nothing I can do about that, but this is about making code pretty, not making regular expressions pretty.</p>

<pre><code>(?&lt;npa&gt;\d{3})-?(?&lt;nxx&gt;\d{3})\-?(?&lt;line&gt;\d{4})( x(?&lt;ext&gt;\d+))?
</code></pre>

<p>Let&#8217;s look at the implementation of such a task in PowerShell vs. C#.</p>

<p>Here is how the code would look in PowerShell. It&#8217;s elegance gets me sexually aroused.</p>

<pre class="brush: ps;">
if ('555-123-4567' -match $PhoneRegex) {
    $npa = $matches.npa
    $nxx = $matches.nxx
    $line = $matches.line
    $ext = $matches.ext
}
</pre>

<p>Here is how the equivalent code would look in C#.</p>

<pre class="brush: csharp;">
var match = Regex.Match("555-123-4567", PhoneRegex);
if (match.Success) {
    string npa = match.Groups["npa"].Value;
    string nxx = match.Groups["nxx"].Value;
    string line = match.Groups["line"].Value;
    string ext = match.Groups["ext"].Success ?
                     match.Groups["ext"].Value :
                     null;
}
</pre>

<p>It&#8217;s not the end of the world, but it still feels like it could be so much more concise. Well with C# 4 I can create an object that derives from <code>DynamicObject</code> and wraps a System.Text.RegularExpressions.Match object to provide a much more &#8220;scripty&#8221; feel to the above code.</p>

<pre class="brush: csharp;">
var match = DynamicRegex.Match("555-123-4567", PhoneRegex);
if (match) {
    string npa = match.npa;
    string nxx = match.nxx;
    string line = match.line;
    string ext = match.ext;
}
</pre>

<p>Note that a static method called DynamicRegex.Match is returning an object of type <code>dynamic</code>. The actual implementation is my wrapper class called <code>DynamicMatch</code>. It overrides the TryGetMember and TryConvert calls that make the above possible. It simply directs property and indexer calls into the Match.Groups collection and has some special logic for conversion to Boolean.</p>

<p>Anyhow, to get into detail about how C# does dynamic binding at runtime would take a series of posts in itself. I just thought this was a pretty interesting use of the dynamic binding that wasn&#8217;t yet another dynamic XML wrapper. Yeah I know it defeats the purpose of using a strongly-typed language like C# but oh well I thought it was interesting. Source is below.</p>

<pre class="brush: csharp; collapse: true;">
public sealed class DynamicMatch : DynamicObject
{

    private readonly Regex _Regex;
    private readonly Match _Match;

    public DynamicMatch( Regex regex, Match match )
    {

        Contract.Requires( regex != null, "Regex cannot be null." );
        Contract.Requires( match != null, "Match cannot be null." );

        _Regex = regex;
        _Match = match;

    }

    public override IEnumerable<string> GetDynamicMemberNames( )
    {
        // i honestly don't know where the hell this is used
        return _Regex.GetGroupNames( );
    }

    public override bool TryConvert( ConvertBinder binder, out object result )
    {

        // supports casting back to the original Match object
        if ( binder.Type == typeof( Match ) ) {
            result = _Match;
            return true;
        }

        // supports casting the match to its string representation
        // is the complete match result
        if ( binder.Type == typeof( String ) ) {
            if ( _Match.Success ) {
                result = _Match.Value;
                return true;
            }
            else {
                result = null;
                return true;
            }
        }

        // supports casting the match to a boolean indicating success
        if ( binder.Type == typeof( Boolean ) || binder.Type == typeof(Boolean?) ) {
            result = _Match.Success;
            return true;
        }

        return base.TryConvert( binder, out result );

    }

    public override bool TryGetIndex( GetIndexBinder binder, object[] indexes, out object result )
    {

        // supports 'match[x]' where x is a named capture group
        // or 'match[n]' where n is an implicit capture group index

        if ( indexes.Length == 1 ) {
            Group group = _Match.Groups[Convert.ToString( indexes[0] )];
            if ( group != null &#038;&#038; group.Success ) {
                result = group.Value;
                return true;
            }
            else {
                result = null;
                return true;
            }
        }

        return base.TryGetIndex( binder, indexes, out result );

    }

    public override bool TryGetMember( GetMemberBinder binder, out object result )
    {

        // supports 'match.x' where x is a named capture group

        Group group = _Match.Groups[binder.Name];
        if ( group != null &#038;&#038; group.Success ) {
            result = group.Value;
            return true;
        }
        else {
            result = null;
            return true;
        }

    }

    public override bool TryUnaryOperation( UnaryOperationBinder binder, out object result )
    {

        // supports 'if (match) {...}'
        if ( binder.Operation == ExpressionType.IsTrue ) {
            result = _Match.Success;
            return true;
        }

        // supports 'if (!match) {...}'
        if ( binder.Operation == ExpressionType.IsFalse || binder.Operation == ExpressionType.Not ) {
            result = !_Match.Success;
            return true;
        }

        return base.TryUnaryOperation( binder, out result );

    }

    public static bool operator ==( DynamicMatch x, bool y )
    {
        // supports 'if (match == true) {...}'
        return x._Match.Success == y;
    }

    public static bool operator !=( DynamicMatch x, bool y )
    {
        // supports 'if (match != true) {...}'
        return x._Match.Success != y;
    }

    public static bool operator ==( DynamicMatch x, string y )
    {
        // supports 'if (match == "foo") {...}'
        return x._Match.Value == y;
    }

    public static bool operator !=( DynamicMatch x, string y )
    {
        // supports 'if (match != "foo") {...}'
        return x._Match.Value != y;
    }

}

public static class DynamicRegex
{

    public static dynamic Match( string input, string pattern )
    {
        var regex = new Regex( pattern );
        var match = regex.Match( input );
        return new DynamicMatch( regex, match );
    }

}
</pre>

<pre class="brush: csharp; collapse: true;">
[TestClass]
public class DynamicRegexTests
{

    [TestMethod]
    public void DynamicMatchConvertsToMatch( )
    {

        var dynamicMatch = DynamicRegex.Match( "Hello World", @"H[A-Za-z]+" );
        Match regularMatch = dynamicMatch;

        Assert.IsTrue( regularMatch.Success );
        Assert.AreEqual( "Hello", regularMatch.Value );

    }

    [TestMethod]
    public void SuccessfulMatchConvertsToTrue( )
    {

        var match = DynamicRegex.Match( "Hello World", @"H[A-Za-z]+" );

        // Convert To Boolean
        Assert.IsTrue( (bool)match, "Successful match should convert to true." );

        // Compare To Boolean
        if ( !match ) { Assert.Fail( "Successful match should convert to true." ); }
        if ( match == false ) { Assert.Fail( "Successful match should convert to true." ); }
        if ( match != true ) { Assert.Fail( "Successful match should convert to true." ); }

    }

    [TestMethod]
    public void UnsuccessfulMatchConvertsToFalse( )
    {

        var match = DynamicRegex.Match( "Hello World", @"^H[A-Za-z]+$" );

        // Convert To Boolean
        Assert.IsFalse( (bool)match, "Unsuccessful match should convert to false." );

        // Compare To Boolean
        if ( match ) { Assert.Fail( "Unsuccessful match should convert to false." ); }
        if ( match == true ) { Assert.Fail( "Unsuccessful match should convert to false." ); }
        if ( match != false ) { Assert.Fail( "Unsuccessful match should convert to false." ); }

    }

    [TestMethod]
    public void SuccessfulMatchConvertsToString( )
    {

        var match = DynamicRegex.Match( "Hello World", @"H[A-Za-z]+" );

        // Convert To String
        Assert.AreEqual( "Hello", (string)match, "Successful match should convert to Match.Value." );

        // Compare To String
        if ( match != "Hello" ) { Assert.Fail( "Successful match should convert to Match.Value." ); }

    }

    [TestMethod]
    public void UnsuccessfulMatchConvertsToNull( )
    {

        var match = DynamicRegex.Match( "Hello World", @"^H[A-Za-z]+$" );

        // Convert To String
        Assert.IsNull( (string)match, "Unsuccessful match should convert to null." );

        // The following will always fail - C# does the null check without converting
        // if (match != null) { Assert.Fail("..."); }

    }

    [TestMethod]
    public void SuccessfulCapturesAccessedAsProperties( )
    {

        var match = DynamicRegex.Match( "123-456-7890", @"(?<npa>\d{3})-?(?<nxx>\d{3})-?(\d{4})" );

        Assert.AreEqual( "123", match.npa, "Capture group npa could not be accessed by name." );
        Assert.AreEqual( "456", match.nxx, "Capture group nxx could not be accessed by name." );

    }

    [TestMethod]
    public void SuccessfulCapturesAccessedAsIndexer( )
    {

        var match = DynamicRegex.Match( "123-456-7890", @"(?<npa>\d{3})-?(?<nxx>\d{3})-?(\d{4})" );

        Assert.AreEqual( "123", match["npa"], "Capture group npa could not be accessed by name." );
        Assert.AreEqual( "456", match["nxx"], "Capture group nxx could not be accessed by name." );
        Assert.AreEqual( "7890", match[1], "Unnamed capture group could not be accessed by number." );
        Assert.AreEqual( "123-456-7890", match[0], "Capture group 0 should return entire match." );

    }

    [TestMethod]
    public void UnsuccessfulMatchReturnsPropertiesAsNull( )
    {

        // Must match 123-456-7890
        // Last 4 digits will cause unsuccessful match
        var match = DynamicRegex.Match( "123-456-XXXX", @"(?<npa>\d{3})-?(?<nxx>\d{3})-?(\d{4})" );

        Assert.IsNull( match.npa, "Unsuccessful match must return all properties as null." );
        Assert.IsNull( match["npa"], "Unsuccessful match must return all properties as null." );
        Assert.IsNull( match["1"], "Unsuccessful match must return all properties as null." );
        Assert.IsNull( match["0"], "Unsuccessful match must return all properties as null." );

    }

    [TestMethod]
    public void SuccessfulMatchReturnsOptionalGroupAsNull( )
    {

        // Must match at least 123-456-
        // Last 4 digits are optional
        var match = DynamicRegex.Match( "123-456-XXXX", @"(?<npa>\d{3})-?(?<nxx>\d{3})-?(\d{4})?" );

        Assert.AreEqual( "123", match["npa"], "Successful match should return captured groups as string." );
        Assert.AreEqual( "456", match["nxx"], "Successful match should return captured groups as string." );
        Assert.AreEqual( "123-456-", match[0], "Successful match should return entire match as string." );

        Assert.IsNull( match[1], "Successful match should return missing optional groups as null." );

    }

}
</pre>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/d8IY2v7RjLI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/12/abusing-dynamic-binding-in-c-regex-matches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/12/abusing-dynamic-binding-in-c-regex-matches/</feedburner:origLink></item>
		<item>
		<title>Windows tablets with external monitors</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/BN-1evsgIPc/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/10/windows-tablets-with-external-monitors/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 05:05:20 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tablet PC]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/?p=422</guid>
		<description><![CDATA[It&#8217;s been a while since I used a Windows Tablet PC with an external monitor. One thing that used to drive me nuts (I think as recently as Vista) was the fact that if you set the external monitor as your &#8220;main&#8221; display, the pen would all of a sudden control the cursor on the <a href='http://josheinstein.com/blog/index.php/2010/10/windows-tablets-with-external-monitors/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<div style="float:right;margin:0 0 0 8px">

<p><img src="http://josheinstein.com/blog/wp-content/uploads/2010/10/photo_thumb.jpg" alt="Windows Tablet" /></p>

</div>

<p>It&#8217;s been a while since I used a Windows Tablet PC with an external monitor. One thing that used to drive me nuts (I think as recently as Vista) was the fact that if you set the external monitor as your &#8220;main&#8221; display, the pen would all of a sudden control the cursor on the external monitor, not the tablet display.</p>

<p>No longer! I just plugged in an external monitor and the pen still controls the tablet display. But it gets better.</p>

<p>My HP 2710P tablet has a very odd shaped hinge. So it doesn&#8217;t fit very well into the tablet stand I have. It fits much better when the side opposite the hinge is facing down into the stand. This requires me to change the screen orientation 180 degrees (upside down.)</p>

<p>Before, in XP (and I&#8217;m pretty sure Vista too) this would also change the orientation of the external monitor! But now the two have separate orientations.</p>

<p>In other words, Windows 7 Tablet with an external monitor is working <em>exactly</em> the way I expect and want. So <a href="http://www.robbushway.com/?p=2027">while some people</a> <em>(cough&#8230; Rob&#8230; cough&#8230;)</em> may think Windows 7 sucks on a tablet<sup id="fnref:3"><a href="#fn:3" rel="footnote">1</a></sup>, I&#8217;d still take a Windows 7 tablet over an iPad any day!</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:3">
<p><em>Granted, Rob is referring to touch capabilities in Windows, where I am primarily a pen-based tablet user.</em>&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/BN-1evsgIPc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/10/windows-tablets-with-external-monitors/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/10/windows-tablets-with-external-monitors/</feedburner:origLink></item>
		<item>
		<title>WPF Nested ScrollViewer / ListBox Scrolling</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/946XjYRBUT4/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/08/wpf-nested-scrollviewer-listbox-scrolling/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 21:17:44 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2010/08/wpf-nested-scrollviewer-listbox-scrolling/</guid>
		<description><![CDATA[Here&#8217;s a quickie. I had an issue where I have a ListBox that will (should) never scroll but I need its item selection capability. It is inside of another ScrollViewer (along with some other controls) and that outer ScrollViewer should be what scrolls. Unfortunately ListBox was eating the MouseWheel events, preventing the outer ScrollViewer from <a href='http://josheinstein.com/blog/index.php/2010/08/wpf-nested-scrollviewer-listbox-scrolling/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quickie. I had an issue where I have a ListBox that will (should) never scroll but I need its item selection capability. It is inside of another ScrollViewer (along with some other controls) and that outer ScrollViewer should be what scrolls. Unfortunately ListBox was eating the MouseWheel events, preventing the outer ScrollViewer from scrolling.</p>

<p>A quick Google search didn&#8217;t turn up much. I didn&#8217;t want to set IsHitTestVisible=False because like I said, I need the selection ability. I also thought changing the template or subclassing ScrollViewer was a bit drastic.</p>

<p>So instead I came up with the following IgnoreMouseWheelBehavior. Technically it&#8217;s not ignoring the MouseWheel, but it is &#8220;forwarding&#8221; the event back up and out of the ListBox. Check it.</p>

<pre class="brush: csharp;">/// &lt;summary&gt;
/// Captures and eats MouseWheel events so that a nested ListBox does not
/// prevent an outer scrollable control from scrolling.
/// &lt;/summary&gt;
public sealed class IgnoreMouseWheelBehavior : Behavior&lt;UIElement&gt;
{

  protected override void OnAttached( )
  {
      base.OnAttached( );
      AssociatedObject.PreviewMouseWheel += AssociatedObject_PreviewMouseWheel ;
  }

  protected override void OnDetaching( )
  {
      AssociatedObject.PreviewMouseWheel -= AssociatedObject_PreviewMouseWheel;
      base.OnDetaching( );
  }

  void AssociatedObject_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
  {

      e.Handled = true;

      var e2 = new MouseWheelEventArgs(e.MouseDevice,e.Timestamp,e.Delta);
      e2.RoutedEvent = UIElement.MouseWheelEvent;

      AssociatedObject.RaiseEvent(e2);

  }

}</pre>

<p>And here&#8217;s how you would use it in XAML.</p>

<pre class="brush: xml;">&lt;ScrollViewer Name=&quot;IScroll&quot;&gt;
    &lt;ListBox Name=&quot;IDont&quot;&gt;
        &lt;i:Interaction.Behaviors&gt;
            &lt;local:IgnoreMouseWheelBehavior /&gt;
        &lt;/i:Interaction.Behaviors&gt;
    &lt;/ListBox&gt;
&lt;/ScrollViewer&gt;</pre>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/946XjYRBUT4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/08/wpf-nested-scrollviewer-listbox-scrolling/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/08/wpf-nested-scrollviewer-listbox-scrolling/</feedburner:origLink></item>
		<item>
		<title>Quick Tip – Troubleshoot broken OData response using Notepad</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/jfdt2e2CCm4/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/07/quick-tip-troubleshoot-broken-odata-response-using-notepad/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 15:15:50 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[OData]]></category>
		<category><![CDATA[WCF Data Services]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2010/07/quick-tip-troubleshoot-broken-odata-response-using-notepad/</guid>
		<description><![CDATA[Ran into a bit of an issue today when an application I developed stopped working. Fortunately I built a pretty awesome tracing framework that I often drop into all my applications that lets me get at important runtime information from within the application. In this case I was able to see the WCF Data Services query that was being sent. It looked fine. The problem was that the response couldn't be deserialized.]]></description>
			<content:encoded><![CDATA[<p>Ran into a bit of an issue today when an application I developed stopped working. Fortunately I built a pretty awesome tracing framework that I often drop into all my applications that lets me get at important runtime information from within the application. In this case I was able to see the WCF Data Services query that was being sent. It looked fine. The problem was that the response couldn&#8217;t be deserialized.</p>

<p>So I pasted the query into IE and saw this.</p>

<p><img style="border-right-width: 0px; margin: 10px auto; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" class="wlDisabledImage" title="2010-07-16_1101" border="0" alt="2010-07-16_1101" src="http://josheinstein.com/blog/wp-content/uploads/2010/07/20100716_1101.png" width="436" height="215" /></p>

<p>Ahh great so the XML is malformed. That explains why the WCF Data Services client library can&#8217;t give me any useful information. Now I could go to the trouble of using Fiddler or <a href="http://www.fiddler2.com/fiddlercap/">FiddlerCap</a> but in this case there&#8217;s a much simpler way.</p>

<p>Start Notepad » File » Open » Paste the URL</p>

<p><img style="border-bottom: 0px; border-left: 0px; margin: 10px auto; display: block; float: none; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="2010-07-16_1027" border="0" alt="2010-07-16_1027" src="http://josheinstein.com/blog/wp-content/uploads/2010/07/20100716_1027.png" width="500" height="350" /></p>

<p>I admit I only found this out recently that our old friend Notepad could be used to open HTTP URL&#8217;s.</p>

<p>In this case the error was due to the fact that the database I am working with is a train wreck that lacks any constraints so the integrity of the data was violated. That&#8217;s a different issue altogether and one that&#8217;s out of my hands, unfortunately.</p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/jfdt2e2CCm4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/07/quick-tip-troubleshoot-broken-odata-response-using-notepad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/07/quick-tip-troubleshoot-broken-odata-response-using-notepad/</feedburner:origLink></item>
		<item>
		<title>Another multi-purpose value converter for WPF</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/S4vfhosc5hs/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/07/another-multi-purpose-value-converter-for-wpf/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 00:33:02 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[IValueConverter]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2010/07/another-multi-purpose-value-converter-for-wpf/</guid>
		<description><![CDATA[Colin Eberhardt has posted a neat multi-purpose value converter that tries various conventional conversion methods to convert from one type to another. This overcomes a frustrating limitation in WPF/Silverlight data binding where the XAML parser is seemingly more intelligent at converting literal values to target types than values sourced from binding expressions. Unfortunately, the TypeConverter <a href='http://josheinstein.com/blog/index.php/2010/07/another-multi-purpose-value-converter-for-wpf/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Colin Eberhardt has posted a neat <a href="http://www.scottlogic.co.uk/blog/colin/2010/07/a-universal-value-converter-for-wpf">multi-purpose value converter</a> that tries various conventional conversion methods to convert from one type to another. This overcomes a frustrating limitation in WPF/Silverlight data binding where the XAML parser is seemingly more intelligent at converting literal values to target types than values sourced from binding expressions.</p>

<p>Unfortunately, the TypeConverter usage will not work in Silverlight but perhaps using the <a href="http://msdn.microsoft.com/en-us/library/cc189076(VS.95).aspx#xaml_type_conversion_and_creating_objects">XamlReader technique</a> there&#8217;s something that could be done?</p>

<p>Also, a couple of the readers in the comments had a great suggestion to derive the converter from MarkupExtension to simplify the XAML. I think I&#8217;m going to have to go back and do that with all of my converters now.</p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/S4vfhosc5hs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/07/another-multi-purpose-value-converter-for-wpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/07/another-multi-purpose-value-converter-for-wpf/</feedburner:origLink></item>
		<item>
		<title>Very cool Visual Studio extension – VS10x Code Map</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/QryBmo8iBOo/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/07/very-cool-visual-studio-extension-vs10x-code-map/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 17:46:18 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2010/07/very-cool-visual-studio-extension-vs10x-code-map/</guid>
		<description><![CDATA[I have been using this Visual Studio extension called VS10x Code Map by Michael Kiss and I love it. It sits on the left or right of the Visual Studio text editor and provides an attractive outline view of the properties, methods, regions, etc in the current code file and lets you quickly navigate to <a href='http://josheinstein.com/blog/index.php/2010/07/very-cool-visual-studio-extension-vs10x-code-map/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><img style="border-right-width: 0px; margin: 0px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" class="wlDisabledImage" title="image" border="0" alt="image" align="right" src="http://josheinstein.com/blog/wp-content/uploads/2010/07/image.png" width="185" height="263" />I have been using this Visual Studio extension called <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/1c54d1bd-d898-4705-903f-fa4a319b50f2">VS10x Code Map</a> by Michael Kiss and I love it. It sits on the left or right of the Visual Studio text editor and provides an attractive outline view of the properties, methods, regions, etc in the current code file and lets you quickly navigate to a particular member.</p>

<p>I have tried other add-ins in the past that provided a code outline but they were usually slow, unattractive, or used a tree view style interface that I found to be more cumbersome than scrolling. The other nice thing about this one is that if you use regions (<a href="http://www.codinghorror.com/blog/2008/07/the-problem-with-code-folding.html">sorry Jeff</a>, but to each his own) it will group your members by those regions.</p>

<p>It&#8217;s probably only useful if you have a wide-screen monitor since it does take up valuable screen real-estate. But according to the Visual Studio Extension Manager (Tools -&gt; Extension Manager) it&#8217;s pretty popular.</p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/QryBmo8iBOo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/07/very-cool-visual-studio-extension-vs10x-code-map/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/07/very-cool-visual-studio-extension-vs10x-code-map/</feedburner:origLink></item>
		<item>
		<title>Windows 7 Style "Aero" ChildWindow Template</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/R2cXWdWf_GY/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/07/windows-7-style-aero-childwindow-template/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 21:02:15 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/?p=248</guid>
		<description><![CDATA[Silverlight 3 introduced a very useful control called a ChildWindow. This is a "modal" dialog box that can contain whatever content you give it and it floats above the rest of the application inside a Popup control. I say "modal" because unlike ShowDialog in WPF or Windows Forms, showing a ChildWindow via the Show method returns immediately, but it does disable the application's RootVisual which prevents the user from interacting with the rest of the application while the window is showing.

As cool as this control is, I have always been pretty disappointed in the default behavior and look and feel of the ChildWindow class. For example, the animation as it opens and closes is very unnatural and distracting. The overlay that "dims" the rest of the application successfully indicates the modal nature of the control, but it's too strong I think. In fact I'm fine with just the normal "grey out" that happens when the RootVisual is disabled.

A while back I had created a pretty lame ChildWindow template that kinda sorta looked like a Windows 7 Aero window. It was a half-hearted attempt but it looked a lot better than the above. But then I saw a question on StackOverflow asking about creating an Aero glass style window and I decided to revisit the problem and try to come up with something decent.]]></description>
			<content:encoded><![CDATA[<p>Silverlight 3 introduced a very useful control called a ChildWindow. This is a &quot;modal&quot; dialog box that can contain whatever content you give it and it floats above the rest of the application inside a Popup control. I say &quot;modal&quot; because unlike ShowDialog in WPF or Windows Forms, showing a ChildWindow via the Show method returns immediately, but it does disable the application&#8217;s RootVisual which prevents the user from interacting with the rest of the application while the window is showing.</p>

<p>As cool as this control is, I have always been pretty disappointed in the default behavior and look and feel of the ChildWindow class. For example, the animation as it opens and closes is very unnatural and distracting. The overlay that &quot;dims&quot; the rest of the application successfully indicates the modal nature of the control, but it&#8217;s too strong I think. In fact I&#8217;m fine with just the normal &quot;grey out&quot; that happens when the RootVisual is disabled.</p>

<p><a href="http://josheinstein.com/blog/wp-content/uploads/2010/07/ChildWindowNormal.png"><img style="margin: 10px auto; display: block; float: none" class="wlDisabledImage" title="ChildWindow-Normal" alt="ChildWindow-Normal" src="http://josheinstein.com/blog/wp-content/uploads/2010/07/ChildWindowNormal_thumb.png" width="570" height="370" /></a></p>

<p>A while back I had created a pretty lame ChildWindow template that kinda sorta looked like a Windows 7 Aero window. It was a half-hearted attempt but it looked a lot better than the above. But then I saw <a href="http://stackoverflow.com/questions/2120885/sl3-transparent-glass-child-window/3172525#3172525">a question on StackOverflow</a> asking about creating an Aero glass style window and I decided to revisit the problem and try to come up with something decent.</p>

<p>The first thing to note when trying to customize the ChildWindow template is that you probably ought to start from scratch. <a href="http://msdn.microsoft.com/en-us/library/dd833070.aspx#sectionToggle2" target="_blank">The default template</a> is like an onion of nested grids and borders and panels, none of which have any particular significance to the control other than the border named Chrome. This is what ChildWindow uses to handle dragging. Although as I&#8217;ll discuss shortly, I think there&#8217;s some bugs there.</p>

<p><a href="http://josheinstein.com/blog/wp-content/uploads/2010/07/ChildWindowWindows7Aero.png"><img style="margin: 2px auto; display: block; float: none" class="wlDisabledImage" title="ChildWindow-Windows7Aero" alt="ChildWindow-Windows7Aero" src="http://josheinstein.com/blog/wp-content/uploads/2010/07/ChildWindowWindows7Aero_thumb.png" width="570" height="370" /></a></p>

<p>My ChildWindow template looks like the one in the above screen shot. I tried very hard to make the template &quot;cooperate&quot; with the style. That is whenever possible, I use values from the style or directly applied to the control instead of hard coding colors, paddings, etc in the template which are hard to tweak.</p>

<p>For example, if you want to create more glass area around the white content area, just increase the Padding of the ChildWindow. Padding, of course, does not have to be uniform. You could give it a larger padding on the bottom to make room for Windows Media Player-style controls.</p>

<p>There&#8217;s a couple of caveats though&#8230;</p>

<ul> <li>There is no blur! I originally wanted to blur the elements underneath the &quot;glass&quot; areas but I found this to be a lot more difficult than I thought. A blur effect only applies the blur to its associated element and visual children. Since the stuff I want it to blur is only showing through as a result of opacity, the blur has no effect. I suspect there&#8217;s a way to do this using a WritableBitmap but I haven&#8217;t gone down that rabbit hole just yet. </li> <li>It doesn&#8217;t have any open/close transition animations. I took those out on purpose but now I think a very subtle transition is needed to look more natural than the jarring animation from the default style. </li> <li>It doesn&#8217;t currently have any visual states defined on the close button which I took out for the sake of keeping the XAML clean for the example. But you can pretty much drop in the transitions from the default template to get that back. </li> <li>Dragging the ChildWindow appears to be jerky for some reason. I think this is a bug in the way ChildWindow handles dragging because <a href="http://www.jeff.wilcox.name/2010/05/my-childwindow-design/">Jeff Wilcox&#8217;s customized template</a> has the same problem when <a href="http://www.jeff.wilcox.name/2010/05/my-childwindow-design/comment-page-1/#comment-2691">one of his readers enabled dragging</a> on his Zune style template.</li>  </ul>

<p>Finally, there are a number of blog posts out there about how to hack the ChildWindow to be non-modal. <a href="http://timheuer.com/blog/archive/2009/05/10/silverlight-childwindow-non-modal-refactor.aspx">Tim Huer</a> has an excellent post about this. I have not tried but I don&#8217;t see any reason why my template could not also be applied in conjunction with those methods.</p>

<p>To grab the ResourceDictionary that contains the template, click the Show Source link below.</p>

<pre class="brush: xml; collapse: true;">
&lt;ResourceDictionary xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; 
                    xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; 
                    xmlns:s=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk&quot;&gt;

  &lt;Style x:Key=&quot;AeroWindowCloseButton&quot; TargetType=&quot;Button&quot;&gt;
    &lt;Setter Property=&quot;Background&quot;&gt;
      &lt;Setter.Value&gt;
        &lt;LinearGradientBrush StartPoint=&quot;0,0&quot; EndPoint=&quot;0,1&quot;&gt;
          &lt;GradientStop Color=&quot;#FFEEB3AC&quot; Offset=&quot;0.009&quot;/&gt;
          &lt;GradientStop Color=&quot;#FFDA8578&quot; Offset=&quot;0.402&quot;/&gt;
          &lt;GradientStop Color=&quot;#FFC64D38&quot; Offset=&quot;0.459&quot;/&gt;
          &lt;GradientStop Color=&quot;#FFC84934&quot; Offset=&quot;0.598&quot;/&gt;
          &lt;GradientStop Color=&quot;#FFD48671&quot; Offset=&quot;0.885&quot;/&gt;
          &lt;GradientStop Color=&quot;#FFE8BBAE&quot; Offset=&quot;0.943&quot;/&gt;
        &lt;/LinearGradientBrush&gt;
      &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
    &lt;Setter Property=&quot;BorderBrush&quot; Value=&quot;#FF5E5E5E&quot;/&gt;
    &lt;Setter Property=&quot;BorderThickness&quot; Value=&quot;1&quot;/&gt;
    &lt;Setter Property=&quot;Foreground&quot; Value=&quot;White&quot;/&gt;
    &lt;Setter Property=&quot;Padding&quot; Value=&quot;3&quot;/&gt;
    &lt;Setter Property=&quot;Width&quot; Value=&quot;45&quot;/&gt;
    &lt;Setter Property=&quot;Height&quot; Value=&quot;20&quot;/&gt;
    &lt;Setter Property=&quot;IsTabStop&quot; Value=&quot;False&quot;/&gt;
    &lt;Setter Property=&quot;Template&quot;&gt;
      &lt;Setter.Value&gt;
        &lt;ControlTemplate TargetType=&quot;Button&quot;&gt;
          &lt;Border
            Background=&quot;{TemplateBinding Background}&quot;
            BorderBrush=&quot;{TemplateBinding BorderBrush}&quot;
            BorderThickness=&quot;{TemplateBinding BorderThickness}&quot;
            CornerRadius=&quot;0,0,3,3&quot;&gt;
            &lt;Path
              Fill=&quot;{TemplateBinding Foreground}&quot;
              Width=&quot;11&quot;
              Height=&quot;10&quot;
              Stretch=&quot;Fill&quot;
              Data=&quot;F1 M 6.742,3.852 L 9.110,1.559 L 8.910,0.500 L 6.838,0.500 L 4.902,2.435 L 2.967,0.500 L 0.895,0.500 L 0.694,1.559 L 3.062,3.852 L 0.527,6.351 L 0.689,7.600 L 2.967,7.600 L 4.897,5.575 L 6.854,7.600 L 9.115,7.600 L 9.277,6.351 L 6.742,3.852 Z&quot;&gt;
              &lt;Path.Stroke&gt;
                &lt;LinearGradientBrush EndPoint=&quot;0.5,1&quot; StartPoint=&quot;0.5,0&quot;&gt;
                  &lt;GradientStop Color=&quot;#FF313131&quot; Offset=&quot;1&quot;/&gt;
                  &lt;GradientStop Color=&quot;#FF8E9092&quot; Offset=&quot;0&quot;/&gt;
                &lt;/LinearGradientBrush&gt;
              &lt;/Path.Stroke&gt;
            &lt;/Path&gt;
          &lt;/Border&gt;
        &lt;/ControlTemplate&gt;
      &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
  &lt;/Style&gt;
  &lt;Style x:Key=&quot;AeroWindow&quot; TargetType=&quot;s:ChildWindow&quot;&gt;
    &lt;Setter Property=&quot;Background&quot; Value=&quot;White&quot;/&gt;
    &lt;Setter Property=&quot;BorderBrush&quot; Value=&quot;#FF5E5E5E&quot;/&gt;
    &lt;Setter Property=&quot;BorderThickness&quot; Value=&quot;1&quot;/&gt;
    &lt;Setter Property=&quot;OverlayBrush&quot; Value=&quot;Transparent&quot;/&gt;
    &lt;Setter Property=&quot;OverlayOpacity&quot; Value=&quot;0&quot;/&gt;
    &lt;Setter Property=&quot;HorizontalContentAlignment&quot; Value=&quot;Stretch&quot;/&gt;
    &lt;Setter Property=&quot;VerticalContentAlignment&quot; Value=&quot;Stretch&quot;/&gt;
    &lt;Setter Property=&quot;Padding&quot; Value=&quot;5&quot;/&gt;
    &lt;Setter Property=&quot;IsTabStop&quot; Value=&quot;false&quot;/&gt;
    &lt;Setter Property=&quot;TabNavigation&quot; Value=&quot;Cycle&quot;/&gt;
    &lt;Setter Property=&quot;UseLayoutRounding&quot; Value=&quot;True&quot;/&gt;
    &lt;Setter Property=&quot;Template&quot;&gt;
      &lt;Setter.Value&gt;
        &lt;ControlTemplate TargetType=&quot;s:ChildWindow&quot;&gt;
          &lt;Grid x:Name=&quot;Root&quot;&gt;

            &lt;!-- OVERLAY BEHIND CHILDWINDOW --&gt;
            &lt;Grid
              x:Name=&quot;Overlay&quot;
              Background=&quot;{TemplateBinding OverlayBrush}&quot;
              Opacity=&quot;{TemplateBinding OverlayOpacity}&quot;
              HorizontalAlignment=&quot;Stretch&quot;
              VerticalAlignment=&quot;Top&quot;/&gt;

            &lt;!-- WINDOW CONTAINER --&gt;
            &lt;Grid x:Name=&quot;ContentRoot&quot; Width=&quot;{TemplateBinding Width}&quot; Height=&quot;{TemplateBinding Height}&quot;&gt;
  
              &lt;!-- GLASS BACKGROUND AND BORDER --&gt;
              &lt;!--
              NOTE: This border should not physically contain the rest of the
              window contents because it has an opacity setting that would
              affect all of its children. Instead, a second border is directly
              above it in the z-order and contains the child elements.
              --&gt;
              &lt;Border
                x:Name=&quot;Chrome&quot;
                BorderBrush=&quot;{TemplateBinding BorderBrush}&quot;
                BorderThickness=&quot;{TemplateBinding BorderThickness}&quot;
                CornerRadius=&quot;4&quot;
                Opacity=&quot;0.9&quot;&gt;
                &lt;Border.Background&gt;
                  &lt;LinearGradientBrush MappingMode=&quot;Absolute&quot; StartPoint=&quot;0,0&quot; EndPoint=&quot;1920,0&quot;&gt;
                    &lt;GradientStop Color=&quot;#FFADC9E5&quot; Offset=&quot;0.010&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFA7C2DC&quot; Offset=&quot;0.069&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFB7D2EC&quot; Offset=&quot;0.084&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFB7D2EC&quot; Offset=&quot;0.146&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFA8C4DE&quot; Offset=&quot;0.168&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFB8D3ED&quot; Offset=&quot;0.455&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFA6C1DB&quot; Offset=&quot;0.518&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFB6D1EB&quot; Offset=&quot;0.543&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFA7C2DC&quot; Offset=&quot;0.604&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFB7D2EC&quot; Offset=&quot;0.618&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFB7D2EC&quot; Offset=&quot;0.700&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFABC6E1&quot; Offset=&quot;0.722&quot;/&gt;
                    &lt;GradientStop Color=&quot;#FFB1CEEA&quot; Offset=&quot;0.778&quot;/&gt;
                  &lt;/LinearGradientBrush&gt;
                &lt;/Border.Background&gt;
              &lt;/Border&gt;
  
              &lt;!-- WINDOW CONTENTS --&gt;
              &lt;!-- 
              NOTE: This element will not have a visible border. The Chrome element
              provides the visible border but this element needs to have a matching
              thickness and corner radius so that the contents of the window are
              &quot;pushed in&quot; by the same amount.
              --&gt;
              &lt;Border BorderThickness=&quot;{TemplateBinding BorderThickness}&quot; CornerRadius=&quot;4&quot;&gt;

                &lt;Grid&gt;

                  &lt;Grid.RowDefinitions&gt;
                    &lt;RowDefinition Height=&quot;25&quot;/&gt;
                    &lt;RowDefinition/&gt;
                  &lt;/Grid.RowDefinitions&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                    &lt;ColumnDefinition/&gt;
                    &lt;ColumnDefinition Width=&quot;Auto&quot;/&gt;
                  &lt;/Grid.ColumnDefinitions&gt;

                  &lt;ContentControl
                    Content=&quot;{TemplateBinding Title}&quot;
                    Foreground=&quot;#FF393939&quot;
                    FontWeight=&quot;Bold&quot;
                    VerticalAlignment=&quot;Center&quot;
                    Margin=&quot;6,0,6,0&quot;
                    Grid.Row=&quot;0&quot;
                    Grid.Column=&quot;0&quot;/&gt;

                  &lt;Button
                    x:Name=&quot;CloseButton&quot;
                    Style=&quot;{StaticResource AeroWindowCloseButton}&quot;
                    BorderBrush=&quot;{TemplateBinding BorderBrush}&quot;
                    BorderThickness=&quot;1,0,1,1&quot;
                    VerticalAlignment=&quot;Top&quot;
                    Margin=&quot;0,0,5,0&quot;
                    Grid.Row=&quot;0&quot;
                    Grid.Column=&quot;1&quot;/&gt;

                  &lt;Border
                    Background=&quot;{TemplateBinding Background}&quot;
                    BorderBrush=&quot;{TemplateBinding BorderBrush}&quot;
                    BorderThickness=&quot;{TemplateBinding BorderThickness}&quot;
                    Margin=&quot;{TemplateBinding Padding}&quot;
                    Grid.Row=&quot;1&quot;
                    Grid.ColumnSpan=&quot;2&quot;&gt;

                    &lt;ContentPresenter
                      x:Name=&quot;ContentPresenter&quot;
                      Content=&quot;{TemplateBinding Content}&quot;
                      ContentTemplate=&quot;{TemplateBinding ContentTemplate}&quot;
                      HorizontalAlignment=&quot;{TemplateBinding HorizontalContentAlignment}&quot;
                      VerticalAlignment=&quot;{TemplateBinding VerticalContentAlignment}&quot;/&gt;

                  &lt;/Border&gt;

                &lt;/Grid&gt;
              &lt;/Border&gt;
            &lt;/Grid&gt;
          &lt;/Grid&gt;
        &lt;/ControlTemplate&gt;
      &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
  &lt;/Style&gt;
&lt;/ResourceDictionary&gt;</pre>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/R2cXWdWf_GY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/07/windows-7-style-aero-childwindow-template/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/07/windows-7-style-aero-childwindow-template/</feedburner:origLink></item>
		<item>
		<title>SwitchConverter – A "switch statement" for XAML</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/E6oSC1TNG4g/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/06/switchconverter-a-switch-statement-for-xaml/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 21:10:22 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[IValueConverter]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2010/06/switchconverter-a-switch-statement-for-xaml/</guid>
		<description><![CDATA[Download the example project which includes the source for SwitchConverter and SwitchedContent. I figured I would write some more about value converters since I think there&#8217;s a lot of cool things you can do with them, especially when you put a little extra effort into generalizing them. One thing I find I need to do <a href='http://josheinstein.com/blog/index.php/2010/06/switchconverter-a-switch-statement-for-xaml/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://josheinstein.com/WPF/SwitchConverter/SwitchConverterDemo.zip">Download the example project</a> which includes the source for SwitchConverter and SwitchedContent.</p>

<p>I figured I would write some more about value converters since I think there&#8217;s a lot of cool things you can do with them, especially when you put a little extra effort into generalizing them.</p>

<p>One thing I find I need to do often is to show content conditionally depending on a certain data binding condition. For example, let&#8217;s say we had a WeatherReport object that had a Condition property that had the following enumeration values: Sunny, Cloudy, Rain, Snow. We want to have a different image for each condition.</p>

<p>In WPF you can do this using a DataTrigger but even that is a bit verbose for my tastes. In Silverlight it&#8217;s a lot more difficult. The Expression Blend SDK gives you a behavior called a DataTrigger that can achieve this. But I think a value converter would do this job quite well and the markup will be the same for WPF and Silverlight. Check out the following snippet:</p>

<pre class="brush: csharp;">&lt;Grid&gt;
    &lt;Grid.Resources&gt;
        &lt;e:SwitchConverter x:Key=&quot;WeatherIcons&quot;&gt;
            &lt;e:SwitchCase When=&quot;Sunny&quot; Then=&quot;Sunny.png&quot; /&gt;
            &lt;e:SwitchCase When=&quot;Cloudy&quot; Then=&quot;Cloudy.png&quot; /&gt;
            &lt;e:SwitchCase When=&quot;Rain&quot; Then=&quot;Rain.png&quot; /&gt;
            &lt;e:SwitchCase When=&quot;Snow&quot; Then=&quot;Snow.png&quot; /&gt;
        &lt;/e:SwitchConverter&gt;
    &lt;/Grid.Resources&gt;
    &lt;Image Source=&quot;{Binding Condition, Converter={StaticResource WeatherIcons}}&quot; /&gt;
&lt;/Grid&gt;</pre>

<p align="center"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="SwitchConverterDemo" border="0" alt="SwitchConverterDemo" src="http://josheinstein.com/blog/wp-content/uploads/2010/06/image.png" width="383" height="236" /> </p>

<p>The only thing that was a little bit tricky about this converter was making sure that the value being bound to could be compared against the strings in the When attribute. At first I naively just figured I could &quot;ToString&quot; the input value to the converter and compare that against the When values. But this is very fragile. For example, if the input were a DateTime, the values &quot;6/25/2010&quot; and &quot;6/25/2010 12:00:00 AM&quot; would not be considered equal. That&#8217;s not even considering the fact that regional settings would cause even bigger headaches.</p>

<p>So this implementation simply tries to use the IConvertible interface to normalize the values before comparing them. My actual implementation uses a very complex series of checks that take into account available Parse methods, TypeConverter, etc. But it&#8217;s a lot of code that I didn&#8217;t want to junk up the example with.</p>

<p>The only other thing worth mentioning is that the SwitchConverter has a ContentProperty attribute that allows us to specify the SwitchCase elements inline, making the resulting XAML pretty clean if you ask me. ContentPropertyAttribute is a little known and underused attribute that lets you specify which property will be set by content in between the element tags. There are a lot of places where this should probably be applied such as DataGrid.Columns, Setter.Value, etc. But now I&#8217;m going off on a tangent.</p>

<p>So while this solution is in no way a replacement for a good ViewModel, it does let you cleanly represent conditional content in XAML which really sits well with the OCD part of my brain that hates ugly markup.</p>

<p>As a bonus, I&#8217;ve also included a SwitchedContent control that makes it much easier to swap out entire elements based upon the conditional input. An example of that is shown below.</p>

<pre class="brush: csharp;">&lt;Button Command=&quot;{Binding IncrementCommand}&quot;&gt;
    &lt;e:SwitchedContent Binding=&quot;{Binding Count}&quot; Else=&quot;Overflow!&quot;&gt;
        &lt;e:SwitchCase When=&quot;0&quot; Then=&quot;Zero&quot; /&gt;
        &lt;e:SwitchCase When=&quot;1&quot; Then=&quot;One&quot; /&gt;
        &lt;e:SwitchCase When=&quot;2&quot; Then=&quot;Two&quot; /&gt;
        &lt;e:SwitchCase When=&quot;3&quot; Then=&quot;Three&quot; /&gt;
        &lt;e:SwitchCase When=&quot;4&quot; Then=&quot;Four&quot; /&gt;
        &lt;e:SwitchCase When=&quot;5&quot; Then=&quot;Five&quot; /&gt;
        &lt;e:SwitchCase When=&quot;6&quot; Then=&quot;Six&quot; /&gt;
        &lt;e:SwitchCase When=&quot;7&quot; Then=&quot;Seven&quot; /&gt;
        &lt;e:SwitchCase When=&quot;8&quot; Then=&quot;Eight&quot; /&gt;
        &lt;e:SwitchCase When=&quot;9&quot; Then=&quot;Nine&quot; /&gt;
        &lt;e:SwitchCase When=&quot;10&quot; Then=&quot;Ten&quot; /&gt;
    &lt;/e:SwitchedContent&gt;
&lt;/Button&gt;</pre>

<p><a href="http://josheinstein.com/WPF/SwitchConverter/SwitchConverterDemo.zip">Download the example project</a> which includes the source for SwitchConverter and SwitchedContent.</p>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/E6oSC1TNG4g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/06/switchconverter-a-switch-statement-for-xaml/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/06/switchconverter-a-switch-statement-for-xaml/</feedburner:origLink></item>
		<item>
		<title>A multi-purpose NegateConverter for WPF/Silverlight</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/9IoQp5Jd6PE/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/06/a-multi-purpose-negateconverter-for-wpfsilverlight/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 07:29:42 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[IValueConverter]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2010/06/a-multi-purpose-negateconverter-for-wpfsilverlight/</guid>
		<description><![CDATA[I came across a question on StackOverflow that is a very frequently asked question regarding data binding in XAML. Given a boolean, how do you bind the opposite value to the target? The answer of course is to use a value converter (a class implementing IValueConverter) and invert the boolean in code. I do this <a href='http://josheinstein.com/blog/index.php/2010/06/a-multi-purpose-negateconverter-for-wpfsilverlight/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I came across <a href="http://stackoverflow.com/questions/3099402/wpf-element-databinding-for-isenabled-but-for-false" target="_blank">a question on StackOverflow</a> that is a very frequently asked question regarding data binding in XAML. Given a boolean, how do you bind the <em>opposite</em> value to the target? The answer of course is to use a value converter (a class implementing IValueConverter) and invert the boolean in code.</p>

<p>I do this a lot though so I have a NegateConverter in &quot;Josh&#8217;s Toolbox&quot;. My NegateConverter can negate a lot of things, not just booleans. For example, numeric values, Visibility, Thickness, Point, etc. Now I&#8217;ll probably never need to negate a Point but I figured what the hell. The code isn&#8217;t very pretty and if you don&#8217;t like if statements, just stop reading. It&#8217;s utilitarian, get over it.</p>

<p>Can you think of anything else that can be easily negated? (Click Show Source below.)</p>

<pre class="brush: csharp; collapse: true;">/// &lt;summary&gt;
/// Produces an output value that is the negative of the input.
/// &lt;/summary&gt;
/// &lt;remarks&gt;
/// The built-in signed types are supported as well as a handful of other
/// commonly used types such as &lt;see cref=&quot;T:Point&quot;/&gt;, &lt;see cref=&quot;T:TimeSpan&quot;/&gt;,
/// &lt;see cref=&quot;T:Thickness&quot;/&gt;, etc.
/// &lt;/remarks&gt;
public sealed class NegateConverter : IValueConverter
{

    #region Fields

    /// &lt;summary&gt;
    /// The default singleton instance of this converter.
    /// &lt;/summary&gt;
    public static readonly NegateConverter Default = new NegateConverter( );

    #endregion

    #region Constructors

    /// &lt;summary&gt;
    /// Initializes a new instance of the &lt;see cref=&quot;T:NegateConverter&quot;/&gt; class.
    /// &lt;/summary&gt;
    public NegateConverter( )
    {
    }

    #endregion

    #region Methods

    /// &lt;summary&gt;
    /// Converts a value.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value produced by the binding source.&lt;/param&gt;
    /// &lt;param name=&quot;targetType&quot;&gt;The type of the binding target property.&lt;/param&gt;
    /// &lt;param name=&quot;parameter&quot;&gt;The converter parameter to use.&lt;/param&gt;
    /// &lt;param name=&quot;culture&quot;&gt;The culture to use in the converter.&lt;/param&gt;
    /// &lt;returns&gt;
    /// A converted value. If the method returns null, the valid null value is used.
    /// &lt;/returns&gt;
    public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
    {

        if ( value == null ) {
            return null;
        }

        if ( value is double ) {
            return Negate( (double)value );
        }

        if ( value is int ) {
            return Negate( (int)value );
        }

        if ( value is bool ) {
            return Negate( (bool)value );
        }

        if ( value is long ) {
            return Negate( (long)value );
        }

        if ( value is IConvertible ) {
            return Negate( (IConvertible)value, culture );
        }

        if ( value is TimeSpan ) {
            return Negate( (TimeSpan)value );
        }

        if ( value is Point ) {
            return Negate( (Point)value );
        }

        if ( value is Thickness ) {
            return Negate( (Thickness)value );
        }

        throw new ArgumentException( &quot;Cannot negate &quot; + value.GetType( ) + &quot;.&quot;, &quot;value&quot; );

    }

    /// &lt;summary&gt;
    /// Converts a value.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value that is produced by the binding target.&lt;/param&gt;
    /// &lt;param name=&quot;targetType&quot;&gt;The type to convert to.&lt;/param&gt;
    /// &lt;param name=&quot;parameter&quot;&gt;The converter parameter to use.&lt;/param&gt;
    /// &lt;param name=&quot;culture&quot;&gt;The culture to use in the converter.&lt;/param&gt;
    /// &lt;returns&gt;
    /// A converted value. If the method returns null, the valid null value is used.
    /// &lt;/returns&gt;
    public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
    {
        return Convert(value, targetType, parameter, culture);
    }

    /// &lt;summary&gt;
    /// Negates a &lt;see cref=&quot;T:TimeSpan&quot;/&gt; value.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value to negate.&lt;/param&gt;
    /// &lt;returns&gt;The negated value.&lt;/returns&gt;
    private static TimeSpan Negate( TimeSpan value )
    {
        return value.Negate( );
    }

    /// &lt;summary&gt;
    /// Negates a &lt;see cref=&quot;T:Point&quot;/&gt; value.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value to negate.&lt;/param&gt;
    /// &lt;returns&gt;The negated value.&lt;/returns&gt;
    private static Point Negate( Point value )
    {
        return new Point(
            -value.X,
            -value.Y
        );
    }

    /// &lt;summary&gt;
    /// Negates a &lt;see cref=&quot;T:Thickness&quot;/&gt; value.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value to negate.&lt;/param&gt;
    /// &lt;returns&gt;The negated value.&lt;/returns&gt;
    private static Thickness Negate( Thickness value )
    {
        return new Thickness(
            -value.Left,
            -value.Top,
            -value.Right,
            -value.Bottom
        );
    }

    /// &lt;summary&gt;
    /// Negates a &lt;see cref=&quot;T:Boolean&quot;/&gt; value.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value to negate.&lt;/param&gt;
    /// &lt;returns&gt;The negated value.&lt;/returns&gt;
    private static bool Negate( bool value )
    {
        return !value;
    }

    /// &lt;summary&gt;
    /// Negates a &lt;see cref=&quot;T:Int32&quot;/&gt; value.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value to negate.&lt;/param&gt;
    /// &lt;returns&gt;The negated value.&lt;/returns&gt;
    private static int Negate( int value )
    {
        return -value;
    }

    /// &lt;summary&gt;
    /// Negates a &lt;see cref=&quot;T:Int64&quot;/&gt; value.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value to negate.&lt;/param&gt;
    /// &lt;returns&gt;The negated value.&lt;/returns&gt;
    private static long Negate( long value )
    {
        return -value;
    }

    /// &lt;summary&gt;
    /// Negates a &lt;see cref=&quot;T:Double&quot;/&gt; value.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value to negate.&lt;/param&gt;
    /// &lt;returns&gt;The negated value.&lt;/returns&gt;
    private static double Negate( double value )
    {
        return -value;
    }

    /// &lt;summary&gt;
    /// Negates a &lt;see cref=&quot;T:IConvertible&quot;/&gt; value by round tripping through
    /// the System.Decimal type.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;value&quot;&gt;The value to negate.&lt;/param&gt;
    /// &lt;param name=&quot;formatProvider&quot;&gt;The culture information.&lt;/param&gt;
    /// &lt;returns&gt;The negated value as the original input type.&lt;/returns&gt;
    private static object Negate( IConvertible value, IFormatProvider formatProvider )
    {

        TypeCode inputType = value.GetTypeCode( );

        decimal input = value.ToDecimal( formatProvider );
        decimal output = Decimal.Negate( input );

        return System.Convert.ChangeType( output, inputType, formatProvider );

    }

    #endregion

}   // class</pre>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/9IoQp5Jd6PE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/06/a-multi-purpose-negateconverter-for-wpfsilverlight/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/06/a-multi-purpose-negateconverter-for-wpfsilverlight/</feedburner:origLink></item>
		<item>
		<title>Download the Visual Studio 2010 Pro Power Tools</title>
		<link>http://feedproxy.google.com/~r/josheinstein/~3/piUeR35U8Dg/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/06/download-the-visual-studio-2010-pro-power-tools/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 00:34:00 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2010/06/download-the-visual-studio-2010-pro-power-tools/</guid>
		<description><![CDATA[I saw in my feed reader a posting that announced the release of the Visual Studio 2010 Pro Power Tools extension that was available in the Visual Studio 2010 Extension Manager. At first glance I thought it was the Power Tools extension that I&#8217;ve been using for a while. However, this is a totally separate <a href='http://josheinstein.com/blog/index.php/2010/06/download-the-visual-studio-2010-pro-power-tools/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I saw in my feed reader a posting that announced the release of the <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/d0d33361-18e2-46c0-8ff2-4adea1e34fef" target="_blank">Visual Studio 2010 Pro Power Tools</a> extension that was available in the Visual Studio 2010 Extension Manager. At first glance I thought it was the Power Tools extension that I&#8217;ve been using for a while. However, this is a totally separate extension that adds some very awesome features.</p>

<p>Note that they go into a lot of detail on the enhanced document tab feature but although this is neat and useful, it&#8217;s not really in my top 3 features. I&#8217;ve emphasized my 3 favorite features.</p>

<ul>   <li>Document Well 2010 Plus      <ul>       <li>Tab Well UI          <ul>           <li>Scrollable tabs </li>            <li>Vertical tabs </li>            <li>Pinned tabs </li>            <li>Show close button in tab well </li>         </ul>       </li>        <li>Tab Behavior          <ul>           <li>Remove tabs by usage order (LRU) </li>            <li>Show pinned tabs in a separate row/column </li>         </ul>       </li>        <li>Sorting          <ul>           <li>Sort tabs by project </li>            <li>Sort tabs alphabetically </li>            <li>Sort tab well dropdown alphabetically </li>         </ul>       </li>        <li>Tab UI          <ul>           <li>Color tabs according to their project or according to regular expressions </li>            <li>Miscellaneous options that modify tab UI              <ul>               <li>Show document/toolwindow icon in tab </li>                <li>Show close button in tab </li>                <li>Modify dirty indicator style </li>                <li>Modify minimum and maximum tab size </li>             </ul>           </li>         </ul>       </li>     </ul>   </li>    <li><strong><font color="#0000ff">Searchable Add Reference Dialog</font></strong> </li>    <li><strong><font color="#0000ff">Highlight Current Line</font></strong> </li>    <li>HTML Copy </li>    <li>Triple Click </li>    <li>Fix Mixed Tabs </li>    <li><strong><font color="#0000ff">Ctrl + Click Go To Definition</font></strong> </li>    <li>Align Assignments </li>    <li>Colorized Parameter Help </li>    <li>Move Line Up/Down Commands </li>    <li>Column Guides </li> </ul>
<img src="http://feeds.feedburner.com/~r/josheinstein/~4/piUeR35U8Dg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/06/download-the-visual-studio-2010-pro-power-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://josheinstein.com/blog/index.php/2010/06/download-the-visual-studio-2010-pro-power-tools/</feedburner:origLink></item>
	</channel>
</rss>

