<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>No Free Time &#187; xaml</title>
	<atom:link href="http://andrewmyhre.wordpress.com/category/xaml/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewmyhre.wordpress.com</link>
	<description>Because my therapist says I need to let things out</description>
	<lastBuildDate>Fri, 04 Dec 2009 12:05:33 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='andrewmyhre.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/b012d8af26af279e8b78dea60a545c86?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>No Free Time &#187; xaml</title>
		<link>http://andrewmyhre.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://andrewmyhre.wordpress.com/osd.xml" title="No Free Time" />
		<item>
		<title>Explanation for a weird Visual Studio 2008 Silverlight 2 issue</title>
		<link>http://andrewmyhre.wordpress.com/2009/01/22/explanation-for-a-weird-visual-studio-2008-silverlight-2-issue/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/01/22/explanation-for-a-weird-visual-studio-2008-silverlight-2-issue/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 12:35:39 +0000</pubDate>
		<dc:creator>Andrew Myhre</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[silverlight 2]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=182</guid>
		<description><![CDATA[I ran into a weird and annoying Silverlight/Visual Studio quirk today which cost me a little bit of time to work out the cause of, so here&#8217;s my story in case it helps anyone else out.
If you&#8217;re building a Silverlight Page/UserControl and you run it and instead of seeing your lovely application appear you see [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=182&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I ran into a weird and annoying Silverlight/Visual Studio quirk today which cost me a little bit of time to work out the cause of, so here&#8217;s my story in case it helps anyone else out.</p>
<p>If you&#8217;re building a Silverlight Page/UserControl and you run it and instead of seeing your lovely application appear you see something like this:</p>
<p> </p>
<p> </p>
<p><div id="attachment_183" class="wp-caption alignnone" style="width: 310px"> (line 1, col 26): Unknown attribute xmlns on element WallContentView&#8221;]<a href="http://andrewmyhre.files.wordpress.com/2009/01/011.jpg"><img class="size-medium wp-image-183" title="Unknown attribute xmlns on element WallContentView" src="http://andrewmyhre.files.wordpress.com/2009/01/011.jpg?w=300&#038;h=48" alt="weird error" width="300" height="48" /></a><p class="wp-caption-text">Sys.InvalidOperationException: Invalid XAML for control &#39;Xaml1&#39;. [</p></div> </p>
<p>And you notice in the XAML where you have included your control some blue lines:</p>
<p> </p>
<p> </p>
<p><a href="http://andrewmyhre.files.wordpress.com/2009/01/021.jpg"><img class="alignnone size-medium wp-image-184" title="021" src="http://andrewmyhre.files.wordpress.com/2009/01/021.jpg?w=300&#038;h=66" alt="021" width="300" height="66" /></a></p>
<p> </p>
<p>And when you place your mouse cursor over the lines you see something incomprehensible, like this:</p>
<p> </p>
<p> </p>
<p><div id="attachment_185" class="wp-caption alignnone" style="width: 310px">&#8220;]<a href="http://andrewmyhre.files.wordpress.com/2009/01/031.jpg"><img class="size-medium wp-image-185" title="51]" src="http://andrewmyhre.files.wordpress.com/2009/01/031.jpg?w=300&#038;h=83" alt="031" width="300" height="83" /></a><p class="wp-caption-text">AG_E_UNKNOWN_ERROR [Line: 49 Position: 51</p></div> </p>
<p>I did today. After trying essentially random and arbitrary things to solve the issue (deleting and recreating the control, renaming the control, removing sections of XAML and code from the control) I finally narrowed it down to this:</p>
<p> </p>
<p> </p>
<p><a href="http://andrewmyhre.files.wordpress.com/2009/01/041.jpg"><img class="alignnone size-medium wp-image-186" title="041" src="http://andrewmyhre.files.wordpress.com/2009/01/041.jpg?w=300&#038;h=96" alt="041" width="300" height="96" /></a></p>
<p> </p>
<p>In my constructor I was causing an null reference error, but <strong>it was being reported as a XAML error</strong>! How bloody confusing.  And the reason this didn&#8217;t twig immediately is that I didn&#8217;t realise <strong>the XAML editor actually creates instances of the control tree and invokes the constructors of the controls in the process</strong>. Never occurred to me before, but makes total sense.</p>
<p>Anyway, so I fixed my code:</p>
<p><a href="http://andrewmyhre.files.wordpress.com/2009/01/051.jpg"><img class="alignnone size-medium wp-image-187" title="051" src="http://andrewmyhre.files.wordpress.com/2009/01/051.jpg?w=300&#038;h=97" alt="051" width="300" height="97" /></a></p>
<p> </p>
<p>Rebuilt the solution and checked the containing control&#8217;s XAML:</p>
<p><a href="http://andrewmyhre.files.wordpress.com/2009/01/061.jpg"><img class="alignnone size-medium wp-image-188" title="061" src="http://andrewmyhre.files.wordpress.com/2009/01/061.jpg?w=300&#038;h=72" alt="061" width="300" height="72" /></a></p>
<p> </p>
<p>No more blue lines &#8211; nice. Finally I ran my test page and lo and behold it worked!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/182/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=182&subd=andrewmyhre&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/01/22/explanation-for-a-weird-visual-studio-2008-silverlight-2-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Andrew Myhre</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/01/011.jpg?w=300" medium="image">
			<media:title type="html">Unknown attribute xmlns on element WallContentView</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/01/021.jpg?w=300" medium="image">
			<media:title type="html">021</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/01/031.jpg?w=300" medium="image">
			<media:title type="html">51]</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/01/041.jpg?w=300" medium="image">
			<media:title type="html">041</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/01/051.jpg?w=300" medium="image">
			<media:title type="html">051</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/01/061.jpg?w=300" medium="image">
			<media:title type="html">061</media:title>
		</media:content>
	</item>
	</channel>
</rss>