<?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/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Run.To.The.Hills &#187; .Net</title>
	<atom:link href="http://rob.runtothehills.org/archives/category/wpf/feed" rel="self" type="application/rss+xml" />
	<link>http://rob.runtothehills.org</link>
	<description>Talk is cheap. Show me the code.</description>
	<lastBuildDate>Tue, 07 Sep 2010 09:57:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Dynamic parameters in XPath WPF bindings.</title>
		<link>http://rob.runtothehills.org/archives/355</link>
		<comments>http://rob.runtothehills.org/archives/355#comments</comments>
		<pubDate>Thu, 12 Mar 2009 23:57:01 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rob.runtothehills.org/archives/355</guid>
		<description><![CDATA[Image via Wikipedia Since its been a fair while since I posted anything with technical content, I thought I’d lighten the atmosphere with some hardcore XAML extending I was asked this question a while back, how to parameterize an XPath query in a binding. Well, it is a bit of problem, you know, ranking right [...]]]></description>
			<content:encoded><![CDATA[<p style="margin: 1em; width: 212px; display: block; float: right" class="zemanta-img" jquery1236875251867="865"><a href="http://commons.wikipedia.org/wiki/Image:XML.svg"><img style="border-bottom: medium none; border-left: medium none; display: block; border-top: medium none; border-right: medium none" alt="A graphical depiction of a very simple xml doc..." src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/68/XML.svg/202px-XML.svg.png" width="202" height="230" /></a></p>
<p style="font-size: 0.8em" class="zemanta-img-attribution">Image via <a href="http://commons.wikipedia.org/wiki/Image:XML.svg">Wikipedia</a></p>
<p>Since its been a fair while since I posted anything with technical content, I thought I’d lighten the atmosphere with some hardcore XAML extending <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I was asked this question a while back, how to parameterize an XPath query in a binding. Well, it is a <em>bit </em>of problem, you know, ranking right up there with global warming, world peace, North Korean space program crisis etc, and like most lazy developer’s (that’s a good thing btw!) I googled <em>first </em>to see what I could turn up.</p>
<p>There were plenty of scams for solving global warming, but not one for Dynamic XPaths in XAML bindings.</p>
<p>Nothing. Zilch. Nada. Zip. There was one post that made me think that it may well be a bit more difficult that I was expecting.</p>
<p><a href="http://karlhulme.wordpress.com/2007/02/14/xpath-variabledynamic-parameters-in-wpf-binding/" target="_blank">This post by Karl Hulme</a> almost did what I wanted but not quite. it still wasn’t flexible enough to perform the type of binding I wanted to solve this particular problem, which was, to basically externalise rich tool tip data that was held in an external file, so the client could easily update the data to be shown based on control names on a form. The tool tip had to show not only text, but other rich content that was configured from an XML data source.</p>
<p>So after much head scratching, I came up with what I thought was quite a neat solution. Although it doesn’t solve global warming I think it’s quite a neat solution to the XAML problem. It’s a combination of a Value Converter and a Markup Extension, which allows you to specify XPath bound data in a clean way right in the XAML. The tooltip is then templated using these two classes to display the additional content as well as its original content if any.</p>
<p><span id="more-355"></span><br />
In my test case, the binding uses the name of the control that the tool tip added to as the path to the Tool Tips data.
</p>
<p>Here’s a piece of code that shows the tool tips markup which will display rich content based on “Button1” in the external data.</p>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">Button </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&quot;Button1&quot; </span><span style="color: red">Width</span><span style="color: blue">=&quot;120&quot; </span><span style="color: red">Height</span><span style="color: blue">=&quot;60&quot; </span><span style="color: red">Margin</span><span style="color: blue">=&quot;8&quot;&gt;</span><span style="color: #a31515">Hover for help!    </span></pre>
<blockquote>
<pre class="code"><span style="color: #a31515"></span><span style="color: blue">&lt;</span><span style="color: #a31515">Button.ToolTip</span><span style="color: blue">&gt;        </span></pre>
<p>
    </p>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">ToolTip </span><span style="color: red">Style</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">StaticResource </span><span style="color: red">toolStyle</span><span style="color: blue">}&quot;/&gt;    </span></pre>
<p>
    </p>
<pre class="code"><span style="color: blue">&lt;/</span><span style="color: #a31515">Button.ToolTip</span><span style="color: blue">&gt;</span></pre>
<p>
    </p>
<pre class="code"><span style="color: blue">&lt;/</span><span style="color: #a31515">Button</span><span style="color: blue">&gt;</span></pre>
</blockquote>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Not much to see here, move along! Most of the complex XAML is actually done in the template, from the outside the tooltip looks pretty normal, apart from this tip has no content.</p>
<p>So, what magical incantations do we have to perform in the tool tip style? Well, everywhere we need to drag in some content from the XML data source, we have a control whose source is the said MarkupExtension.</p>
<p>For example we declare one of the labels in the tool tips template like so :</p>
<p><span style="color: blue">&lt;</span><span style="color: #a31515">TextBlock </span><span style="color: red">Text</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">TipTest</span><span style="color: blue">:</span><span style="color: #a31515">DynamicXPath </span></p>
<pre class="code"><span style="color: #a31515"></span><span style="color: red">Format</span><span style="color: blue">='</span>/<span style="color: blue">HelpNotes</span>/<span style="color: blue">HelpNote[</span>@<span style="color: blue">Ctrl=&amp;quot</span><span style="color: blue">{</span>0<span style="color: blue">}&amp;quot</span><span style="color: blue">]</span>/<span style="color: blue">Guidance',</span></pre>
<p>
  </p>
<pre class="code"><span style="color: blue"></span><span style="color: red">Source</span><span style="color: blue">={</span><span style="color: #a31515">Binding </span><span style="color: red">Path</span><span style="color: blue">=PlacementTarget,</span><span style="color: red"></span></pre>
<p>
  </p>
<pre class="code"><span style="color: red">RelativeSource</span><span style="color: blue">={</span><span style="color: #a31515">RelativeSource </span><span style="color: red">AncestorType</span><span style="color: blue">={</span><span style="color: #a31515">x</span><span style="color: blue">:</span><span style="color: #a31515">Type </span><span style="color: red">Popup</span><span style="color: blue">}}} }&quot; </span></pre>
<p>
  </p>
