<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>JoshEinstein.com &#187; Technology</title>
	<atom:link href="http://josheinstein.com/blog/index.php/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://josheinstein.com/blog</link>
	<description>Home</description>
	<lastBuildDate>Fri, 16 Jul 2010 15:15:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Quick Tip &#8211; Troubleshoot broken OData response using Notepad</title>
		<link>http://josheinstein.com/blog/index.php/2010/07/quick-tip-troubleshoot-broken-odata-response-using-notepad/</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>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F07%2Fquick-tip-troubleshoot-broken-odata-response-using-notepad%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F07%2Fquick-tip-troubleshoot-broken-odata-response-using-notepad%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=OData,WCF+Data+Services" height="61" width="50" /><br />
			</a>
		</div>
]]></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>1</slash:comments>
		</item>
		<item>
		<title>Another multi-purpose value converter for WPF</title>
		<link>http://josheinstein.com/blog/index.php/2010/07/another-multi-purpose-value-converter-for-wpf/</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 [...]]]></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 <a href="http://msdn.microsoft.com/en-us/library/cc189076(VS.95).aspx#xaml_type_conversion_and_creating_objects">the 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>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F07%2Fanother-multi-purpose-value-converter-for-wpf%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F07%2Fanother-multi-purpose-value-converter-for-wpf%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=IValueConverter,Silverlight,WPF" height="61" width="50" /><br />
			</a>
		</div>
]]></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>
		</item>
		<item>
		<title>Very cool Visual Studio extension &#8211; VS10x Code Map</title>
		<link>http://josheinstein.com/blog/index.php/2010/07/very-cool-visual-studio-extension-vs10x-code-map/</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 [...]]]></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>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F07%2Fvery-cool-visual-studio-extension-vs10x-code-map%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F07%2Fvery-cool-visual-studio-extension-vs10x-code-map%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=Visual+Studio" height="61" width="50" /><br />
			</a>
		</div>
]]></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>
		</item>
		<item>
		<title>Windows 7 Style &quot;Aero&quot; ChildWindow Template</title>
		<link>http://josheinstein.com/blog/index.php/2010/07/windows-7-style-aero-childwindow-template/</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>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F07%2Fwindows-7-style-aero-childwindow-template%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F07%2Fwindows-7-style-aero-childwindow-template%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=Silverlight" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/07/windows-7-style-aero-childwindow-template/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SwitchConverter &#8211; A &quot;switch statement&quot; for XAML</title>
		<link>http://josheinstein.com/blog/index.php/2010/06/switchconverter-a-switch-statement-for-xaml/</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 [...]]]></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>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F06%2Fswitchconverter-a-switch-statement-for-xaml%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F06%2Fswitchconverter-a-switch-statement-for-xaml%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=IValueConverter,Silverlight,WPF" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/06/switchconverter-a-switch-statement-for-xaml/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A multi-purpose NegateConverter for WPF/Silverlight</title>
		<link>http://josheinstein.com/blog/index.php/2010/06/a-multi-purpose-negateconverter-for-wpfsilverlight/</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 [...]]]></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>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F06%2Fa-multi-purpose-negateconverter-for-wpfsilverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F06%2Fa-multi-purpose-negateconverter-for-wpfsilverlight%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=IValueConverter,Silverlight,WPF" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/06/a-multi-purpose-negateconverter-for-wpfsilverlight/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Download the Visual Studio 2010 Pro Power Tools</title>
		<link>http://josheinstein.com/blog/index.php/2010/06/download-the-visual-studio-2010-pro-power-tools/</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 [...]]]></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>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F06%2Fdownload-the-visual-studio-2010-pro-power-tools%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F06%2Fdownload-the-visual-studio-2010-pro-power-tools%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=Visual+Studio" height="61" width="50" /><br />
			</a>
		</div>
]]></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>
		</item>
		<item>
		<title>Never answer your phone, and other great productivity tips from Bob Parsons</title>
		<link>http://josheinstein.com/blog/index.php/2010/05/never-answer-your-phone-and-other-great-productivity-tips-from-bob-parsons/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/05/never-answer-your-phone-and-other-great-productivity-tips-from-bob-parsons/#comments</comments>
		<pubDate>Fri, 28 May 2010 19:56:22 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/index.php/2010/05/never-answer-your-phone-and-other-great-productivity-tips-from-bob-parsons/</guid>
		<description><![CDATA[I’ll be honest, this guy really grates on my nerves. Although my domains are registered with GoDaddy, I don’t even really like the company. I think their site is disgustingly bloated. The upsell is worse than a car dealership. And the tits and ass marketing makes absolutely no sense to me. But… I happened to [...]]]></description>
			<content:encoded><![CDATA[<p>I’ll be honest, this guy really grates on my nerves. Although my domains are registered with GoDaddy, I don’t even really like the company. I think their site is disgustingly bloated. The upsell is worse than a car dealership. And the tits and ass marketing makes absolutely no sense to me.</p>
<p>But… I happened to stumble on this video titled &quot;Successful people NEVER answer their phone. Here’s why.&quot; If you know me at all, you know I can’t stand answering the phone and I rarely do. So I gave it a look. These are actually great productivity tips and I pretty much agree with every single one of them. Enjoy.</p>
<p> <object width='481' height='283'><param name="allowFullScreen" value="true"></param><param name="movie" value="http://www.bobparsons.me/bpblogplayer_embed_481.swf?theVid=http://akmedia.bobparsons.me/_173_blog34419large.flv"></param><param name="bgcolor" value="#000000"></param><embed src="http://www.bobparsons.me/bpblogplayer_embed_481.swf?theVid=http://akmedia.bobparsons.me/_173_blog34419large.flv" type="application/x-shockwave-flash" allowFullScreen="true" bgcolor="#000000" quality="high" flashvars="doPlay=false&#038;theVid=http://akmedia.bobparsons.me/_173_blog34419large.flv" width="481" height="283"></embed></object>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Fnever-answer-your-phone-and-other-great-productivity-tips-from-bob-parsons%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Fnever-answer-your-phone-and-other-great-productivity-tips-from-bob-parsons%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=Productivity" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/05/never-answer-your-phone-and-other-great-productivity-tips-from-bob-parsons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://akmedia.bobparsons.me/_173_blog34419large.flv" length="26764747" type="video/x-flv" />
		</item>
		<item>
		<title>Trick WCF Data Services into supporting $format = json</title>
		<link>http://josheinstein.com/blog/index.php/2010/05/wcf-data-services-format-json/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/05/wcf-data-services-format-json/#comments</comments>
		<pubDate>Tue, 18 May 2010 16:00:26 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[OData]]></category>
		<category><![CDATA[WCF Data Services]]></category>

		<guid isPermaLink="false">http://josheinstein.com/blog/?p=220</guid>
		<description><![CDATA[In the OData specification, the $format parameter can be passed on the query string of the request to tell the server that you would like the response to be serialized as JSON. Normally, to get JSON-formatted data, you have to specify &#34;application/json&#34; in your &#34;Accept&#34; header. The query string feature is handy in situations when [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.odata.org/developers/protocols/uri-conventions#FormatSystemQueryOption" target="_blank">OData specification</a>, the <strong>$format</strong> parameter can be passed on the query string of the request to tell the server that you would like the response to be serialized as JSON. Normally, to get JSON-formatted data, you have to specify &quot;application/json&quot; in your &quot;Accept&quot; header. The query string feature is handy in situations when it&#8217;s not easy or possible to modify the request headers.</p>
<p>Unfortunately, if you try to pass <strong>$format</strong> on a WCF Data Services query, you will get a response that looks like:</p>
<pre class="brush: xml;">&lt;error xmlns=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/metadata&quot;&gt;
    &lt;code /&gt;
    &lt;message xml:lang=&quot;en-US&quot;&gt;
        The query parameter '$format' begins with a system-reserved
        '$' character but is not recognized.
    &lt;/message&gt;
&lt;/error&gt;</pre>
<p>Unfortunately, WCF Data Services doesn&#8217;t support this OData convention. But with a little bit of trickery, you can make it work by modifying the request in an ASP.NET HTTP module.</p>
<p>The trick is to check for the query string parameter before the request gets to WCF Data Services and modify the request headers accordingly. Normally, the Request.Headers collection is read-only. You&#8217;ll need to use some simple reflection to make it writable but once you do, it&#8217;s just a matter of setting the appropriate Accept header, then rewriting the URL to remove the <strong>$format</strong> parameter so WCF Data Services doesn&#8217;t bitch and moan.</p>
<p>The entire HTTP module is shown below. Like it? Hate it? Let me know in the comments.</p>
<pre class="brush: xml;">&lt;!-- add to web.config --&gt;
&lt;system.webServer&gt;
    &lt;modules runAllManagedModulesForAllRequests=&quot;true&quot;&gt;
        &lt;add name=&quot;ODataFormatModule&quot; type=&quot;YourNamespace.ODataFormatModule, YourAssembly&quot; /&gt;
    &lt;/modules&gt;
&lt;/system.webServer&gt;</pre>
<pre class="brush: csharp;">/// &lt;summary&gt;
/// Intercepts WCF Data Services requests that include a $format parameter on the query
/// string and alters the request headers according to the OData specification.
/// &lt;/summary&gt;
public sealed class ODataFormatModule : IHttpModule
{

    #region Constructors

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

    #endregion

    #region Properties

    /// &lt;summary&gt;
    /// Gets the application instance.
    /// &lt;/summary&gt;
    public HttpApplication Application
    {
        get;
        private set;
    }

    /// &lt;summary&gt;
    /// Gets the current HTTP context.
    /// &lt;/summary&gt;
    public HttpContext Context
    {
        get
        {
            return HttpContext.Current;
        }
    }

    /// &lt;summary&gt;
    /// Gets the current request.
    /// &lt;/summary&gt;
    public HttpRequest Request
    {
        get
        {
            return HttpContext.Current.Request;
        }
    }

    #endregion

    #region Methods

    /// &lt;summary&gt;
    /// Initializes a module and prepares it to handle requests.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;context&quot;&gt;An &lt;see cref=&quot;T:HttpApplication&quot;/&gt; that provides access to the methods,
    /// properties, and events common to all application objects within an ASP.NET application&lt;/param&gt;
    public void Init( HttpApplication context )
    {

        Application = context;
        Application.BeginRequest += Application_BeginRequest;

    }

    /// &lt;summary&gt;
    /// Disposes of the resources (other than memory) used by the module that implements
    /// &lt;see cref=&quot;T:IHttpModule&quot;/&gt;.
    /// &lt;/summary&gt;
    public void Dispose( )
    {
        Application.BeginRequest -= Application_BeginRequest;
        Application = null;
    }

    /// &lt;summary&gt;
    /// Forces the &lt;see cref=&quot;T:NameValueCollection&quot;/&gt; to allow modifications by using reflection to
    /// set the IsReadOnly property to false.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;collection&quot;&gt;The collection to make writable.&lt;/param&gt;
    /// &lt;returns&gt;The original collection after the IsReadOnly property has been hacked.&lt;/returns&gt;
    private static NameValueCollection MakeWritable( NameValueCollection collection )
    {

        var collectionType = collection.GetType( );
        var isReadOnlyProperty = collectionType.GetProperty(
            &quot;IsReadOnly&quot;,
            BindingFlags.Instance |
            BindingFlags.IgnoreCase |
            BindingFlags.NonPublic
        );

        isReadOnlyProperty.SetValue( collection, false, null );

        return collection;

    }

    /// &lt;summary&gt;
    /// Gets a content type for the corresponding format parameter according to the OData specification
    /// http://www.odata.org/developers/protocols/uri-conventions#FormatSystemQueryOption
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;format&quot;&gt;The value of the $format querystring parameter.&lt;/param&gt;
    /// &lt;returns&gt;The corresponding Accept request header value.&lt;/returns&gt;
    private static string MapToMediaType( string format )
    {

        Contract.Requires( format != null );

        switch ( format.ToLowerInvariant() ) {
            case &quot;atom&quot;:
            return &quot;application/atom+xml&quot;;
            case &quot;xml&quot;:
            return &quot;application/xml&quot;;
            case &quot;json&quot;:
            return &quot;application/json&quot;;
            default:
            return format;
        }   // switch

    }

    #endregion

    #region Event Handlers

    /// &lt;summary&gt;
    /// Handles the BeginRequest event of the Application.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;sender&quot;&gt;The source of the event.&lt;/param&gt;
    /// &lt;param name=&quot;e&quot;&gt;The &lt;see cref=&quot;T:EventArgs&quot;/&gt; instance containing the event data.&lt;/param&gt;
    private void Application_BeginRequest( object sender, EventArgs e )
    {

        var format = Request.QueryString[&quot;$format&quot;];

        if ( !String.IsNullOrWhiteSpace(format) ) {

            // Ordinarily, Request.Headers is read-only so we need to
            // use some reflection to get around that. Ugly, I know.
            var requestQuery = MakeWritable( Request.QueryString );
            var requestHeaders = MakeWritable( Request.Headers );

            // Set the Accept header the way a well-behaved json client
            // would have done, which WCF Data Services does support
            requestHeaders[&quot;Accept&quot;] = MapToMediaType( format );

            // Use URL-rewriting to remove the $format part of the querystring
            // Otherwise, if it gets to WCF Data Services, it barfs
            requestQuery.Remove( &quot;$format&quot; );
            Context.RewritePath( Request.FilePath, Request.PathInfo, requestQuery.ToString( ) );

        }   // if

    }

    #endregion

}   // class</pre>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Fwcf-data-services-format-json%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Fwcf-data-services-format-json%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=.NET,OData,WCF+Data+Services" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/05/wcf-data-services-format-json/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Looks like my PowerShell got rusty&#8230;</title>
		<link>http://josheinstein.com/blog/index.php/2010/05/looks-like-my-powershell-got-rusty/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/05/looks-like-my-powershell-got-rusty/#comments</comments>
		<pubDate>Tue, 11 May 2010 16:40:05 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/index.php/2010/05/looks-like-my-powershell-got-rusty/</guid>
		<description><![CDATA[This confused me for a minute. But once I realized what was going on I felt like a dolt. $Query = $UriBuilder.Query if ($Query.Length &#62; 1) { $Query = $Query.Substring(1) + '&#38;' } $UriBuilder.Query = $Query + $KeyValuePair Access to the path 'C:\Windows\system32\1' is denied. At C:\Blah\Blah.psm1:366 char:32 + if ($Query.Length &#62; &#60;&#60;&#60;&#60; 1) { [...]]]></description>
			<content:encoded><![CDATA[<p>This confused me for a minute. But once I realized what was going on I felt like a dolt.</p>
<pre class="brush: ps;">
$Query = $UriBuilder.Query

if ($Query.Length &gt; 1) {
    $Query = $Query.Substring(1) + '&amp;'
}

$UriBuilder.Query = $Query + $KeyValuePair
</pre>
<pre class="brush: plain;">
Access to the path 'C:\Windows\system32\1' is denied.
At C:\Blah\Blah.psm1:366 char:32
+             if ($Query.Length &gt; &lt;&lt;&lt;&lt;  1) {
    + CategoryInfo          : OpenError: (:) [], UnauthorizedAccessException
    + FullyQualifiedErrorId : FileOpenFailure
</pre>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Flooks-like-my-powershell-got-rusty%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Flooks-like-my-powershell-got-rusty%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=PowerShell" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/05/looks-like-my-powershell-got-rusty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lost &#8220;Button&#8221; Simulator in Silverlight</title>
		<link>http://josheinstein.com/blog/index.php/2010/05/lost-button-simulator-in-silverlight/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/05/lost-button-simulator-in-silverlight/#comments</comments>
		<pubDate>Sat, 08 May 2010 10:46:34 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[LOST]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/?p=195</guid>
		<description><![CDATA[To celebrate the upcoming finale of LOST, I threw this thing together in Silverlight 4 using Expression Blend 4 and Visual Studio 2010. I also used a trial of Goldwave 5 to work on the sound effects. I&#8217;ve included the source code so you can take a look around. This is an example of a [...]]]></description>
			<content:encoded><![CDATA[<p>To celebrate the upcoming finale of LOST, I threw this thing together in Silverlight 4 using Expression Blend 4 and Visual Studio 2010. I also used a trial of <a href="http://www.goldwave.com">Goldwave 5</a> to work on the sound effects.</p>
<p>I&#8217;ve <a href="/Silverlight/LostButton/LostButton.zip">included the source code</a> so you can take a look around. This is an example of a pretty barebones MVVM app without the &#8220;M&#8221;. Some of the techniques I used were XAML storyboards, a simple state machine, semi-transparent overlays to simulate lighting, MediaElement to play audio files, ViewBox to stretch a portion of the view, TransitioningContentControl, etc. just to name a few.</p>
<p>So go ahead, feel important at work like you&#8217;re John Locke saving the world in between staff meetings. Just remember to <a href="http://lostpedia.wikia.com/wiki/Push_the_button">enter the right numbers</a> (with spaces) and push the &#8220;EXECUTE&#8221; button every 108 minutes or else&#8230;</p>
<p>(Or if you just get bored of waiting, click the clock to advance the timer. You can also right click the application to install it to your start menu.)</p>
<div id="silverlightControlHost" style="text-align:center;">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="470" height="400" style="border: solid 2px black;"><param name="source" value="/Silverlight/LostButton/LostButton.xap"/><param name="background" value="white" /><param name="minRuntimeVersion" value="4.0.50401.0" /><param name="autoUpgrade" value="false" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&#038;v=4.0.50401.0" style="text-decoration:none"><br />
 			  <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/><br />
		  </a><br />
	    </object>
    </div>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Flost-button-simulator-in-silverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Flost-button-simulator-in-silverlight%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=LOST,Silverlight" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/05/lost-button-simulator-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tip for adding Silverlight references in Blend</title>
		<link>http://josheinstein.com/blog/index.php/2010/05/tip-for-adding-silverlight-references-in-blend/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/05/tip-for-adding-silverlight-references-in-blend/#comments</comments>
		<pubDate>Wed, 05 May 2010 17:39:31 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/index.php/2010/05/tip-for-adding-silverlight-references-in-blend/</guid>
		<description><![CDATA[I find it very frustrating sometimes to get something to build in Blend. Like many developers, I have a &#34;Me.dll&#34; that contains a lot of commonly used classes, custom controls, etc. As you might expect, this DLL often takes dependencies on other DLL&#8217;s that must also then be referenced. In Blend, this can be a [...]]]></description>
			<content:encoded><![CDATA[<p>I find it very frustrating sometimes to get something to build in Blend. Like many developers, I have a &quot;Me.dll&quot; that contains a lot of commonly used classes, custom controls, etc. As you might expect, this DLL often takes dependencies on other DLL&#8217;s that must also then be referenced.</p>
<p>In Blend, this can be a pain in the butt because the Silverlight assemblies are scattered into 3 main locations:</p>
<ul>
<li>%ProgramFiles%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0</li>
<li>%ProgramFiles%\Microsoft SDKs\Silverlight\v4.0\Libraries\Client</li>
<li>%ProgramFiles%\Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Bin</li>
</ul>
<p>It gets to be pretty frustrating pointing blend to these various paths to find System.ServiceModel.dll or something.</p>
<p>You can make this a lot easier without copying all the DLL&#8217;s by using symbolic links in Windows Vista/7/2008.</p>
<p>To create the symbolic links, open a PowerShell prompt as an administrator. (Make sure you have PowerShell Community Extensions installed, but who doesn&#8217;t?) Then paste or type the following script.</p>
<pre class="brush: ps;">Set-Location C:\Temp\Refs

$SearchArgs = @{
    ErrorAction = 'SilentlyContinue'
    Include = @(&quot;System.*.dll&quot;, &quot;Microsoft.*.dll&quot;)
    Exclude = @(&quot;*.resources.dll&quot;, &quot;*.design.dll&quot;)
    Path = @(
        &quot;$($Env:ProgramFiles)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\*&quot;
        &quot;$($Env:ProgramFiles)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\*&quot;
        &quot;$($Env:ProgramFiles)\Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Bin\*&quot;
        &quot;$($Env:ProgramFiles) (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\*&quot;
        &quot;$($Env:ProgramFiles) (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\*&quot;
        &quot;$($Env:ProgramFiles) (x86)\Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\Bin\*&quot;
    )
}

Get-ChildItem @SearchArgs | %{

    $LinkPath = $_.Name
    $TargetPath = $_.FullName

    Write-Host &quot;$LinkPath -&gt; $TargetPath&quot;
    New-Symlink -Path:$LinkPath -Target:$TargetPath | Out-Null

}</pre>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Ftip-for-adding-silverlight-references-in-blend%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Ftip-for-adding-silverlight-references-in-blend%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=Blend,PowerShell,Silverlight" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/05/tip-for-adding-silverlight-references-in-blend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ted Dziuba: Why Engineers Hop Jobs</title>
		<link>http://josheinstein.com/blog/index.php/2010/05/why-engineers-hop-jobs/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/05/why-engineers-hop-jobs/#comments</comments>
		<pubDate>Sun, 02 May 2010 19:44:14 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Noise]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/?p=191</guid>
		<description><![CDATA[Came across this while browsing Google Reader&#8230; via Ted Dziuba: Why Engineers Hop Jobs People in my generation have a very low tolerance for bullshit, and software engineering, in general, is a very high bullshit career. If you couple that with the standard load of bullshit you would get from a non-technical Harvard MBA type boss [...]]]></description>
			<content:encoded><![CDATA[<p>Came across this while browsing Google Reader&#8230;</p>
<p>via Ted Dziuba: <a href="http://bit.ly/dzLCUH">Why Engineers Hop Jobs</a></p>
<blockquote><p>People in my generation have a very low tolerance for bullshit, and software engineering, in general, is a very high bullshit career. If you couple that with the standard load of bullshit you would get from a non-technical Harvard MBA type boss — like many CEOs that you find trying to get rich in Silicon Valley by hiring some engineers to &#8220;code up this idea real quick&#8221; — it&#8217;s no wonder that a good engineer will walk off the job after his one year cliff vesting.</p></blockquote>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Fwhy-engineers-hop-jobs%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F05%2Fwhy-engineers-hop-jobs%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=Noise" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/05/why-engineers-hop-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ummm OK?</title>
		<link>http://josheinstein.com/blog/index.php/2010/04/ummm-ok/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/04/ummm-ok/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 20:29:02 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Noise]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/index.php/2010/04/ummm-ok/</guid>
		<description><![CDATA[Okay, I get the idea but come on&#8230; Talk about verbose errors. I guess it&#8217;s better than &#8220;Argument out of range.&#8221; Custom tool warning: There was a validation error on a schema generated during export: Validation Error: Wildcard &#8216;##any&#8217; allows element &#8216;Account&#8217;, and causes the content model to become ambiguous. A content model must be [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, I get the idea but come on&#8230; Talk about verbose errors. I guess it&#8217;s better than &#8220;Argument out of range.&#8221;</p>
<blockquote><p><strong>Custom tool warning: There was a validation error on a schema generated during export:</strong><br />
Validation Error: Wildcard &#8216;##any&#8217; allows element &#8216;Account&#8217;, and causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence.</p></blockquote>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F04%2Fummm-ok%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F04%2Fummm-ok%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=.NET,Noise" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/04/ummm-ok/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell Team announces FxCop rules for cmdlets</title>
		<link>http://josheinstein.com/blog/index.php/2010/03/powershell-fxco/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/03/powershell-fxco/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 02:24:00 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/?p=182</guid>
		<description><![CDATA[PowerShell Team has announced FxCop rules for cmdlet authors. List of rules AcceptForceParameterWhenCallingShouldContinue AllCmdletsShouldAcceptPipelineInput CallShouldProcessOnlyIfDeclaringSupport DefineCmdletInTheCorrectNamespace DoNotAccessPipelineParametersOutsideProcessRecord DoNotCallCertainHostMethods DoNotUseConsoleApi FollowCmdletClassNamingConvention OverrideProcessRecordIfAcceptingPipelineInput ParameterShouldHaveConsistentTypePerNoun UseCredentialAttributeForPSCredentialParameter UseOnlyApprovedCharactersInVerbsAndNouns UseOnlyStandardVerbs UsePascalCasingInVerbsAndNouns UseRecommendedParameterTypes UseSingularNouns UseSingularParameterNames UseSwitchParameterInsteadOfBoolean]]></description>
			<content:encoded><![CDATA[<p>PowerShell Team has announced <a href="http://blogs.msdn.com/powershell/archive/2010/03/30/testing-cmdlets-with-fxcop.aspx">FxCop rules for cmdlet authors</a>.</p>
<p>List of rules</p>
<ul>
<li>AcceptForceParameterWhenCallingShouldContinue</li>
<li>AllCmdletsShouldAcceptPipelineInput</li>
<li>CallShouldProcessOnlyIfDeclaringSupport</li>
<li>DefineCmdletInTheCorrectNamespace</li>
<li>DoNotAccessPipelineParametersOutsideProcessRecord</li>
<li>DoNotCallCertainHostMethods</li>
<li>DoNotUseConsoleApi</li>
<li>FollowCmdletClassNamingConvention</li>
<li>OverrideProcessRecordIfAcceptingPipelineInput</li>
<li>ParameterShouldHaveConsistentTypePerNoun</li>
<li>UseCredentialAttributeForPSCredentialParameter</li>
<li>UseOnlyApprovedCharactersInVerbsAndNouns</li>
<li>UseOnlyStandardVerbs</li>
<li>UsePascalCasingInVerbsAndNouns</li>
<li>UseRecommendedParameterTypes</li>
<li>UseSingularNouns</li>
<li>UseSingularParameterNames</li>
<li>UseSwitchParameterInsteadOfBoolean</li>
</ul>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fpowershell-fxco%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fpowershell-fxco%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=PowerShell" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/03/powershell-fxco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dock TweetDeck to the side of your screen with PowerShell</title>
		<link>http://josheinstein.com/blog/index.php/2010/03/dock-tweetdeck/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/03/dock-tweetdeck/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 15:26:40 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/index.php/2010/03/dock-tweetdeck-to-the-side-of-your-screen-with-powershell/</guid>
		<description><![CDATA[I wanted to post this last night but I did not have an internet connection. The best part about being a developer is that when software drives you nuts, many times you can do something about it that mere mortals cannot. That&#8217;s the case with TweetDeck. I love it but I am sick of having [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to post this last night but I did not have an internet connection.</p>
<p>The best part about being a developer is that when software drives you nuts, many times you can do something about it that mere mortals cannot. That&#8217;s the case with TweetDeck. I love it but I am sick of having to move windows around to keep it in view. I have a wide screen so I wanted to dedicate a band of space to it, much like how the Vista sidebar worked. When I maximize other windows, they should not obscure the taskbar or TweetDeck.</p>
<p>The title of this post is a little misleading for two reasons&#8230;</p>
<ol>
<li>PowerShell really has nothing to do with it. It&#8217;s just the method I chose to kick off this little hack. The actual implementation is all Win32 API via C#. </li>
<li>TweetDeck is just the application that happened to drive me to write this. You could just as easily change one line to dock Windows Live Messenger instead. </li>
</ol>
<p>So the code is shown below. It&#8217;s nearly all in C# but PowerShell will dynamically compile it when you run the script. No exe&#8217;s needed. Just run the script and&#8230;</p>
<ul>
<li>TweetDeck&#8217;s caption and window border will be removed </li>
<li>It will be docked against the right hand side of your primary screen (hard coded, sorry) </li>
<li>Maximized windows will adjust to the new workspace size </li>
</ul>
<p>A couple caveats though.</p>
<ul>
<li>Resize TweetDeck to the size you want it before doing this </li>
<li>Once docked, there&#8217;s currently no way to undock. So just close it from the taskbar. </li>
<li>TweetDeck is buggy in &quot;single column view&quot; as many UI elements are cut off. It&#8217;s best to turn off &quot;use narrow columns&quot; first. </li>
</ul>
<p>Code is below. Enjoy.</p>
<pre class="brush: powershell; collapse: true">$DockProcessName = 'tweetdeck'

Add-Type -Language CSharpVersion3 @&quot;
using System;
using System.Runtime.InteropServices;

public static class WindowDockUtil
{

    #region Public Methods

    /// &lt;summary&gt;
    /// Docks the window to the right side of the screen.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;hWnd&quot;&gt;The window handle.&lt;/param&gt;
    public static void Dock( IntPtr hWnd )
    {

        if ( hWnd == IntPtr.Zero ) {
            return;
        }   // if

        ulong windowLong = GetWindowLong( hWnd, GWL_STYLE );
        windowLong &amp;= ~WS_BORDER;
        windowLong &amp;= ~WS_CAPTION;
        windowLong &amp;= ~WS_THICKFRAME;

        SetWindowLong( hWnd, GWL_STYLE, windowLong );

        var abd = new APPBARDATA( );
        abd.cbSize = Marshal.SizeOf( abd );
        abd.hWnd = hWnd;
        abd.uCallbackMessage = RegisterWindowMessage( &quot;AppBarMessage&quot; );

        // Create AppBar
        SHAppBarMessage( ABMsg.ABM_NEW, ref abd );

        // Get the Window's size
        RECT wc = new RECT( );
        if ( !GetWindowRect( hWnd, ref wc ) ) {
            return;
        }   // if

        int screenWidth = GetSystemMetrics( SM_CXSCREEN );
        int screenHeight = GetSystemMetrics( SM_CYSCREEN );
        int borderWidth = GetSystemMetrics( SM_CXSIZEFRAME );

        // Set the app bar to dock to the right
        abd.uEdge = ABEdge.ABE_RIGHT;
        abd.rc.top = 0;
        abd.rc.bottom = screenHeight;
        abd.rc.right = screenWidth;
        abd.rc.left = abd.rc.right - ( wc.right - wc.left ) + ( borderWidth * 2 );

        // Set AppBar Size
        SHAppBarMessage( ABMsg.ABM_SETPOS, ref abd );

        // Move Window to New Position
        MoveWindow( abd.hWnd, abd.rc.left, abd.rc.top, abd.rc.right - abd.rc.left, abd.rc.bottom - abd.rc.top, true );

    }

    ///// &lt;summary&gt;
    ///// Removes the window from the side of the screen.
    ///// &lt;/summary&gt;
    ///// &lt;param name=&quot;hWnd&quot;&gt;The handle.&lt;/param&gt;
    //public static void UndockWindow( IntPtr hWnd )
    //{

    //    if ( hWnd == IntPtr.Zero ) {
    //        return;
    //    }   // if

    //    var abd = new APPBARDATA( );
    //    abd.cbSize = Marshal.SizeOf( abd );
    //    abd.hWnd = hWnd;

    //    // Remove AppBar
    //    SHAppBarMessage( ABMsg.ABM_REMOVE, ref abd );

    //    // How should I store state between Dock and Undock?
    //    ulong windowLong = GetWindowLong( hWnd, GWL_STYLE );
    //    windowLong |= WS_BORDER;
    //    windowLong |= WS_CAPTION;

    //    SetWindowLong( hWnd, GWL_STYLE, windowLong );

    //}

    #endregion

    #region Interop

    #region AppBar

    [StructLayout( LayoutKind.Sequential )]
    private struct APPBARDATA
    {
        public int cbSize;
        public IntPtr hWnd;
        public int uCallbackMessage;
        public ABEdge uEdge;
        public RECT rc;
        public IntPtr lParam;
    }

    private enum ABMsg : int
    {
        ABM_NEW = 0,
        ABM_REMOVE = 1,
        ABM_QUERYPOS = 2,
        ABM_SETPOS = 3,
        ABM_GETSTATE = 4,
        ABM_GETTASKBARPOS = 5,
        ABM_ACTIVATE = 6,
        ABM_GETAUTOHIDEBAR = 7,
        ABM_SETAUTOHIDEBAR = 8,
        ABM_WINDOWPOSCHANGED = 9,
        ABM_SETSTATE = 10
    }

    private enum ABNotify : int
    {
        ABN_STATECHANGE = 0,
        ABN_POSCHANGED = 1,
        ABN_FULLSCREENAPP = 2,
        ABN_WINDOWARRANGE = 3
    }

    private enum ABEdge : int
    {
        ABE_LEFT = 0,
        ABE_TOP = 1,
        ABE_RIGHT = 2,
        ABE_BOTTOM = 3
    }

    [DllImport( &quot;Shell32&quot;, CallingConvention = CallingConvention.StdCall )]
    private static extern uint SHAppBarMessage( ABMsg dwMessage, ref APPBARDATA pData );

    #endregion

    #region Window Management

    [DllImport( &quot;User32&quot; )]
    private static extern int RegisterWindowMessage( string msg );

    [DllImport( &quot;User32&quot; )]
    private static extern IntPtr FindWindow( string lpClassName, string lpWindowName );

    [DllImport( &quot;User32&quot; )]
    private static extern bool MoveWindow( IntPtr hWnd, int x, int y, int cx, int cy, bool repaint );

    [DllImport( &quot;User32&quot; )]
    private static extern bool GetWindowRect( IntPtr hWnd, ref RECT rect );

    [StructLayout( LayoutKind.Sequential )]
    private struct RECT
    {
        public int left;
        public int top;
        public int right;
        public int bottom;
    }

    [DllImport( &quot;User32&quot; )]
    private static extern int GetSystemMetrics( int Index );

    private const int SM_CXSCREEN = 0;
    private const int SM_CYSCREEN = 1;
    private const int SM_CXSIZEFRAME = 32;

    #endregion

    #region GetWindowLong/SetWindowLong

    [DllImport( &quot;User32&quot;, EntryPoint = &quot;SetWindowLongPtr&quot; )]
    private static extern ulong SetWindowLong64( IntPtr hWnd, int nIndex, ulong dwNewLong );

    [DllImport( &quot;User32&quot;, EntryPoint = &quot;GetWindowLongPtr&quot; )]
    private static extern ulong GetWindowLong64( IntPtr hWnd, int nIndex );

    [DllImport( &quot;User32&quot;, EntryPoint = &quot;SetWindowLong&quot; )]
    private static extern uint SetWindowLong32( IntPtr hWnd, int nIndex, uint dwNewLong );

    [DllImport( &quot;User32&quot;, EntryPoint = &quot;SetWindowLong&quot; )]
    private static extern uint GetWindowLong32( IntPtr hWnd, int nIndex );

    private const int GWL_WNDPROC =    ( -4 );
    private const int GWL_HINSTANCE =  ( -6 );
    private const int GWL_HWNDPARENT = ( -8 );
    private const int GWL_STYLE =      ( -16 );
    private const int GWL_EXSTYLE =    ( -20 );
    private const int GWL_USERDATA =   ( -21 );
    private const int GWL_ID =         ( -12 );

    private static ulong GetWindowLong( IntPtr hWnd, int nIndex )
    {
        if ( IntPtr.Size == 4 ) {
            return GetWindowLong32( hWnd, nIndex );
        }   // if
        else if ( IntPtr.Size == 8 ) {
            return GetWindowLong64( hWnd, nIndex );
        }   // else if
        else {
            throw new NotSupportedException( &quot;Unsupported platform.&quot; );
        }   // else
    }

    private static ulong SetWindowLong( IntPtr hWnd, int nIndex, ulong dwNewLong )
    {
        if ( IntPtr.Size == 4 ) {
            return SetWindowLong32( hWnd, nIndex, (uint)dwNewLong );
        }   // if
        else if ( IntPtr.Size == 8 ) {
            return SetWindowLong64( hWnd, nIndex, dwNewLong );
        }   // else if
        else {
            throw new NotSupportedException( &quot;Unsupported platform.&quot; );
        }   // else
    }

    #endregion

    #region Window Styles

    private const ulong WS_OVERLAPPED = 0x0000;
    private const ulong WS_POPUP = 0x80000000;
    private const ulong WS_CHILD = 0x40000000;
    private const ulong WS_MINIMIZE = 0x20000000;
    private const ulong WS_VISIBLE = 0x10000000;
    private const ulong WS_DISABLED = 0x8000000;
    private const ulong WS_CLIPSIBLINGS = 0x4000000;
    private const ulong WS_CLIPCHILDREN = 0x2000000;
    private const ulong WS_MAXIMIZE = 0x1000000;
    private const ulong WS_BORDER = 0x800000;
    private const ulong WS_DLGFRAME = 0x400000;
    private const ulong WS_VSCROLL = 0x200000;
    private const ulong WS_HSCROLL = 0x100000;
    private const ulong WS_SYSMENU = 0x80000;
    private const ulong WS_THICKFRAME = 0x40000;
    private const ulong WS_GROUP = 0x20000;
    private const ulong WS_TABSTOP = 0x10000;
    private const ulong WS_MINIMIZEBOX = 0x20000;
    private const ulong WS_MAXIMIZEBOX = 0x10000;
    private const ulong WS_CAPTION = WS_BORDER | WS_DLGFRAME;
    private const ulong WS_TILED = WS_OVERLAPPED;
    private const ulong WS_ICONIC = WS_MINIMIZE;
    private const ulong WS_SIZEBOX = WS_THICKFRAME;
    private const ulong WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW;
    private const ulong WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
    private const ulong WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU;
    private const ulong WS_CHILDWINDOW = WS_CHILD;

    #endregion

    #endregion

}   // class
&quot;@

if ($DockProcess = Get-Process $DockProcessName -ea 0) {
   [WindowDockUtil]::Dock($DockProcess.MainWindowHandle)
}
else {
    Write-Warning &quot;Cannot find the $DockProcessName process.&quot;
}</pre>
<p><a title="Dock TweetDeck" href="http://bit.ly/9EwI71" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Dock TweetDeck" border="0" alt="image" src="http://www.josheinstein.com/blog/wp-content/uploads/2010/03/image1.png" width="300" height="227" /></a></p>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fdock-tweetdeck%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fdock-tweetdeck%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=.NET,PowerShell" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/03/dock-tweetdeck/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WPF : Using Markup Extensions to generate content with icons</title>
		<link>http://josheinstein.com/blog/index.php/2010/03/wpf-using-markup-extensions-to-generate-content-with-icons/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/03/wpf-using-markup-extensions-to-generate-content-with-icons/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 21:03:43 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/index.php/2010/03/wpf-using-markup-extensions-to-generate-content-with-icons/</guid>
		<description><![CDATA[It&#8217;s way too hard to get an image next to the text content of a Button, TextBlock, ListBoxItem, TreeViewItem, etc. Coming from a Windows Forms background where many controls had an Image property for displaying a small glyph next to text content, I am constantly frustrated by the verbose XAML required to achieve the same [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s way too hard to get an image next to the text content of a Button, TextBlock, ListBoxItem, TreeViewItem, etc. Coming from a Windows Forms background where many controls had an Image property for displaying a small glyph next to text content, I am constantly frustrated by the verbose XAML required to achieve the same in WPF and Silverlight.</p>
<pre class="brush: xml">&lt;StackPanel&gt;
    &lt;Button&gt;
        &lt;DockPanel&gt;
            &lt;Image Source=&quot;Images/Alert.png&quot; /&gt;
            &lt;TextBlock Text=&quot;Alerts&quot; /&gt;
        &lt;/DockPanel&gt;
    &lt;/Button&gt;
    &lt;Button&gt;
        &lt;DockPanel&gt;
            &lt;Image Source=&quot;Images/Color-Blue.png&quot; /&gt;
            &lt;TextBlock Text=&quot;Blue Category&quot; /&gt;
        &lt;/DockPanel&gt;
    &lt;/Button&gt;
    &lt;Button&gt;
        &lt;DockPanel&gt;
            &lt;Image Source=&quot;Images/Color-Green.png&quot; /&gt;
            &lt;TextBlock Text=&quot;Green Category&quot; /&gt;
        &lt;/DockPanel&gt;
    &lt;/Button&gt;
    &lt;Button&gt;
        &lt;DockPanel&gt;
            &lt;Image Source=&quot;Images/Color-Red.png&quot; /&gt;
            &lt;TextBlock Text=&quot;Red Category&quot; /&gt;
        &lt;/DockPanel&gt;
    &lt;/Button&gt;
&lt;/StackPanel&gt;</pre>
<p>Well using a WPF markup extension in XAML we can make the code look a little less clunky. Markup extensions (which derive from System.Windows.MarkupExtension) are instantiated similarly to the way attributes are declared in C#. That is to say, there can be positional and/or named parameters. By overriding the ProvideValue you can use those parameters to construct whatever object structure you want and return it. The XAML parser will use this in place of your markup extension when it finds it.</p>
<pre class="brush: xml">&lt;StackPanel&gt;
    &lt;Button Content=&quot;{e:Content Alerts, Image=Images/Alert.png}&quot; /&gt;
    &lt;Button Content=&quot;{e:Content Blue Category, Image=Images/Color-Blue.png}&quot; /&gt;
    &lt;Button Content=&quot;{e:Content Green Category, Image=Images/Color-Green.png}&quot; /&gt;
    &lt;Button Content=&quot;{e:Content Red Category, Image=Images/Color-Red.png}&quot; /&gt;
&lt;/StackPanel&gt;</pre>
<p>Unfortunately Silverlight does not allow you to create custom markup extensions yet so this same technique cannot be applied to Silverlight where the situation is arguably worse with all the toolkit namespaces and such.</p>
<p>The code for the ContentExtension is very straightforward so I&#8217;m just going to add it to the end of the post instead of going through the hassle of uploading a project. Enjoy.</p>
<pre class="brush: csharp; collapse: true">/// &lt;summary&gt;
/// A XAML Markup Extension that allows you to combine simple text content with an image
/// alongside instead of having to manually nest the image and text in a panel.
/// &lt;/summary&gt;
public class ContentExtension : MarkupExtension
{

    // constructor with positional parameter
    public ContentExtension( string text )
    {
        Text = text;
    }

    // image must be specified as a named parameter
    public ImageSource Image
    {
        get;
        set;
    }

    public string Text
    {
        get;
        set;
    }

    public override object ProvideValue( IServiceProvider serviceProvider )
    {
        return new DockPanel {
            Children = {
                new Image {
                    Source = Image,
                    Stretch = Stretch.None,
                    VerticalAlignment = VerticalAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    Margin = new Thickness( 5 )
                },
                new TextBlock {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = Text
                }
            }
        };
    }

}   // class
</pre>
<p><img title="Content Markup Extension" alt="Content Markup Extension" align="center" src="http://www.josheinstein.com/blog/wp-content/uploads/2010/03/ContentExtension.png" /></p>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fwpf-using-markup-extensions-to-generate-content-with-icons%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fwpf-using-markup-extensions-to-generate-content-with-icons%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=WPF" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/03/wpf-using-markup-extensions-to-generate-content-with-icons/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Windows 7 PowerShell Tip</title>
		<link>http://josheinstein.com/blog/index.php/2010/03/windows-7-powershell-tip/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/03/windows-7-powershell-tip/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 15:43:43 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/index.php/2010/03/windows-7-powershell-tip/</guid>
		<description><![CDATA[If you&#8217;re a system administrator (or like many developers), chances are you use PowerShell a lot and have the PowerShell console or PowerShell ISE on your Windows 7 taskbar. On Windows Vista and on Windows Server 2008 prior to R2 I was annoyed by having both ISE and console on the quick launch bar or [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a system administrator (or like many developers), chances are you use PowerShell a lot and have the PowerShell console or PowerShell ISE on your Windows 7 taskbar. On Windows Vista and on Windows Server 2008 prior to R2 I was annoyed by having both ISE and console on the quick launch bar or pinned to the start menu.</p>
<p>In Windows 7 here&#8217;s a neat tip. Pin the PowerShell console to the taskbar and not the PowerShell ISE. When you right click on the icon, you get a handy jump list which includes not only &quot;Run As Administrator&quot; but also &quot;Open PowerShell ISE&quot;. All in the space of a single tile.</p>
<p align="center"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Windows PowerShell Jump List" border="0" alt="Windows PowerShell Jump List" src="http://www.josheinstein.com/blog/wp-content/uploads/2010/03/image.png" width="421" height="315" /></p>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fwindows-7-powershell-tip%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fwindows-7-powershell-tip%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=PowerShell,Windows" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/03/windows-7-powershell-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accept simple mathematical expressions in Silverlight text boxes</title>
		<link>http://josheinstein.com/blog/index.php/2010/03/mathevalconverter/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/03/mathevalconverter/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 04:26:13 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/?p=160</guid>
		<description><![CDATA[Download MathEvalConverter.zip Background With the name Einstein, people typically assume I&#8217;m good at math. I have the utmost respect for the physicists and mathemeticians of our time, prior, and beyond. But to be honest, math is not my strong suit. In fact I have great difficulty simply adding or subtracting numbers without the use of [...]]]></description>
			<content:encoded><![CDATA[<p>Download <a href="/silverlight/mathevalconverter/mathevalconverter.zip">MathEvalConverter.zip</a></p>
<h2>Background</h2>
<p>With the name Einstein, people typically assume I&#8217;m good at math. I have the utmost respect for the physicists and mathemeticians of our time, prior, and beyond. But to be honest, math is not my strong suit. In fact I have great difficulty simply adding or subtracting numbers without the use of a calculator. This deficiency actually worked to my advantage last month when I was observing the users of an application I had recently dogfed.</p>
<p>The application had several numeric input fields that took in costs, prices, commissions, etc. Like any run of the mill business application, these inputs affected various calculations that updated the UI accordingly. But while observing the users I kept noticing a very peculiar behavior. When they would type into a box for Cost, Price, etc. they would whip out a small desk calculator and add up some numbers before typing them into the box.</p>
<p>As it turns out, the values I took for granted as a pre-calculated input often require various &quot;in-your-head&quot; steps before arriving at what I assumed was a known &quot;input&quot;.</p>
<blockquote><p>&quot;The cost of the product is normally $15 but I knocked it down by $3.&quot;</p>
</blockquote>
<p>Given my mathematical challenges, I was very sympathetic to this situation. I don&#8217;t own a desk calculator but I am very familiar with the Start -&gt; Run -&gt; calc.exe ceremony. If I happen to have a PowerShell window open I&#8217;ll use that instead.</p>
<p>Did I miss a key requirement? Should there have been more input fields? Not really because the calculation steps are not necessarily formal aspects of the system. They&#8217;re mostly things people might normally do in their head had they not happen to have a calculator in front of them. And the type of calculations they perform vary from case to case.</p>
<p>Then I remembered&#8230; I encounter this same situation all the time when working in Excel. But Excel&#8217;s primary feature is the fact that you can type a &quot;formula&quot; or expression anywhere you&#8217;d put a constant value. Wouldn&#8217;t it be great if the text boxes in my application offered the same functionality? Well by the end of this post, they will!</p>
<h2>The Plan</h2>
<p>The idea is that my input boxes would allow the user to enter a number as usual, but if they entered an expression such as &quot;2+2&quot;, committing the value would enter &quot;4&quot; into the field. The expression doesn&#8217;t need to be preserved, so the value of the field can still be backed by a simple number. Also, I only need to implement very basic expressions. I&#8217;ll stick to addition, subtraction, multiplication, division, grouping, and any combination of the above.</p>
<p>I thought about where I might add this functionality. I could subclass TextBox, but then the cells in a DataGrid would need to be addressed separately. I could probably have done it with a behavior but that didn&#8217;t seem appropriate either. In the end I decided to implement an IValueConverter. I was already using one to provide currency formatting in the control.</p>
<p>The end result would look like the working example shown below.</p>
<div align="center"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" style="width: 350px; height: 350px"><param name="source" value="/Silverlight/MathEvalConverter/MathEvalConverterDemo.xap" /><param name="background" value="white" /><param name="minRuntimeVersion" value="3.0.40818.0" /><param name="autoUpgrade" value="false" /><a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40818.0">             <br />               <img alt="Get Microsoft Silverlight" src="http://go.microsoft.com/fwlink/?LinkId=108181" style="border-style: none" />             <br />           </a><br />       </object></div>
<h2>The Math Parser</h2>
<p>Because this application was an in-browser Silverlight application, I could avoid having to write my own math parser by taking advantage of the HTML bridge and the Eval() method. In short, I would pass the expression to the JavaScript engine to evaluate as if it were a line of code. Of course, I would need to validate the input first to ensure a malicious user could not take advantage of this fact.</p>
<p>To isolate this shortcut into replacable component, I extracted an IMathEvaluator interface that would be defined as follows.</p>
<pre class="brush: csharp">public interface IMathEvaluator {
    bool TryEvaluate(string expression, out decimal value);
}</pre>
<p>This allows me to include my JavaScript hack for the sake of this post while admitting that a less lazy developer could substitute a better implementation. One nice thing about this implementation is that I don&#8217;t need to determine if the user entered a number or expression. Even if they entered a simple number like 1, I still treat it as an expression.</p>
<p>The implementation is pretty simple too. It simply checks the input against a Regex to ensure it&#8217;s not going to pass some malicious payload to the JavaScript engine then calls Eval() via the Silverlight HTML bridge.</p>
<pre class="brush: csharp">public sealed class JScriptMathEvaluator : IMathEvaluator
{
    public bool TryEvaluate(string expression, out decimal value ) {

        // When there's no text, just return zero
        if ( expression == null || expression.Trim().Length == 0 ) {
            value = 0;
            return true;
        }

        // remove currency symbols and commas
        // these are added when we format the number but we want to remove them before
        // parsing the text value because it would invalidate the JavaScript syntax
        var numberFormat = CultureInfo.CurrentCulture.NumberFormat;
        expression = expression.Replace( numberFormat.CurrencySymbol, &quot;&quot; );
        expression = expression.Replace( numberFormat.CurrencyGroupSeparator, &quot;&quot; );
        expression = expression.Replace( numberFormat.NumberGroupSeparator, &quot;&quot; );
        expression = expression.Replace( numberFormat.PercentGroupSeparator, &quot;&quot; );

        // Ensure that a simple expression consisting of only digits,
        // parenthases, and four operators (+, -, *, /) are entered.
        // Never pass non-validated input to JavaScript!
        if (Regex.IsMatch(expression, @&quot;^[0-9\.\+\-\*\/\(\)\s]+$&quot; ) ) {

            try {
                object eval = System.Windows.Browser.HtmlPage.Window.Eval( expression );
                value = Convert.ToDecimal(eval);
                return true;
            }   // try
            catch ( Exception ex ) {
                // trace exception or whatever
                // but let the function return false
            }   // catch

        }   // if

        value = 0;
        return false;

    }
}</pre>
<h2>The Value Converter</h2>
<p>In order to convert the user&#8217;s input into a number I&#8217;ll need to invoke a conversion process when the value of the TextBox changes. I was already doing this with a FormattingConverter that would apply currency formatting to the number and then parse the text value with NumberStyles.</p>
<p>So let&#8217;s just derive a class from FormattingConverter with support for the ConvertBack method. We&#8217;ll call it MathEvalConverter.</p>
<pre class="brush: csharp">public sealed class MathEvalConverter : FormattingConverter
{

    public MathEvalConverter( )
    {
        MathEvaluator = new JScriptMathEvaluator( );
    }

    public IMathEvaluator MathEvaluator
    {
        get;
        set;
    }

    protected override object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
    {

        // View -&gt; ViewModel

        string expression = System.Convert.ToString( value );

        decimal numberValue;
        if ( MathEvaluator != null &amp;&amp; MathEvaluator.TryEvaluate( expression, out numberValue ) ) {
            return numberValue;
        }   // if

        // We couldn't parse the expression.
        // Let silverlight reject it because:
        //   - if we throw an exception, it Silverlight bypasses validation events
        //   - if we return DependencyProperty.UnsetValue, the input will just disappear with no error!
        // By returning the unconverted value back to Silverlight, at least they'll see a conversion error.

        return base.ConvertBack( value, targetType, parameter, culture );

    }

}   // class</pre>
<p>The converter doesn&#8217;t specifically use the JavaScript implementation. It goes through the IMathEvaluator interface which happens to be implemented by JScriptMathEvaluator.</p>
<h2>MathEvalConverter In Action</h2>
<p>We can apply the MathEvalConverter to any two-way binding between a numeric property on the binding source and a string property on a control. Since it derives from FormattingConverter, we can supply a format string to pretty format the numbers.</p>
<pre class="brush: xml">&lt;UserControl&gt;
    &lt;FrameworkElement.Resources&gt;
        &lt;Local:MathEvalConverter x:Key=&quot;Eval&quot; Format=&quot;C2&quot; /&gt;
        &lt;Local:FormattingConverter x:Key=&quot;Date&quot; Format=&quot;d&quot; /&gt;
    &lt;/FrameworkElement.Resources&gt;
    &lt;Form:DataForm Header=&quot;Expense Report&quot;&gt;
        &lt;StackPanel&gt;

            &lt;Form:DataField Label=&quot;Reported By&quot;&gt;
                &lt;TextBox Text=&quot;{Binding Name, Mode=TwoWay}&quot; /&gt;
            &lt;/Form:DataField&gt;

            &lt;Form:DataField Label=&quot;Expense Date&quot;&gt;
                &lt;TextBox Text=&quot;{Binding Date, Converter={StaticResource Date}, Mode=TwoWay}&quot; /&gt;
            &lt;/Form:DataField&gt;

            &lt;Form:DataField Label=&quot;Meals&quot;&gt;
                &lt;TextBox Text=&quot;{Binding Meals, Converter={StaticResource Eval}, Mode=TwoWay}&quot; /&gt;
            &lt;/Form:DataField&gt;

        &lt;/StackPanel&gt;
    &lt;/Form:DataForm&gt;
&lt;/UserControl&gt;</pre>
<h2>Summary</h2>
<p>Enough talk. Download the code, and let me know what you think. I have no idea if anyone finds these posts useful if you don&#8217;t post comments!</p>
<p>Download <a href="/silverlight/mathevalconverter/mathevalconverter.zip">MathEvalConverter.zip</a></p>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fmathevalconverter%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fmathevalconverter%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=Silverlight" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/03/mathevalconverter/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Excellent WPF performance tips on the Visual Studio Blog</title>
		<link>http://josheinstein.com/blog/index.php/2010/03/excellent-wpf-performance-tips-on-the-visual-studio-blog/</link>
		<comments>http://josheinstein.com/blog/index.php/2010/03/excellent-wpf-performance-tips-on-the-visual-studio-blog/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 14:54:39 +0000</pubDate>
		<dc:creator>Josh Einstein</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.josheinstein.com/blog/index.php/2010/03/excellent-wpf-performance-tips-on-the-visual-studio-blog/</guid>
		<description><![CDATA[These aren&#8217;t your typical, obvious tips. Head over to the Visual Studio Blog to learn some WPF performance tips that the team picked up during the development of Visual Studio 2010. Some of the performance issues required changes to WPF that we all will benefit from in .NET 4. Others are clever ways to work [...]]]></description>
			<content:encoded><![CDATA[<p>These aren&#8217;t your typical, obvious tips. Head over to the <a href="http://blogs.msdn.com/visualstudio/archive/2010/03/02/wpf-in-visual-studio-2010-part-2-performance-tuning.aspx" target="_blank">Visual Studio Blog</a> to learn some WPF performance tips that the team picked up during the development of Visual Studio 2010. Some of the performance issues required changes to WPF that we all will benefit from in .NET 4. Others are clever ways to work around various idiosyncracies of WPF.</p>
<p>Take this for example.</p>
<blockquote><p><strong>Optimize for Remote Desktop scenarios : Use scrolling hint</strong></p>
<p>Also on the topic of Remote Desktop, one area where we needed additional support from WPF was for scrolling in the text editor. As I mentioned above, when in a remote session, all WPF content is transmitted as a bitmap. When the text editor scrolls by a line, that means that the entire contents of the editor region needs to be retransmitted as a bitmap. This, of course can be expensive – the larger the area of the text view, the larger the bitmap and the slower it will be. Fortunately, WPF 4.0 now knows how to issue a “ScrollWindow” command to the remote desktop session which drastically reduces the amount of information transferred across the wire. Only the scroll operation itself (very short) and the newly-exposed line need to be transmitted. To take advantage of this new operation, you need to use the property <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.visual.visualscrollableareaclip(VS.100).aspx">VisualScrollableAreaClip</a>. There are some restrictions on where this can be used, so read the documentation carefully.</p>
</blockquote>
<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fexcellent-wpf-performance-tips-on-the-visual-studio-blog%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjosheinstein.com%2Fblog%2Findex.php%2F2010%2F03%2Fexcellent-wpf-performance-tips-on-the-visual-studio-blog%2F&amp;source=EinsteinTech&amp;style=compact&amp;service=bit.ly&amp;service_api=josheinstein%3AR_8f0cc65162a0a58028040381bb51dfce&amp;hashtags=WPF" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://josheinstein.com/blog/index.php/2010/03/excellent-wpf-performance-tips-on-the-visual-studio-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