<pre class="code"><span style="color: blue"></span><span style="color: red">Foreground</span><span style="color: blue">=&quot;White&quot; /&gt;</span></pre>
<p>Note: the whole Format argument is actually one string, unfortunately my blog won’t cope with XAML parameters that are 50,000 characters wide!</p>
<p>Notice that the Source parameter of the markup extension is bound to the Placement target of the control that we know will be hosting the tooltip, solely in order to extract its name. When the DynamicXPath executes, it evaluates the binding to get the control from which to extract the name for use in the markup extensions value converter.</p>
<p>The name of the control is used as part of the XPath which selects a single node where the attribute @Ctrl is equal to the controls name. Neat huh?</p>
<p>Man, you’ve gotta love the flexibility of WPF!</p>
<p>The markup extension then uses the data context of the control as the XML data source.</p>
<p>Although the datasource is provided in the XAML markup for simplicity it can, of course, be any XML document set as the data source somewhere up the controls tree.</p>
<p>The end result is that by specifying the tool tips style we can create dynamic pop ups, based on the controls name. Here’s a shot of the resulting tooltip with an animation playing as part of the rich content.</p>
<p><a href="http://rob.runtothehills.org/wp-content/uploads/2009/03/tipdemo.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="tipdemo" border="0" alt="tipdemo" src="http://rob.runtothehills.org/wp-content/uploads/2009/03/tipdemo-thumb.jpg" width="380" height="484" /></a></p>
<p>There’s a second button under the tooltip that has a different ID, and shows different content too. Although both buttons use the same tooltip style, you can of course supply any style for the tooltip. The important parts are the usage of the Markup Extension to extract data from the XML document that are then used as part of the template.</p>
<p>For those of you, like me, too idle to reinvent the wheel the sample application including the DynamicXPath markup extension is available for download <a href="http://rob.runtothehills.org/" target="_blank"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/355/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:thumbnail url="http://upload.wikimedia.org/wikipedia/commons/thumb/6/68/XML.svg/202px-XML.svg.png" />
		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/6/68/XML.svg/202px-XML.svg.png" medium="image">
			<media:title type="html">A graphical depiction of a very simple xml doc...</media:title>
		</media:content>
		<media:content url="http://rob.runtothehills.org/wp-content/uploads/2009/03/tipdemo-thumb.jpg" medium="image">
			<media:title type="html">tipdemo</media:title>
		</media:content>
	</item>
		<item>
		<title>Epic Battles with McAfee</title>
		<link>http://rob.runtothehills.org/archives/336</link>
		<comments>http://rob.runtothehills.org/archives/336#comments</comments>
		<pubDate>Mon, 23 Feb 2009 17:17:46 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://rob.runtothehills.org/archives/336</guid>
		<description><![CDATA[Image via Wikipedia What week, I’ve managed about 4 hours of actual development. The problem? McAfee’s on demand scanner. It all started Monday, whilst I was writing a templated ASP.Net control similar to the inbuilt Logon panel. The difference was that this control respects the privileges of the logged on user, using the Oracle security [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="display: block; float: right; margin: 1em; width: 212px" jquery1235407058686="1864"><a href="http://en.wikipedia.org/wiki/Image:Mcafee_logo.svg"><img style="border-right: medium none; border-top: medium none; display: block; border-left: medium none; border-bottom: medium none" height="45" alt="McAfee, Inc." src="http://upload.wikimedia.org/wikipedia/en/thumb/a/ad/Mcafee_logo.svg/202px-Mcafee_logo.svg.png" width="202" /></a>
<p class="zemanta-img-attribution" style="font-size: 0.8em">Image via <a href="http://en.wikipedia.org/wiki/Image:Mcafee_logo.svg">Wikipedia</a></p>
</p></div>
<p>What week, I’ve managed about 4 hours of actual development. The problem? McAfee’s on demand scanner. </p>
<p>It all started Monday, whilst I was writing a templated ASP.Net control similar to the inbuilt Logon panel. The difference was that this control respects the privileges of the logged on user, using the Oracle security model that we’re deep into.</p>
<p>Anyway, on using the panel I started getting unrecognised tag errors, and then Devstudio wouldn’t compile the project. At all. So, after a bit of cleaning and the usual go to the dos prompt, i really cleaned the project and tried again. Success. </p>
<p>All the errors went away. Hmm, i thought to myself. must be some cruft from left from the other day when one of the other office staff mistakenly unplugged my PC instead of the electric heater at her feet. Twice. </p>
<p>Any I’d scan-disked the PC and found nothing wrong so off I went merrily coding away. Then odd little errors started creeping in. Tags not recognised, xml schema errors from files I’d not touched for days. It never occurred to me that the On Demand scanner from McAfee could be the culprit. So after blaming myself first for a day, then DevStudio for a day, I started looking at all the other corporate software that was running on the PC. Keep in mind that it takes a day for this because these aren’t the worlds fastest PC’s (the fast ones are on order <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<p>So finally I examine the McAfee On Demand logs. Holy smoke. over 4000 blocked actions in the last hour. Yes I work fast. Either that or there’s a lot of files making up our project <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Not only that, but the file it seemed to be scanning was the .ASPX file i just so happened to be working on. I’ll take that as the smoking gun.</p>
<p>So I think I’ve found the culprit, but trying to sort out what to do about it is a whole different story! </p>
<p>Remember that we’re dealing with a corporate IT department. Can I get rid of McAfee? No. I tried that already. Not enough rights. So I ring the IT department. Waivers for developers? modifications to the policies, different virus killer? No, No and NO. So, I’m kind of stuck here. It’s out of my hands now, but given that I’m on a daily rate, this could be getting expensive, and its only when the costs start mounting up that people notice. Nothing I try seems to stop the interference with VS2008, and meanwhile the project is kind of stood still. I haven’t been idle (of course!) I’ve installed a full automated build system whilst I’m waiting for this to get solved, but that’s in a VM where I can guarantee that its running exactly what I want, not what someone else thinks I need <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I’ll keep y’all posted.</p>
<p>In the mean time, might I suggest :</p>
<p>1) Don’t use on demand scanners with development environments. Its not worth the hassle. This is the second time McAfee’s bitten me.</p>
<p>2) if you have to use on demand scanners, don’t use McAfee!.</p>
<p>If only real life development was that simple.</p>
<p>&#160;</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/05b96833-b15c-4b92-a484-02ed5cd58dbe/"><img class="zemanta-pixie-img" style="border-right: medium none; border-top: medium none; float: right; border-left: medium none; border-bottom: medium none" alt="Reblog this post [with Zemanta]" src="http://img.zemanta.com/reblog_e.png?x-id=05b96833-b15c-4b92-a484-02ed5cd58dbe" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/336/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://upload.wikimedia.org/wikipedia/en/thumb/a/ad/Mcafee_logo.svg/202px-Mcafee_logo.svg.png" />
		<media:content url="http://upload.wikimedia.org/wikipedia/en/thumb/a/ad/Mcafee_logo.svg/202px-Mcafee_logo.svg.png" medium="image">
			<media:title type="html">McAfee, Inc.</media:title>
		</media:content>
		<media:content url="http://img.zemanta.com/reblog_e.png?x-id=05b96833-b15c-4b92-a484-02ed5cd58dbe" medium="image">
			<media:title type="html">Reblog this post [with Zemanta]</media:title>
		</media:content>
	</item>
		<item>
		<title>Binding and DetailsView</title>
		<link>http://rob.runtothehills.org/archives/335</link>
		<comments>http://rob.runtothehills.org/archives/335#comments</comments>
		<pubDate>Wed, 11 Feb 2009 17:00:39 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rob.runtothehills.org/archives/335</guid>
		<description><![CDATA[Since I’m doing more ASP.Net than I’d normally like to admit to, here’s a really useful little snippet that I struggled with earlier. After my google ninjitsu failed me I turned to figuring it out for myself. Once I’d wiped the sweat from my forehead I came up with a solution. Whew. Ok, the problem [...]]]></description>
			<content:encoded><![CDATA[<p>Since I’m doing more ASP.Net than I’d normally like to admit to, here’s a really useful little snippet that I struggled with earlier. After my google ninjitsu failed me I turned to figuring it out for myself.</p>
<p>Once I’d wiped the sweat from my forehead I came up with a solution. Whew.</p>
<p>Ok, the problem was that I have a typical master/detail gridview &amp; details view on a form which allows the user to select a row in the grid and then edit the details via the DetailsView. So far so good. I managed to get the whole thing hooked up declaratively using ObjectDataProviders so it felt almost like the XAML i know an love <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Anyway next on the agenda was the field validation. I’d re-templated the fields on the DetailsView so we’d got DropDownLists showing predefined lists take from the internal DataModel. Life was good. Throw in a few field validators and we’re good to go. Almost.</p>
<p>Since some of the fields on the form were just TextBoxes, I’d added the typical RequiredFieldValidator, but what about the lengths? These text boxes are mapped VarChar columns on the DB, they had an explicit length. I could hand code the length with the MaxLength property but that just means more work should the DB schema change on me. </p>
<p>If this were XAML we’d have it bound up in no time, but all my attempts in ASP failed miserably.</p>
<p>I know that the DataContext – oops sorry (!) – DataItem must be a DataRow from the table the grid was bound to, so there must be a property giving access to the rows columns. Sure enough, there’s the DataRows Table property we can use. Great! Saved! Effectively what I’d like to do would be bind up the MaxLength property to a DataColumns MaxLength propert. Sound simple. something like</p>
<p align="left">&lt;asp:TextBox MaxLength=&#8217;&lt;%# Table.Columns[&quot;GUR_FORENAME&quot;].MaxLength &gt;&#8217;&gt;</p>
<p>Not so fast buster. Unfortunately&#160; the above and all variations I tried didn’t seem to work. Even trying to Bind() to the table didn’t seem to work either</p>
<p>&lt;asp:TextBox MaxLength=&#8217;&lt;%# (Bind(“Table”) as DataTable).Columns[&quot;GUR_FORENAME&quot;].MaxLength &gt;&#8217;&gt;</p>
<p>Since Bind(“Table”) returns object, i thought i was in there! No such luck. Dozens of variations later, magic incantations, a full moon and some voodoo, I finally managed to get it working.</p>
<p>The final version of the binding expression I was after looked like this :</p>
<p>&lt;%# Eval(&quot;Table.Columns[\&quot;GUR_FORENAME\&quot;].MaxLength&quot;) %&gt;</p>
<p>I’m still freaked out by the fact the whole expression has to be <em>inside</em> the quotes. If Bind() really does return an object what the hell is it? If I had time to spare I’d <a href="http://www.red-gate.com/products/reflector/" target="_blank">reflector</a> through this, but unfortunately after spending too long on figuring out how to bind the max length, it’s something that will have to wait.</p>
<p>So, it looks like the ASP binding is a bit more flexible than first thought, and not surprisingly , the standard examples hint at!</p>
</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/24cea405-b043-47c9-beb2-73461c036dba/"><img class="zemanta-pixie-img" style="border-right: medium none; border-top: medium none; float: right; border-left: medium none; border-bottom: medium none" alt="Reblog this post [with Zemanta]" src="http://img.zemanta.com/reblog_e.png?x-id=24cea405-b043-47c9-beb2-73461c036dba" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/335/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://img.zemanta.com/reblog_e.png?x-id=24cea405-b043-47c9-beb2-73461c036dba" />
		<media:content url="http://img.zemanta.com/reblog_e.png?x-id=24cea405-b043-47c9-beb2-73461c036dba" medium="image">
			<media:title type="html">Reblog this post [with Zemanta]</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix Oracle dot Net&#8230;</title>
		<link>http://rob.runtothehills.org/archives/334</link>
		<comments>http://rob.runtothehills.org/archives/334#comments</comments>
		<pubDate>Wed, 04 Feb 2009 17:10:36 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hackery]]></category>

		<guid isPermaLink="false">http://rob.runtothehills.org/archives/334</guid>
		<description><![CDATA[Image by Getty Images via Daylife …is now up! FixOracle.Net in its first incarnation fixes the type of dodgy Oracle code we’re using on our current project, but since the ‘fixing engine’ is shared between the web site, the winform tool, and the command line tool, when I figure out what casts are missing, I’ll [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="display: block; float: right; margin: 1em; width: 123px" jquery1233766726280="940"><a href="http://www.daylife.com/image/04UDdQ5dy110R?utm_source=zemanta&amp;utm_medium=p&amp;utm_content=04UDdQ5dy110R&amp;utm_campaign=z1"><img style="border-right: medium none; border-top: medium none; display: block; border-left: medium none; border-bottom: medium none" height="150" alt="SAN FRANCISCO - SEPTEMBER 24:  The new Oracle ..." src="http://cache.daylife.com/imageserve/04UDdQ5dy110R/113x150.jpg" width="113" /></a>
<p class="zemanta-img-attribution" style="font-size: 0.8em">Image by <a href="http://www.daylife.com/source/Getty_Images">Getty Images</a> via <a href="http://www.daylife.com/">Daylife</a></p>
</p></div>
<p>…is now up! <a href="http://www.fixoracle.net" target="_blank">FixOracle.Net</a> in its first incarnation fixes the type of dodgy <a class="zem_slink" title="Oracle (comics)" href="http://en.wikipedia.org/wiki/Oracle_%28comics%29" rel="wikipedia">Oracle</a> code we’re using on our current project, but since the ‘fixing engine’ is shared between the web site, the winform tool, and the command line tool, when I figure out what casts are missing, I’ll add them too.</p>
<p>In the mean time <a href="http://www.fixoracle.net/">http://www.fixoracle.net</a> is where you need to go for the absolute best in web design and hot advert-clicking-for-your-friends action. </p>
<p>Well, they’re not going to click themselves.</p>
<p> <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/6c3aab93-b37b-49f6-ad11-5773622c77e0/"><img class="zemanta-pixie-img" style="border-right: medium none; border-top: medium none; float: right; border-left: medium none; border-bottom: medium none" alt="Reblog this post [with Zemanta]" src="http://img.zemanta.com/reblog_e.png?x-id=6c3aab93-b37b-49f6-ad11-5773622c77e0" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/334/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://cache.daylife.com/imageserve/04UDdQ5dy110R/113x150.jpg" />
		<media:content url="http://cache.daylife.com/imageserve/04UDdQ5dy110R/113x150.jpg" medium="image">
			<media:title type="html">SAN FRANCISCO - SEPTEMBER 24:  The new Oracle ...</media:title>
		</media:content>
		<media:content url="http://img.zemanta.com/reblog_e.png?x-id=6c3aab93-b37b-49f6-ad11-5773622c77e0" medium="image">
			<media:title type="html">Reblog this post [with Zemanta]</media:title>
		</media:content>
	</item>
		<item>
		<title>Fixing Oracle&#8217;s TableAdapters</title>
		<link>http://rob.runtothehills.org/archives/333</link>
		<comments>http://rob.runtothehills.org/archives/333#comments</comments>
		<pubDate>Fri, 30 Jan 2009 17:08:22 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rob.runtothehills.org/archives/333</guid>
		<description><![CDATA[Ok, by now you know Oracles table adapters are broken. Just searching on google for a solution turns up a significant number of other people having the same issues. Broken code, bad ODP crashes inside devstudio etc etc etc. Google turns up nothing but bad news when you’re looking for a solution to ease the [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, by now you know Oracles table adapters are broken. Just searching on google for a solution turns up a significant number of other people having the same issues. Broken code, bad ODP crashes inside devstudio etc etc etc. Google turns up nothing but bad news when you’re looking for a solution to ease the pain of using .Net and Oracle tools.!</p>
<p>Well, since the fixes are pretty easy to add, I’ve created a little tool to automate the process. Although the fixes are quite simple, they soon mount up when you got more than a couple of TableAdapters that change more than a couple of times during the life of the project. In fact fixing oracle’s bugs starts eating a significant part of your development time, beyond the most trivial projects with one or two adapters. Maybe we should start invoicing them for the time taken to fix their crap code <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>ok, enough of the idle banter. Since a picture is worth a thousand words here’s a screen grab of the tool to whet your appetite!</p>
<p><a href="http://rob.runtothehills.org/wp-content/uploads/2009/01/orablefixer.png"><img title="orablefixer" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="484" alt="orablefixer" src="http://rob.runtothehills.org/wp-content/uploads/2009/01/orablefixer-thumb.png" width="375" border="0" /></a></p>
<p>Ok, I admit I stole the graphic! Basically this fixes the current crop of problems that the ODT generates when you drag a stored procedure or table to the VS’s Dataset design surface. As an additional ‘fix’ it also makes the Adapters CommandCollection public if you tick the check box.</p>
<p>Making the CommandCollection public means that you don’t have to derive a class from the generated table adapter, or provide another partial class when you want to do things like change the connection string on the fly, or make the commands participate in a transaction.</p>
<p>For those of us unable to use an ORM too or we’re just stuck with Oracle and the default tools for legacy code, this should help a little. </p>
<p>Anyway, I’m going to register a domain for the tool, and provide an online version too, where you upload a source file to fix, and it returns the fixed version. Maybe when there’s a public domain showing how to fix Oracle’s deficiencies, they’ll release a patch for a bug that’s been on metalink for what feels like *eternity*.</p>
<p>Watch out for FixMyOracle.Net coming soon <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/333/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://rob.runtothehills.org/wp-content/uploads/2009/01/orablefixer-thumb.png" />
		<media:content url="http://rob.runtothehills.org/wp-content/uploads/2009/01/orablefixer-thumb.png" medium="image">
			<media:title type="html">orablefixer</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing&#8230;</title>
		<link>http://rob.runtothehills.org/archives/321</link>
		<comments>http://rob.runtothehills.org/archives/321#comments</comments>
		<pubDate>Fri, 12 Dec 2008 00:00:07 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://rob.runtothehills.org/archives/321</guid>
		<description><![CDATA[Image via Wikipedia nCode I.T. Limited! Yes, I’ve finally got round to setting up my own limited company. Since it makes more sense from a taxation point of view, and also gives me a platform to launch my own Micro-ISV. Since I’m deeply entrenched in the .Net world at the moment, I thought a bit [...]]]></description>
			<content:encoded><![CDATA[<div style="margin: 1em; display: block; float: right" class="zemanta-img"><a href="http://commons.wikipedia.org/wiki/Image:Munsell-system.svg"><img style="border-bottom-style: none; border-right-style: none; display: block; border-top-style: none; border-left-style: none" alt="The Munsell color system, showing: a circle of..." src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Munsell-system.svg/202px-Munsell-system.svg.png" width="202" height="202" /></a>
<p style="font-size: 0.8em" class="zemanta-img-attribution">Image via <a href="http://commons.wikipedia.org/wiki/Image:Munsell-system.svg">Wikipedia</a></p>
</p></div>
<p><a target="_blank" href="http://www.ncodeit.com/">nCode I.T. Limited</a>! Yes, I’ve finally got round to setting up my own limited company. Since it makes more sense from a taxation point of view, and also gives me a platform to launch my own Micro-ISV. Since I’m deeply entrenched in the .Net world at the moment, I thought a bit of word play on the nXXX series of tools (nHibernate, nUnit etc) would have a cool geekiness to it. Anyway, the site basically gives a few details about my skill set &amp; what I&#8217;ve been up to, purely for the contracting &amp; outsourcing work, but the final (and as yet unlinked) section will pint to some of the work I’ve been doing outside contracting hours that’s helping me towards the fully fledged Micro-ISV status.</p>
<p>My first commercial product for my Micro-ISV will be a set of Bitmap Effects for .Net 3.5SP1. </p>
<p>This Effect pack will include :</p>
<ul>
<li>Desaturation Effect      <br />One of the most missed features of WPF is that of greying out interface elements when disabled. when buttons containing bitmap artwork are disabled, the bitmap doesn’t go grey. There are lots of messy kludges and workarounds for this, but this effect addresses that problem completely. As opposed to some of the other available effect this doesn’t just change the element to grey scale it allows you to set a specific saturation level, allowing you to do cool effects like fade out your entire application to grey when it loses focus, kind of like the windows XP shutdown state. Unlike many other average-the-colours type of grey effects this uses the true NTSC colour weights to produce a correct desaturation.      </li>
<li>Colorize Effect      <br />This will allow you to change the colour of any element and colorize it any new colour. Colorizing respects the pixels luminance, but changes the colour of each pixel to the new colour you’ve chosen. A simple effect. but very useful for fixing elements to all have the same set of tones.       </li>
<li>Skin Shade effect      <br />This is the special one. It allows you to completely re-skin your application (if it is set far enough up the visual tree, i.e. on the top level window) because although it changes the colours, it respects the relationship between them. In other words if you picture the shades used in your application on a colour wheel, they will remain the same relative distances after they’ve changed. This means that if you chose analogous, split compliments, or triadic hues, they will remain that way, but their base hues will be rotated. It sounds much more complex than it actually is! The end result is that as long as your colour set was pleasing to start with, it will remain that way, even after you apply the effect.</li>
</ul>
<p>Here’s an example of the skin shade effect. Two different ‘skins’ provided by applying the effect right at the top level window. Allowing an almost infinite range of skins is now only 3 lines of XAML away! This is the WPF outlook Hands-On-Lab that the effect has been applied to.</p>
<p>Fancy a rose pink outlook ?</p>
<p><a href="http://rob.runtothehills.org/wp-content/uploads/2008/12/clip-image002.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image002" border="0" alt="clip_image002" src="http://rob.runtothehills.org/wp-content/uploads/2008/12/clip-image002-thumb.jpg" width="388" height="305" /></a></p>
<p>and a fraction of a decimal away are shades of purple.</p>
<p><a href="http://rob.runtothehills.org/wp-content/uploads/2008/12/clip-image0027.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image002[7]" border="0" alt="clip_image002[7]" src="http://rob.runtothehills.org/wp-content/uploads/2008/12/clip-image0027-thumb.jpg" width="388" height="305" /></a></p>
<p>Notice that although the colours change, the intensity and saturation stay constant. If you have a nice pastel colour set, all you’ll get after applying the effect is more matching pastel colours.</p>
<p>Obviously these effects could be achieved by making sure you set all your element colours to dynamic resources, and then defining lots of resource dictionaries with colour schemes in, then adding an interface to load those schemes. Although this is the traditional way to manage themes (and obviously still has its place) making sure all your elements share the same styles or dynamic resources for colours its a royal pain, and error prone. </p>
<p>Using a single effect like this allows you to define one set of harmonious colours for your application, then get an almost infinite set of harmonious colours at the switch of a floating point value, without ever forgetting to set an elements colour, and also doing away with the resource hit of using dynamic resources for every screen element that you want to change colour.</p>
<p>Another feature of the Bitmap Effects is the ability to selectively apply the effect based on an Opacity value. This allows you to add the bitmap effect to your top level window but still maintain control of which elements actually get affected by the effect right down at the element level. </p>
<p>An example case where you would need this is an application that displays photographs. You really wouldn’t want your grandmothers purple rinse extending across the whole photo just because it was part of the visual tree that the Colorize effect had been applied to! Using a specific value for the Opacity we can exclude elements from the effect. There are samples provided which explain how to do this selective effect application. </p>
<p>All the effects in the library support selective application at the pixel level. Another useful thing this feature allows you to do is maintain a specific colour for your control’s text, and have it excluded from the application of the effects.</p>
<p>I’m currently working on the documentation and samples, but when these bits are done, you can purchase this effects library and get updates, support, and implementation help via the official <a target="_blank" href="http://www.bitmapeffects.com/">nCodeFxLib Bitmap Effects site</a></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:676bf095-2c45-402d-9af8-8b7d02300bdb" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/bitmap+effects" rel="tag">bitmap effects</a>,<a href="http://technorati.com/tags/desaturate" rel="tag">desaturate</a>,<a href="http://technorati.com/tags/grey" rel="tag">grey</a>,<a href="http://technorati.com/tags/wpf" rel="tag">wpf</a></div>
<p>Enjoy.</p>
<p>Rob</p>
<div style="margin-top: 10px; height: 15px" class="zemanta-pixie"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/6fd1fff3-3a68-48bb-b173-59a2e016f8b5/"><img style="border-bottom-style: none; border-right-style: none; border-top-style: none; float: right; border-left-style: none" class="zemanta-pixie-img" alt="Reblog this post [with Zemanta]" src="http://img.zemanta.com/reblog_e.png?x-id=6fd1fff3-3a68-48bb-b173-59a2e016f8b5" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/321/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Munsell-system.svg/202px-Munsell-system.svg.png" />
		<media:content url="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Munsell-system.svg/202px-Munsell-system.svg.png" medium="image">
			<media:title type="html">The Munsell color system, showing: a circle of...</media:title>
		</media:content>
		<media:content url="http://rob.runtothehills.org/wp-content/uploads/2008/12/clip-image002-thumb.jpg" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>
		<media:content url="http://rob.runtothehills.org/wp-content/uploads/2008/12/clip-image0027-thumb.jpg" medium="image">
			<media:title type="html">clip_image002[7]</media:title>
		</media:content>
		<media:content url="http://img.zemanta.com/reblog_e.png?x-id=6fd1fff3-3a68-48bb-b173-59a2e016f8b5" medium="image">
			<media:title type="html">Reblog this post [with Zemanta]</media:title>
		</media:content>
	</item>
		<item>
		<title>.Net3.5sp1 RTM?</title>
		<link>http://rob.runtothehills.org/archives/305</link>
		<comments>http://rob.runtothehills.org/archives/305#comments</comments>
		<pubDate>Fri, 08 Aug 2008 18:42:11 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://runtothehills.org/rob/archives/305</guid>
		<description><![CDATA[A little bird&#8217;s told me that the .Net3.5sp1 will be RTM on 11th August! Wonder if the Pixel shader API has been rationalised&#8230; Multi-texture here we come]]></description>
			<content:encoded><![CDATA[<p>A little bird&#8217;s told me that the .Net3.5sp1 will be RTM on 11th August! Wonder if the Pixel shader API has been rationalised&#8230; Multi-texture here we come <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/305/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
	</item>
		<item>
		<title>System.Windows.Data Error: 19</title>
		<link>http://rob.runtothehills.org/archives/300</link>
		<comments>http://rob.runtothehills.org/archives/300#comments</comments>
		<pubDate>Thu, 26 Jun 2008 22:19:54 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://runtothehills.org/rob/archives/300</guid>
		<description><![CDATA[Thought I&#8217;d brain dump a little problem I came across earlier today. Data Error 19. Here&#8217;s the full error. System.Windows.Data Error: 19 : Cannot convert &#8217;40&#8242; from type &#8216;Int32&#8242; to type &#8216;System.Int64&#8242; for &#8216;en-US&#8217; culture with default conversions; consider using Converter property of Binding. NotSupportedException: &#8216;System.NotSupportedException: Int64Converter cannot convert from System.Int32. &#160;&#160; at System.ComponentModel.TypeConverter.GetConvertFromException(Object value) [...]]]></description>
			<content:encoded><![CDATA[<p>Thought I&#8217;d brain dump a little problem I came across earlier today. Data Error 19.</p>
<p>Here&#8217;s the full error.</p>
<blockquote><p><font color="#0000a0" size="1">System.Windows.Data Error: 19 : Cannot convert &#8217;40&#8242; from type &#8216;Int32&#8242; to type &#8216;System.Int64&#8242; for &#8216;en-US&#8217; culture with default conversions; consider using Converter property of Binding. NotSupportedException: &#8216;System.NotSupportedException: Int64Converter cannot convert from System.Int32.       <br />&#160;&#160; at System.ComponentModel.TypeConverter.GetConvertFromException(Object value)        <br />&#160;&#160; at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)        <br />&#160;&#160; at MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)&#8217;</font></p>
</blockquote>
<p>How did I get here? Well, I have a bunch of generated values that come from a data dictionary , they&#8217;re generated into classes that contain Key/Value pairs, where the Key is an Int32. </p>
<p>This list is shown in a combo box, and the current value of the combo box is then bound to a CLR value type in a class. The only problem is that the classes CLR Type isn&#8217;t an Int32. It&#8217;s an Int64. </p>
<p>Now I know the the real fix is to generate a list of values for the combo box who&#8217;s type matches the destination bound value of Int64. The trouble is that I don&#8217;t always have that type information available. Thing is, I can&#8217;t remember any other control having the problem of changing types.</p>
<p>Heck,if you look at the conversion that it&#8217;s trying to do, it should be able to cope, converting an Int32 to an Int64 isn&#8217;t a narrowing cast, so there should be no problems with overflow. Eitherway, i just want to bind up this stuff and not worry about the types.</p>
<p>So, I wrote a small test app to verify what was going on. </p>
<p><a href="http://runtothehills.org/rob/wp-content/uploads/2008/06/boundvauetest.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="309" alt="boundVaueTest" src="http://runtothehills.org/rob/wp-content/uploads/2008/06/boundvauetest-thumb.png" width="232" border="0" /></a> </p>
<p>Both the slider and the combo box are bound to an internal value, called surprisingly , &quot;BoundValue&quot; that&#8217;s declared as an Int64, and there&#8217;s a textbox that is then bound the &quot;BoundValue&quot; to show its current value.</p>
<p>&#160;</p>
<p><span id="more-300"></span></p>
<p>I created a List&lt;Int32&gt; used as the ItemsSource for the ComboBox. &#8211; so the binding should set the BoundValue to an item in that list, or so I thought. Remember the BoundValue is an Int64, and the list the combo box is using is a list of Int32&#8242;s.</p>
<p>The slider is represented by a Double, so when you come to bind its value to the textbox the standard binding box only shows Double Properties &#8211; a gentle hint that binding it to an Int64 may not be the smartest thing to do.</p>
<p><a href="http://runtothehills.org/rob/wp-content/uploads/2008/06/bindintomatchingtypes.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="324" alt="BindinToMatchingTypes" src="http://runtothehills.org/rob/wp-content/uploads/2008/06/bindintomatchingtypes-thumb.png" width="343" border="0" /></a> </p>
<p>So to show up the BoundValue variable we must change the &quot;Show Matching Types Only&quot; ComboBox to &quot;Show All Properties&quot;. We can then bind the slider to our variable even though it&#8217;s an Int64, and the slider is a double.</p>
<p>Now we&#8217;re all bound up, we run the app, and slide the slider.</p>
<p><a href="http://runtothehills.org/rob/wp-content/uploads/2008/06/run1.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="309" alt="run1" src="http://runtothehills.org/rob/wp-content/uploads/2008/06/run1-thumb.png" width="232" border="0" /></a> </p>
<p>As expected, the binding from the Slider (a Double) quite happily sets our Int64 variable, which the TextBox then duly displays. We run the app again, and this time we set the variable using the ComboBox.</p>
<p><a href="http://runtothehills.org/rob/wp-content/uploads/2008/06/run2.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="324" alt="run2" src="http://runtothehills.org/rob/wp-content/uploads/2008/06/run2-thumb.png" width="226" border="0" /></a> </p>
<p>Not only does selecting one of the value <strong><em>not</em></strong> set our variable, if we check the output window of DevStudio we see the Databinding Error : 19.</p>
<p><a href="http://runtothehills.org/rob/wp-content/uploads/2008/06/debugout.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="104" alt="debugout" src="http://runtothehills.org/rob/wp-content/uploads/2008/06/debugout-thumb.png" width="504" border="0" /></a></p>
<p>So, the Slider will quite happily do an implicit type conversion between Double to the Int64 I have in my class, but the ComboBox&#8217;s binding won&#8217;t convert an Int32 to an Int64? </p>
<p>To fix this we need to create a ValueConverter to change the value&#8217;s type from Int32 to Int64, even though it seems that other controls perform this miracle without prompting!</p>
<p>As it turns out, there&#8217;s a handy function in the System.Convert namespace that helps up out here, making our Value converter very short and sweet.</p>
<p><span style="color: blue">public class </span><span style="color: #2b91af">TypeConverter </span>: <span style="color: #2b91af">IValueConverter </span>{    <br />&#160;&#160;&#160; <span style="color: blue">public object </span>Convert(<span style="color: blue">object </span>value, <span style="color: #2b91af">Type </span>targetType,    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">object </span>parameter, <span style="color: #2b91af">CultureInfo </span>culture) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">return </span>System.<span style="color: #2b91af">Convert</span>.ChangeType(value, targetType);    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; <span style="color: blue">public object </span>ConvertBack(<span style="color: blue">object </span>value, <span style="color: #2b91af">Type </span>targetType,    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">object </span>parameter, <span style="color: #2b91af">CultureInfo </span>culture) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">return </span>System.<span style="color: #2b91af">Convert</span>.ChangeType(value, targetType);    <br />&#160;&#160;&#160; }    <br />}    </p>
<p> <a href="http://11011.net/software/vspaste"></a>
<p>An added bonus is that System.Convert.ChangeType will only throw exceptions when an overflow occurs on a narrowing cast. You can check this out with <a href="http://www.aisto.com/Roeder/DotNet/" target="_blank">Lutz Roeders Reflector</a> by digging into the System assembly. </p>
<p>Before we re-run we need to add the Converter to the applications resources so we can use it from Xaml.</p>
<p>Adding the following to the App.xaml makes the TypeConverter available within blend&#8217;s binding dialog.</p>
<p>&lt;BindingExample:TypeConverter x:Key=&quot;TypeConverter&quot;&gt;&lt;/BindingExample:TypeConverter&gt; </p>
<p>and then we add the type converter to the binding using blend.</p>
<p><a href="http://runtothehills.org/rob/wp-content/uploads/2008/06/blendtypeconv.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="324" alt="blendtypeconv" src="http://runtothehills.org/rob/wp-content/uploads/2008/06/blendtypeconv-thumb.png" width="256" border="0" /></a> </p>
<p>&#160;</p>
<p><a href="http://runtothehills.org/rob/wp-content/uploads/2008/06/fixed.png"><img style="border-right: 0px; border-top: 0px; margin: 0px 10px 0px 0px; border-left: 0px; border-bottom: 0px" height="309" alt="fixed" src="http://runtothehills.org/rob/wp-content/uploads/2008/06/fixed-thumb.png" width="232" align="left" border="0" /></a> </p>
<p>hey Presto, the combo box now sets the variable, and we&#8217;re free of the binding errors.</p>
<p>Code and solution below.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>
<div class="wlWriterSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:8cb98055-21c8-4f96-aa84-0eaf73b38712" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p>Download the Solution <a href="http://runtothehills.org/rob/wp-content/uploads/2008/06/bindingexample1.zip" target="_blank">HERE</a></p>
</div>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8caa7964-9b2e-43bf-9374-030d75904967" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/DataBinding%20Error%2019" rel="tag">DataBinding Error 19</a>,<a href="http://technorati.com/tags/WPF" rel="tag">WPF</a>,<a href="http://technorati.com/tags/C#" rel="tag">C#</a>,<a href="http://technorati.com/tags/.NET" rel="tag">.NET</a></div>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/300/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://runtothehills.org/rob/wp-content/uploads/2008/06/boundvauetest-thumb.png" />
		<media:content url="http://runtothehills.org/rob/wp-content/uploads/2008/06/boundvauetest-thumb.png" medium="image">
			<media:title type="html">boundVaueTest</media:title>
		</media:content>
		<media:content url="http://runtothehills.org/rob/wp-content/uploads/2008/06/bindintomatchingtypes-thumb.png" medium="image">
			<media:title type="html">BindinToMatchingTypes</media:title>
		</media:content>
		<media:content url="http://runtothehills.org/rob/wp-content/uploads/2008/06/run1-thumb.png" medium="image">
			<media:title type="html">run1</media:title>
		</media:content>
		<media:content url="http://runtothehills.org/rob/wp-content/uploads/2008/06/run2-thumb.png" medium="image">
			<media:title type="html">run2</media:title>
		</media:content>
		<media:content url="http://runtothehills.org/rob/wp-content/uploads/2008/06/debugout-thumb.png" medium="image">
			<media:title type="html">debugout</media:title>
		</media:content>
		<media:content url="http://runtothehills.org/rob/wp-content/uploads/2008/06/blendtypeconv-thumb.png" medium="image">
			<media:title type="html">blendtypeconv</media:title>
		</media:content>
		<media:content url="http://runtothehills.org/rob/wp-content/uploads/2008/06/fixed-thumb.png" medium="image">
			<media:title type="html">fixed</media:title>
		</media:content>
	</item>
		<item>
		<title>I&#8217;m A Winner &#8230;. Again! Or&#8230; how to win free stuff with SCRUM :)</title>
		<link>http://rob.runtothehills.org/archives/284</link>
		<comments>http://rob.runtothehills.org/archives/284#comments</comments>
		<pubDate>Tue, 24 Jun 2008 20:16:16 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://runtothehills.org/rob/archives/284</guid>
		<description><![CDATA[Free Vouchers this time. Apparently I&#8217;ve won £100 of vouchers for implementing the Scrum methodology! I have no idea which shops the vouchers are for, only that they&#8217;re high street vouchers, so I suppose that&#8217;s cool, they could have been for kitchen tiles or something equally as mundane. But, heh, I&#8217;m not really doing anything [...]]]></description>
			<content:encoded><![CDATA[<p>Free Vouchers this time. Apparently I&#8217;ve won £100 of vouchers for implementing the Scrum methodology! I have no idea which shops the vouchers are for, only that they&#8217;re high street vouchers, so I suppose that&#8217;s cool, they could have been for kitchen tiles or something equally as mundane. But, heh, I&#8217;m not really doing anything to achieve these awards (<a target="_blank" href="http://runtothehills.org/rob/archives/166">like my iPod winning idea</a>), just kind of, well, plugging away at changing things. I guess someone&#8217;s starting to listen!</p>
<p>Anyway, we&#8217;re kind of a heavily entrenched Waterfall development shop so, I thought I&#8217;d liven things up and ignore the people that said we couldn&#8217;t do Agile here <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . So I merrily headed off down the Scrum path &#8211; having done it before I&#8217;m pretty sure by now the shoe will fit.</p>
<p>Friction, damn I thought I was on fire. Straight from 15 years of waterfall into scrum caused friction on a galactic scale &#8211; most of it not from the project itself, but the organisation. So, while the project works pretty well, and customer satisfaction skyrockets, the rest of the organisation is playing catch up. Still I guess nothing worth doing is easy. If it wasn&#8217;t for the customers complete buy in I don&#8217;t think I&#8217;d be winning awards, I think I&#8217;d be winning P45&#8242;s. (for you international readers that&#8217;s the short walk to the long unemployment queue&#8230;)</p>
<p>So, the best bit is actually that the customer loves the method so much that they&#8217;re bending over backwards to keep us using it, so much so that I hear they&#8217;re making requests of other projects to be run the same way! So from the customer side I&#8217;m starting to shine so much you need sunglasses when you approach my desk, whilst from our side I have dozens, if not hundred of disgruntled waterfallers baying for my blood. Some people simply don&#8217;t want to change. Heh, you can&#8217;t please all the people all the time.</p>
<p>Here are a few things I&#8217;ve noticed using Scrum with non-technical customers that are worth pointing out.</p>
<ol>
<li>It doesn&#8217;t matter how much work you&#8217;ve done, if its not on screen its not done.<br />
You can have web services coming out of your ying yang, and if the customer can&#8217;t push a button and see it work you haven&#8217;t done it.</li>
<li>It doesn&#8217;t matter how your project schedule is organised, if it doesn&#8217;t list when visual elements appear, they&#8217;re not interested.</li>
<li>Make sure that you&#8217;re fully resourced before you start.<br />
Ok, a bit obvious you may think, but the customer may not be your best friend when it comes to telling them you cant deliver feature X,Y or Z because Johnny Programmer hasn&#8217;t joined the project yet.</li>
<li>When organising the project by allowing the customer to prioritise the feature set for the product before generating each sprint, make sure that they&#8217;re prioritising <em>Visual Features.</em> They won&#8217;t understand anything else.</li>
<li>If the customer is involved in providing data to you, make sure they&#8217;re in easy to edit formats like word or excel. Deal with translation or the data conversion yourself, hiding it from the customer. <em>Hint</em> : customers don&#8217;t like angle brackets.</li>
<li>Customers like deadlines, make sure that the door swings both ways and provide dates you&#8217;d like them to have things ready by. It&#8217;s a good idea that keeps them working towards the same goals as you and makes them feel committed to making the product a success.</li>
<li>If you&#8217;re having <em>real</em> users testing the application, make sure that its as close to zero defect as possible. Users take great delight in pointing out the obvious like the focus rectangles are missing, they&#8217;re not bothered that you haven&#8217;t finished that bit yet.</li>
<li>Make sure you have customer identical kit<em>  before</em> you start. Requesting kit wasn&#8217;t the problem, the waterfall police ended up delaying requests because we weren&#8217;t in the testing period yet.</li>
<li>Prepare to spend a lot of time repeating yourself &#8211; especially to the crews on your side. If they&#8217;re still in waterfall mode, it will be a while before they &#8216;get&#8217; it.</li>
<li>Play nicely with others. Although the agile methods typically mean you do everything, it could make whole gaggles of people feel redundant and won&#8217;t win you any friends. Even if you can automate all your testing, make sure that your testing dept buys in, and maybe you could even get them involved in learning new testing methods. Who knows they may even want to help provide some code for you. Make sure that everyone feels needed. </li>
</ol>
<p>Not an exhaustive list, but things worth keeping in mind if your customer isn&#8217;t technical, or they don&#8217;t have anyone au-fait with the technology and methodology you&#8217;re using.</p>
<p>For the current project I&#8217;m using WPF<em>  and</em> scrum &#8211; so we&#8217;re already 7 years ahead of most of the crowd who are barely breaking free of VB and winforms 1.1 <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>And,for those of you wondering, <em>yes, you can do LOB applications with WPF. <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
<p style="display: inline; margin: 0px; padding: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:38fe7208-13b6-4ad8-bdc9-7c7712ec9404" class="wlWriterSmartContent">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Scrum">Scrum</a>,<a rel="tag" href="http://technorati.com/tags/Winning">Winning</a>,<a rel="tag" href="http://technorati.com/tags/WPF">WPF</a>,<a rel="tag" href="http://technorati.com/tags/LOB">LOB</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/284/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Top 10 WPF resources</title>
		<link>http://rob.runtothehills.org/archives/283</link>
		<comments>http://rob.runtothehills.org/archives/283#comments</comments>
		<pubDate>Mon, 16 Jun 2008 22:35:22 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://runtothehills.org/rob/archives/283</guid>
		<description><![CDATA[Technorati Tags: WPF,Top 10,Development Resources As a minor intermission while I put a bit more effort into the WPF article series, I thought I&#8217;d list my top 10 favourite WPF and .NET tools. Ok, here goes! The amazing free resource that is MSDN For top quality articles and all the WPF information you can eat, [...]]]></description>
			<content:encoded><![CDATA[<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:21e2dbc7-b403-474f-8008-ed658a3514ca" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/WPF" rel="tag">WPF</a>,<a href="http://technorati.com/tags/Top%2010" rel="tag">Top 10</a>,<a href="http://technorati.com/tags/Development%20Resources" rel="tag">Development Resources</a></div>
<p>As a minor intermission while I put a bit more effort into the WPF article series, I thought I&#8217;d list my top 10 favourite WPF and .NET tools.</p>
<p>Ok, here goes!</p>
<blockquote><ol>
<li>
<div align="left"><strong><em><a title="Microsofts developer network" href="http://msdn.microsoft.com/en-us/library/aa970268.aspx" target="_blank">The amazing free resource that is MSDN</a>              <br /></em></strong>For top quality articles and all the WPF information you can eat, there is no better place than MSDN (Except of course this blog <img src='http://rob.runtothehills.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )          </div>
</li>
<li>A List WPF Bloggers       <br />There&#8217;s always tons of useful WPF and .Net goodies on the WPF Blogosphere &#8211; Check out big names like <a href="http://blogs.windowsclient.net/rob_relyea/default.aspx" target="_blank">Rob Relyea</a> , <a href="http://karlshifflett.wordpress.com/" target="_blank">Karl Shifflett</a>, <a href="http://agsmith.wordpress.com/" target="_blank">Andrew Smith</a>, <a href="http://joshsmithonwpf.wordpress.com/" target="_blank">Josh Smith</a>, <a href="http://blogs.msdn.com/tims/default.aspx" target="_blank">Tim Sneath</a>, <a href="http://nerddawg.blogspot.com/" target="_blank">Ashish Shetty</a>, <a href="http://blogs.msdn.com/adam_nathan/default.aspx" target="_blank">Adam Nathan</a>, <a href="http://www.simplegeek.com/" target="_blank">Chris Anderson</a>, <a href="http://blogs.msdn.com/greg_schechter/" target="_blank">Greg Schechter</a>, <a href="http://designerslove.net/" target="_blank">Nathan Dunlap</a> and <a href="http://www.beacosta.com/" target="_blank">Bea Costa</a> are but a few of my favourites. Many of these guys have great WPF books out on the shelves, and their blogrolls are well worth checking out.        </li>
<li>Direct access to the <a href="http://blogs.msdn.com/wpfsdk/" target="_blank">SDK team</a>        <br />Yes, the WPF SDK team are online, and you can comment on the articles and entries directly on the SDK teams blog!        </li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=32a3e916-e681-4955-bc9f-cfba49273c7c&amp;DisplayLang=en" target="_blank">Expression Blend</a>        <br />Ok, you can use VisualStudio to edit your UX, but seriously, VS can&#8217;t compete with Blend. Download, Learn It, USE IT.        </li>
<li><a href="http://msdn.microsoft.com/en-us/vstudio/products/aa700831.aspx" target="_blank">Visual Studio 2008</a>        <br />By the same token, you <em>can</em> edit code in blend, but you&#8217;d have to be a serious masochist. Get hold of VS2008, nothing else comes close. Be amazed at the new feature sets this coding powerhouse gives you. Buy It, Learn It, USE IT with BLEND!        </li>
<li><a href="http://www.contentpresenter.com/" target="_blank">Content Presenters free video resources</a>        <br />They&#8217;re big, they&#8217;re excellent quality, and best of all, they&#8217;re free!        <br />Download them and watch them now!        </li>
<li><a href="http://www.blois.us/Snoop/" target="_blank">Snoop</a>, <a href="http://joshsmithonwpf.wordpress.com/mole/" target="_blank">Mole</a> and <a href="http://blogs.msdn.com/llobo/archive/2007/12/19/xamlpadx-v3-0.aspx" target="_blank">XamlPadX</a>, <a href="http://kaxaml.com/" target="_blank">Kaxaml</a>        <br />Four absolutely <em>must have</em> tools for helping with the WPF coding experience. While Devstudio does most things, you just cant do without these fantastic four.        </li>
<li><a href="http://forums.msdn.microsoft.com/en-US/wpf/threads/" target="_blank">The WPF Forums on MSDN</a>        <br />Absolutely the <em>best</em> place to get your questions answered, and a huge archive of previously solved problems. Before posting remember to search the forum.. most questions have been well covered before!        </li>
<li>The <strong><em>Daddy </em></strong>of all WPF sites, <a href="http://windowsclient.net/" target="_blank">WindowsClient.Net</a>        <br />what doesn&#8217;t this site contain. Nothing that&#8217;s what. If its not here, you probably don&#8217;t need it. ( Even my blog&#8217;s on here. Ok, I lied.)        </li>
<li>Finally, <a href="http://ux.nukeation.com/" target="_blank">Nukeation</a>        <br />Great content (although sometimes corny dialog!) but plenty to digest, and available as podcasts too. Nice job!        </li>
</ol>
<p>&#160;</p>
<p>Well, that filled a little gap for me, while i think about the amount of content i&#8217;m going to have to come up with for the next WPF article! &lt;sigh&gt;!</p>
<p>&#160;</p>
<p>Enjoy!</p>
<p>Rob</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://rob.runtothehills.org/archives/283/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
	</item>
	</channel>
</rss>
