<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Andrew Hay - Silverlight</title>
    <link>http://www.a7drew.com/blog/</link>
    <description>Thinking way too long about the subtitle</description>
    <language>en-us</language>
    <copyright>Andrew Hay</copyright>
    <lastBuildDate>Fri, 05 Nov 2010 16:31:50 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.12105.0</generator>
    <managingEditor>andrewcameronhay@hotmail.com</managingEditor>
    <webMaster>andrewcameronhay@hotmail.com</webMaster>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=047ffc59-09a5-4b16-afa3-cd0c7cee4c2f</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,047ffc59-09a5-4b16-afa3-cd0c7cee4c2f.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,047ffc59-09a5-4b16-afa3-cd0c7cee4c2f.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=047ffc59-09a5-4b16-afa3-cd0c7cee4c2f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
So, who out there already knew what a coworker and I just learned via trial and (mostly)
error?
</p>
        <p>
Jim and I were working on a simple Silverlight audio player with a couple of tracks,
nothing elaborate whatsoever. It runs great on Windows. Yet, it failed to play audio
on Mac OSX, regardless of browser.
</p>
        <p>
After a bit of voodoo, standing on one foot and other meaningless postulates, Jim
says, “Hey, can you move the player back onto the screen so we can see the trace statements?”
I was using CSS to position the player off the screen, as it has no user interface.
Jim was showing trace events in a simple textblock.
</p>
        <p>
As soon one pixel of the Silverlight control existed inside the visible browser viewport,
the audio would play on our Macbook Pro. Move it off the screen, then no audio for
you.
</p>
        <p>
But wait there’s more! Setting CSS visibility to hidden works in Mac/Safari, but still
fails in Mac/Firefox. To play in all browsers, the Silverlight player must have at
least one visible pixel on the screen. I didn’t try layering it behind another element
because a single dot on our page was invisible on the edge.
</p>
        <p>
Uhg.
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=047ffc59-09a5-4b16-afa3-cd0c7cee4c2f" />
      </body>
      <title>Playing Audio with Silverlight on Mac OSX</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,047ffc59-09a5-4b16-afa3-cd0c7cee4c2f.aspx</guid>
      <link>http://www.a7drew.com/blog/2010/11/05/PlayingAudioWithSilverlightOnMacOSX.aspx</link>
      <pubDate>Fri, 05 Nov 2010 16:31:50 GMT</pubDate>
      <description>&lt;p&gt;
So, who out there already knew what a coworker and I just learned via trial and (mostly)
error?
&lt;/p&gt;
&lt;p&gt;
Jim and I were working on a simple Silverlight audio player with a couple of tracks,
nothing elaborate whatsoever. It runs great on Windows. Yet, it failed to play audio
on Mac OSX, regardless of browser.
&lt;/p&gt;
&lt;p&gt;
After a bit of voodoo, standing on one foot and other meaningless postulates, Jim
says, “Hey, can you move the player back onto the screen so we can see the trace statements?”
I was using CSS to position the player off the screen, as it has no user interface.
Jim was showing trace events in a simple textblock.
&lt;/p&gt;
&lt;p&gt;
As soon one pixel of the Silverlight control existed inside the visible browser viewport,
the audio would play on our Macbook Pro. Move it off the screen, then no audio for
you.
&lt;/p&gt;
&lt;p&gt;
But wait there’s more! Setting CSS visibility to hidden works in Mac/Safari, but still
fails in Mac/Firefox. To play in all browsers, the Silverlight player must have at
least one visible pixel on the screen. I didn’t try layering it behind another element
because a single dot on our page was invisible on the edge.
&lt;/p&gt;
&lt;p&gt;
Uhg.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=047ffc59-09a5-4b16-afa3-cd0c7cee4c2f" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,047ffc59-09a5-4b16-afa3-cd0c7cee4c2f.aspx</comments>
      <category>Apple</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=016fc5cd-09f7-4123-bb5f-0919d75883fd</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,016fc5cd-09f7-4123-bb5f-0919d75883fd.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,016fc5cd-09f7-4123-bb5f-0919d75883fd.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=016fc5cd-09f7-4123-bb5f-0919d75883fd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'm digging the <a href="http://www.nbcolympics.com">http://www.nbcolympics.com</a> site
in Silverlight. I can see sports and interviews that I'm interested in and review
close plays as much as I like. I've shown this to the wife and the extended family
over the weekend.
</p>
        <p>
One thing that really keeping this from being the best thing ever is the user experience.
For example, the Control Room is a place where I can select up to four videos to watch
at once; one large and three side videos. That's really cool. However, the extended
family was the real test; and they were a little frustrated.
</p>
        <p>
The sucky part of the Control Room is the search interface. Here, I'm given
a tiny up/down arrow at the bottom of the thumbnail stack. This is something
visitors will do many times, every time they visit the site to see the next six or
previous six videos in the stack. Why not make this click experience really easy to
hit with big, phat arrow overlay icons? Maybe even advertise key strokes that do this.
Its just really frustrating for non-technical people to use.
</p>
        <p>
There's too many obfuscated clicks like this in the app. Just a few slight
UX improvements would have gone a long way here. NBC Silverlight team, I give you
a straight B here. Good job on the insight to give us what we want (choice in viewing
Olympic events), but a "meh" job in giving me to the tools to make that choice.
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=016fc5cd-09f7-4123-bb5f-0919d75883fd" />
      </body>
      <title>nbcolympics.com</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,016fc5cd-09f7-4123-bb5f-0919d75883fd.aspx</guid>
      <link>http://www.a7drew.com/blog/2008/08/11/nbcolympicscom.aspx</link>
      <pubDate>Mon, 11 Aug 2008 06:00:47 GMT</pubDate>
      <description>&lt;p&gt;
I'm digging the &lt;a href="http://www.nbcolympics.com"&gt;http://www.nbcolympics.com&lt;/a&gt;&amp;nbsp;site
in Silverlight. I can see sports and interviews that I'm interested in and review
close plays as much as I like. I've shown this to the wife and the extended family
over the weekend.
&lt;/p&gt;
&lt;p&gt;
One thing that really keeping this from being the best thing ever is the user experience.
For example, the Control Room is a place where I can select up to four videos to watch
at once; one large and three side videos. That's really cool. However, the extended
family was the real test; and they were a little frustrated.
&lt;/p&gt;
&lt;p&gt;
The sucky part of the Control Room&amp;nbsp;is the search interface.&amp;nbsp;Here, I'm given
a&amp;nbsp;tiny up/down arrow at the bottom of the thumbnail stack. This is something
visitors will do many times, every time they visit the site to see the next six or
previous six videos in the stack. Why not make this click experience&amp;nbsp;really easy&amp;nbsp;to
hit with big, phat arrow overlay icons? Maybe even advertise key strokes that do this.
Its just really frustrating for non-technical people to use.
&lt;/p&gt;
&lt;p&gt;
There's too many obfuscated clicks like&amp;nbsp;this&amp;nbsp;in the app. Just a few slight
UX improvements would have gone a long way here. NBC Silverlight team, I give you
a straight B here. Good job on the insight to give us what we want (choice in viewing
Olympic events), but a "meh" job in giving me to the tools to make that choice.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=016fc5cd-09f7-4123-bb5f-0919d75883fd" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,016fc5cd-09f7-4123-bb5f-0919d75883fd.aspx</comments>
      <category>events</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=bfeb30f2-bfbf-49a8-a479-32c7d64a9671</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,bfeb30f2-bfbf-49a8-a479-32c7d64a9671.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,bfeb30f2-bfbf-49a8-a479-32c7d64a9671.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=bfeb30f2-bfbf-49a8-a479-32c7d64a9671</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was fortunate enough to pop up to a special event on Silverlight at Microsoft in
Redmond, WA today. Mithun Dhar, Laurence Moroney, Arturo Toledo, Adam Kinney, Ernie
Booth and Jesse Liberty gave us some sweet tips on building apps and organizing a
good workflow between developers and designers. 
</p>
        <p>
Arturo is an awesome graphical designer. Oddly, or perhaps not, I liked his presentation
the best. He made the Expression products fly and gave me (a developer) good tips
on working efficiently with my design team. Jesse was a close second with his fundamentals
presentation - he really clicks well with developers.
</p>
        <p>
The crowd was mixed with about 60% developers and 40% graphic artists. I saw the ScottGu
blog post this morning announcing that Silverlight 1.1 is now named Silverlight 2.0
- between that and the hints dropped at today's meeting, it feels like Silverlight
is getting ready to explode. I think I'll still remember this day very well in three
to five years.
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=bfeb30f2-bfbf-49a8-a479-32c7d64a9671" />
      </body>
      <title>Silverlight 1.0 Fire Starter</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,bfeb30f2-bfbf-49a8-a479-32c7d64a9671.aspx</guid>
      <link>http://www.a7drew.com/blog/2007/11/29/Silverlight10FireStarter.aspx</link>
      <pubDate>Thu, 29 Nov 2007 22:53:08 GMT</pubDate>
      <description>&lt;p&gt;
I was fortunate enough to pop up to a special event on Silverlight at Microsoft in
Redmond, WA today. Mithun Dhar, Laurence Moroney, Arturo Toledo, Adam Kinney, Ernie
Booth and Jesse Liberty gave us some sweet tips on building apps and organizing a
good workflow between developers and designers. 
&lt;/p&gt;
&lt;p&gt;
Arturo is an awesome graphical designer. Oddly, or perhaps not, I liked his presentation
the best. He made the Expression products fly and gave me (a developer) good tips
on working efficiently with my design team. Jesse was a close second with his fundamentals
presentation - he really clicks well with developers.
&lt;/p&gt;
&lt;p&gt;
The crowd was mixed with about 60% developers and 40% graphic artists. I saw the ScottGu
blog post this morning announcing that Silverlight 1.1 is now named Silverlight 2.0
- between that and the hints dropped at today's meeting, it feels like Silverlight
is getting ready to explode. I think I'll still remember this day very well in three
to five years.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=bfeb30f2-bfbf-49a8-a479-32c7d64a9671" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,bfeb30f2-bfbf-49a8-a479-32c7d64a9671.aspx</comments>
      <category>events</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=e723c2e5-fc82-48cf-b437-b9f34781df0e</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,e723c2e5-fc82-48cf-b437-b9f34781df0e.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,e723c2e5-fc82-48cf-b437-b9f34781df0e.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e723c2e5-fc82-48cf-b437-b9f34781df0e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was working with a web service client that talked to SharePoint this week. I wrote
a quick Silverlight app that extracted a list of tasks out of a SharePoint list. I
love how simple this is to tap into:
</p>
        <p>
          <code>
            <a href="http://sharepoint.yourcompany.com/_vti_bin/lists.asmx">http://sharepoint.yourcompany.com/_vti_bin/lists.asmx</a>
          </code>
        </p>
        <p>
The previous URL will show the path to one of the web services provided out-of-the-box
by SharePoint. This particular web service provides several methods for dealing with
SharePoint lists. I just needed to call the GetListItems() method and pass in the
list name and view name as parameters in order to get my data.
</p>
        <p>
This worked fine on my local machine, but when I migrated the solution to a staging
server, the SharePoint web service refused to send me the data. After a bit of finagling,
I realized the web service was happy to talk to my laptop, but it politely declined
the remote web server's request as I lacked the proper credentials. I even was running
the web solution with impersonation enabled because I wanted to pass along my Windows
credentials during the call from the web server to the remote SharePoint server. I
forgot that this is just simply not possible. 
</p>
        <p>
For security reasons, the web server does not hold on to my credentials "just
in case" I might want to use them later. In this scenario, I do need them - but
no dice. This particular list in SharePoint is locked down tight.
</p>
        <p>
I didn't have the proper credentials when my web service client fired off a request
to SharePoint. When I was running on my local machine, using Casinni, my credentials
were readily available. On a remote web server, the credentials vanish. This is called
a "Double Hop" problem - the hops are from the browser, to the web server,
to another remote web server. The second hop tanked. It was a silly mistake on my
part, but hopefully by writing this down now will help me remember sooner next time.
</p>
        <p>
The code below shows how I solve this problem by manufacturing a credential on-the-fly
and then fire off a request to SharePoint. There are multiple ways of solving this
problem; I just happened to chose this one.
</p>
        <div style="padding-right: 0px; padding-left: 0px; background: #eee; padding-bottom: 20px; padding-top: 20px">
          <pre>         MySharePoint.Lists list = new ProjectBoard.MySharePoint.Lists();</pre>
          <pre> </pre>
          <pre>         list.Credentials = new System.Net.NetworkCredential(</pre>
          <pre>            ConfigurationManager.AppSettings["Credential.Username"],</pre>
          <pre>            ConfigurationManager.AppSettings["Credential.Password"],</pre>
          <pre>            ConfigurationManager.AppSettings["Credential.Domain"]);</pre>
          <pre> </pre>
          <pre>         XmlNode listItemsNode = list.GetListItems(</pre>
          <pre>            ConfigurationManager.AppSettings["LoremIpsum.Guid"], </pre>
          <pre>            ConfigurationManager.AppSettings["LoremIpsum.View.Guid"], </pre>
          <pre>            null, null, "100", null, null);</pre>
          <pre> </pre>
          <pre>         XmlNode dataNode = listItemsNode.ChildNodes[1];</pre>
          <pre> </pre>
          <pre>         foreach (XmlNode rowNode in dataNode.ChildNodes)</pre>
          <pre>         {</pre>
          <pre>           // extract values here</pre>
          <pre>         }</pre>
        </div>
        <p>
Now that I've got this little prototype functional, I can encrypt the credentials
in the web.config file by using <a href="http://msdn2.microsoft.com/en-us/library/ms998280.aspx" target="_blank">DPAPI</a>,
an encryption tool that makes it easy to protect sensitive information. Since I'm
creating new credentials here, I can avoid the Double Hop problem and get on with
my prototype.
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=e723c2e5-fc82-48cf-b437-b9f34781df0e" />
      </body>
      <title>Double Hop Disaster</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,e723c2e5-fc82-48cf-b437-b9f34781df0e.aspx</guid>
      <link>http://www.a7drew.com/blog/2007/11/10/DoubleHopDisaster.aspx</link>
      <pubDate>Sat, 10 Nov 2007 06:03:14 GMT</pubDate>
      <description>&lt;p&gt;
I was working with a web service client that talked to SharePoint this week. I wrote
a quick Silverlight app that extracted a list of tasks out of a SharePoint list. I
love how simple this is to tap into:
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;&lt;a href="http://sharepoint.yourcompany.com/_vti_bin/lists.asmx"&gt;http://sharepoint.yourcompany.com/_vti_bin/lists.asmx&lt;/a&gt;&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
The previous URL will show the path to one of the web services provided out-of-the-box
by SharePoint. This particular web service provides several methods for dealing with
SharePoint lists. I just needed to call the GetListItems() method and pass in the
list name and view name as parameters in order to get my data.
&lt;/p&gt;
&lt;p&gt;
This worked fine on my local machine, but when I migrated the solution to a staging
server, the SharePoint web service refused to send me the data. After a bit of finagling,
I realized the web service was happy to talk to my laptop, but it politely declined
the remote web server's request as I lacked the proper credentials. I even was running
the web solution with impersonation enabled because I wanted to pass along my Windows
credentials during the call from the web server to the remote SharePoint server. I
forgot that this is just simply not possible. 
&lt;/p&gt;
&lt;p&gt;
For security reasons, the web server does not hold on to my credentials &amp;quot;just
in case&amp;quot; I might want to use them later. In this scenario, I do need them - but
no dice. This particular list in SharePoint is locked down tight.
&lt;/p&gt;
&lt;p&gt;
I didn't have the proper credentials when my web service client fired off a request
to SharePoint. When I was running on my local machine, using Casinni, my credentials
were readily available. On a remote web server, the credentials vanish. This is called
a &amp;quot;Double Hop&amp;quot; problem - the hops are from the browser, to the web server,
to another remote web server. The second hop tanked. It was a silly mistake on my
part, but hopefully by writing this down now will help me remember sooner next time.
&lt;/p&gt;
&lt;p&gt;
The code below shows how I solve this problem by manufacturing a credential on-the-fly
and then fire off a request to SharePoint. There are multiple ways of solving this
problem; I just happened to chose this one.
&lt;/p&gt;
&lt;div style="padding-right: 0px; padding-left: 0px; background: #eee; padding-bottom: 20px; padding-top: 20px"&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; MySharePoint.Lists list = new ProjectBoard.MySharePoint.Lists();&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; list.Credentials = new System.Net.NetworkCredential(&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;Credential.Username&amp;quot;],&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;Credential.Password&amp;quot;],&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;Credential.Domain&amp;quot;]);&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; XmlNode listItemsNode = list.GetListItems(&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;LoremIpsum.Guid&amp;quot;], &lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; ConfigurationManager.AppSettings[&amp;quot;LoremIpsum.View.Guid&amp;quot;], &lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; null, null, &amp;quot;100&amp;quot;, null, null);&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; XmlNode dataNode = listItemsNode.ChildNodes[1];&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; foreach (XmlNode rowNode in dataNode.ChildNodes)&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; {&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; // extract values here&lt;/pre&gt;
&lt;pre&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
Now that I've got this little prototype functional, I can encrypt the credentials
in the web.config file by using &lt;a href="http://msdn2.microsoft.com/en-us/library/ms998280.aspx" target="_blank"&gt;DPAPI&lt;/a&gt;,
an encryption tool that makes it easy to protect sensitive information. Since I'm
creating new credentials here, I can avoid the Double Hop problem and get on with
my prototype.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=e723c2e5-fc82-48cf-b437-b9f34781df0e" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,e723c2e5-fc82-48cf-b437-b9f34781df0e.aspx</comments>
      <category>asp.net</category>
      <category>SharePoint</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=55c54bd4-fc54-4aab-b79a-f20c6dbfc3f4</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,55c54bd4-fc54-4aab-b79a-f20c6dbfc3f4.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,55c54bd4-fc54-4aab-b79a-f20c6dbfc3f4.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=55c54bd4-fc54-4aab-b79a-f20c6dbfc3f4</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'm working on a solution that requires a special type of chart to visualize results
from some elaborate number crunching algorithms. <a href="http://www.dundas.com/Gallery/Chart/NET/index.aspx?Img=Circular2" target="_blank">Dundas
Chart for .Net</a> has an implementation of the standard polar chart.
</p>
        <p align="center">
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Dundas Chart for .Net" src="http://www.andrewdothay.net/silverlight/theta/dundas-polar-chart.png" border="0" />
        </p>
        <p>
That's the closest "buy" option I could find and it might very well do the
job. I'm a big fan of using existing software when it can solve a significant portion
of the problem domain. When you find a good off-the-shelf option, they're often inexpensive
and supported (by someone other than me), two big wins right off the bat. The ultimate
solution has a few features that are difficult or impossible in the "buy"
option, however they might be deemed insignificant. So the "buy" option
might very well win out during the upcoming evaluation of my solution, but as part
of my due diligence I had to see what the "build" option could offer me. 
</p>
        <p>
          <a href="http://www.andrewdothay.net/silverlight/theta/interknowlogy.png" target="_blank">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Collective Molecular Environment" src="http://www.andrewdothay.net/silverlight/theta/interknowlogy-thumb.png" align="left" border="0" />
          </a>When
I first envisioned the solution, I had ideas of 3D modeling like the work described
by Tim Huckaby at InterKnowlogy <a href="http://www.interknowlogy.com/lab/Pages/Network.aspx" target="_blank">for
the Scripps Research Institute</a>. They built a cancer research application called
the Collective Molecular Environment.
</p>
        <p>
Researchers from around the world can review the same model, zoom in, rotate models
and insert annotations of their observations. The screenshot to the left shows one
of the sample molecule views that comes with the demo. Spinning the molecule around
with your mouse is pretty cool.
</p>
        <p>
It's written in C# using Windows Presentation Foundation. SharePoint tracks the collaboration
on the back end, but its invisible to the user. Researchers just launch the application
and start clicking on cells in 3D. 
</p>
        <p>
          <a href="http://www.interknowlogy.com/Downloads/Scripps/IKCME.zip">Download a demo</a> of
the WPF application and twirl cells around on your own computer. The thing that floors
me is that the proof of concept took only six weeks to build. WPF and SharePoint were
really put to good use here.
</p>
        <p>
          <a href="http://www.andrewdothay.net/silverlight/theta/musicplasma.png" target="_blank">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="MusicPlasma.com" src="http://www.andrewdothay.net/silverlight/theta/musicplasma-thumb.png" align="right" border="0" />
          </a>Independently,
Ben Waldron reminded me of <a href="http://www.musicplasma.com/" target="_blank">MusicPlasma.com</a>.
You enter a band name and it shows related music artists in a 2D model using Flash.
The mash-up pulls information from Amazon.com. When you click on another artist, the
map adjusts and they become the new "center of the universe". Its a cool
way of visualizing relational data.
</p>
        <p>
Then I thought about the specific challenges I would have to solve in order to build
the solution myself. I knew my data would have a central point and other points around
it at various distances. Related points would have a line connecting them —
not all points are related to each other. Each point would also display a short keyword
or phrase.
</p>
        <p>
So, to put it in mathematical terms, I had a center point at (0,0) that was surrounded
by multiple invisible circles. The solution had to plot an unknown number of points
on the appropriate circle. The size of each point could vary between 40 pixels and
4 pixels in size. The unique phrase beside each point could remain the same size.
Finally, related points need a line connecting them.
</p>
        <p>
I selected Silverlight for my proof-of-concept vehicle. Its a technology that can
extend a web page and draw shapes or play video, like Adobe Flash. I first heard of
this technology a while back at the <a href="http://visitmix.com/" target="_blank">MIX06
conference</a> in Vegas. Silverlight runs on Windows and Mac OS X today and they've
announced plans to support Linux so there's no worries about the supported platforms. 
</p>
        <p>
I use XAML or Extensible Application Markup Language to express how the Silverlight
component appears on the page. The XAML used in Silverlight is a subset of the XAML
used in WPF applications since Silverlight is browser based while WPF apps can take
advantage of the full Windows platform. Just like a new version of the Adobe Flash
player, you have to download and install the Silverlight component the first time.
Then any page on the Internet that uses Silverlight can take advantage of the plugin.
It takes less than 60 seconds on standard machine to download the 1MB file and install
it. Here's the button created with 100% XAML just by launching Visual Studio and clicking
File, New Project, Silverlight Project. With just pure XML, Silverlight can draw a
fancy glossy button. Pretty cool.
</p>
        <p align="center">
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Silverlight Sample" src="http://www.andrewdothay.net/silverlight/theta/silverlight-file-new.png" border="0" />
        </p>
        <p>
Now my problem was the math. How could I calculate the points on a circle? So I headed
straight to The Wife; a number crunching machine with more degrees than that Nick
Lachey's boy band.
</p>
        <p>
The Wife <strike>taught</strike> reminded me about some fundamental principles of
algebra and geometry. As she tells it, this is sophomore/junior level high school
stuff. First, I needed to calculate the central angle between two consecutive points.
We'll call that theta. As it turns out, it doesn't matter where the points are, providing
they lie on the same circle. For starters, I just wanted an even distribution, so
if "n" equals the number of points on the circle then (2pi)/n gives me theta.
</p>
        <p align="center">
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Calculating Theta" src="http://www.andrewdothay.net/silverlight/theta/theta.png" border="0" />
        </p>
        <p>
Next, I need to start calculating the exact (x,y) coordinates of the points on the
circle. The first point is easy, its just (r,0) where "r" is the radius
of the circle. 
</p>
        <p align="center">
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Calculating Points on a Circle" src="http://www.andrewdothay.net/silverlight/theta/point1.png" border="0" />
        </p>
        <p>
The second point is a little tougher as it gets into sine and cosine. These are just
names for ratios in a triangle. The mnemonic SOHCAHTOA helps you remember this on
quiz day. Let's look at a following right triangle. 
</p>
        <p align="center">
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Right Triangle" src="http://www.andrewdothay.net/silverlight/theta/right-triangle.png" border="0" />
        </p>
        <ul>
          <li>
Sine is calculated as "opposite over hypotenuse", or the "SOH"
part of the mnemonic 
</li>
          <li>
Cosine is calculated as "adjacent over hypotenuse", or the "CAH"
part of the mnemonic 
</li>
          <li>
Just for good measure, the tangent is "opposite over adjacent", the "TOA"
part 
</li>
        </ul>
        <p>
Now that I have all the ingredients, I can bake my pi. Ha! Ok, onto the task of plotting
the points. The second and subsequent (x,y) values of my points are calculated by
the following formulas.
</p>
        <ul>
          <li>
P<sub>0</sub> = (r,0) 
</li>
          <li>
P<sub>1</sub> = (r(cos(θ), r(sin(θ)) 
</li>
          <li>
P<sub>2</sub> = (r(cos(2θ), r(sin(2θ)) 
</li>
          <li>
P<sub>3</sub> = (r(cos(3θ), r(sin(3θ)) 
</li>
        </ul>
        <p>
For the "x" coordinate, I multiply the radius by the cosine of theta. The
cosine of theta is "b" divided by "c". For the "y" coordinate,
I multiply the radius by the sine of theta. The sine of theta is "a" divided
by "c". In case its not obvious,  the P<sub>2</sub> and subsequent
points need multiples of theta, so the formula has that minor adjustment.
</p>
        <p>
To apply this information, I created a simple XML file with some elements that define
the number of points to draw and some supporting information. I'll just focus on a
single circle or level for now. If I can make one, I can make more really fast.
</p>
        <p align="center">
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="XML Data Source" src="http://www.andrewdothay.net/silverlight/theta/xml-inverted-transparent.png" border="0" />
        </p>
        <p>
Next, I created a simple ASP.Net page that reads the XML file and outputs the necessary
XAML that will allow Silverlight to draw the chart. My C# code iterates over the list
of elements in the XML file can calculates the (X,Y) coordinates using the previous
formulas. Just to keep things simple, I linked all the points to the center for now.
Later on, it'll be easy enough to link other points together with lines as I have
already calculated all of the necessary (X,Y) values. You can download my solution
through the link at the bottom of the post.
</p>
        <p>
          <a href="http://www.andrewdothay.net/silverlight/theta/xaml-output.png" target="_blank">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="XAML Output" src="http://www.andrewdothay.net/silverlight/theta/xaml-output-thumb.png" align="right" border="0" />
          </a>This
XAML block produces the following output in Silverlight shown below. As you can see,
XAML is just a special XML syntax that is pretty easy to pick up. 
</p>
        <p>
To draw an ellipse shape, you add the &lt;ellipse /&gt; element. To draw a line on
the canvas, you add an &lt;line /&gt; element. Of course there is tooling available
to abstract these details away, but its important to have a fundamental understanding
of the work going on under the covers.
</p>
        <p>
Silverlight translates the XAML markup into pretty images as shown below.
</p>
        <p align="center">
          <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Silverlight Custom Chart" src="http://www.andrewdothay.net/silverlight/theta/result-inverted.png" border="0" />
        </p>
        <p>
If this "build" solution turns out to be a winner, we'll be able to apply
nice gradients to the images, add click() events to the bubbles so more information
is available through a pop-up and maybe even add the "wet floor" look the
feels so cliche these days. These are easy enough in Silverlight, so I didn't spend
anytime on the glossy extras just yet. 
</p>
        <p>
So, my entire exploration of the "build" option in Silverlight took about
two hours, including the time spent with The Wife — time well spent, indeed.
It'll be interesting to see how the evaluation of my solution options pan out. Can
you tell I love my job?
</p>
        <p align="center">
          <a href="http://www.andrewdothay.net/silverlight/theta/solution.zip">Download the
solution</a> described in this blog post.
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=55c54bd4-fc54-4aab-b79a-f20c6dbfc3f4" />
      </body>
      <title>How I Married Into Mathematics</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,55c54bd4-fc54-4aab-b79a-f20c6dbfc3f4.aspx</guid>
      <link>http://www.a7drew.com/blog/2007/10/31/HowIMarriedIntoMathematics.aspx</link>
      <pubDate>Wed, 31 Oct 2007 05:58:19 GMT</pubDate>
      <description>&lt;p&gt;
I'm working on a solution that requires a special type of chart to visualize results
from some elaborate number crunching algorithms. &lt;a href="http://www.dundas.com/Gallery/Chart/NET/index.aspx?Img=Circular2" target="_blank"&gt;Dundas
Chart for .Net&lt;/a&gt; has an implementation of the standard polar chart.
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Dundas Chart for .Net" src="http://www.andrewdothay.net/silverlight/theta/dundas-polar-chart.png" border="0" /&gt;
&lt;/p&gt;
&lt;p&gt;
That's the closest &amp;quot;buy&amp;quot; option I could find and it might very well do the
job. I'm a big fan of using existing software when it can solve a significant portion
of the problem domain. When you find a good off-the-shelf option, they're often inexpensive
and supported (by someone other than me), two big wins right off the bat. The ultimate
solution has a few features that are difficult or impossible in the &amp;quot;buy&amp;quot;
option, however they might be deemed insignificant. So the &amp;quot;buy&amp;quot; option
might very well win out during the upcoming evaluation of my solution, but as part
of my due diligence I had to see what the &amp;quot;build&amp;quot; option could offer me. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.andrewdothay.net/silverlight/theta/interknowlogy.png" target="_blank"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Collective Molecular Environment" src="http://www.andrewdothay.net/silverlight/theta/interknowlogy-thumb.png" align="left" border="0" /&gt;&lt;/a&gt;When
I first envisioned the solution, I had ideas of 3D modeling like the work described
by Tim Huckaby at InterKnowlogy &lt;a href="http://www.interknowlogy.com/lab/Pages/Network.aspx" target="_blank"&gt;for
the Scripps Research Institute&lt;/a&gt;. They built a cancer research application called
the Collective Molecular Environment.
&lt;/p&gt;
&lt;p&gt;
Researchers from around the world can review the same model, zoom in, rotate models
and insert annotations of their observations. The screenshot to the left shows one
of the sample molecule views that comes with the demo. Spinning the molecule around
with your mouse is pretty cool.
&lt;/p&gt;
&lt;p&gt;
It's written in C# using Windows Presentation Foundation. SharePoint tracks the collaboration
on the back end, but its invisible to the user. Researchers just launch the application
and start clicking on cells in 3D. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.interknowlogy.com/Downloads/Scripps/IKCME.zip"&gt;Download a demo&lt;/a&gt; of
the WPF application and twirl cells around on your own computer. The thing that floors
me is that the proof of concept took only six weeks to build. WPF and SharePoint were
really put to good use here.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.andrewdothay.net/silverlight/theta/musicplasma.png" target="_blank"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="MusicPlasma.com" src="http://www.andrewdothay.net/silverlight/theta/musicplasma-thumb.png" align="right" border="0" /&gt;&lt;/a&gt;Independently,
Ben Waldron reminded me of &lt;a href="http://www.musicplasma.com/" target="_blank"&gt;MusicPlasma.com&lt;/a&gt;.
You enter a band name and it shows related music artists in a 2D model using Flash.
The mash-up pulls information from Amazon.com. When you click on another artist, the
map adjusts and they become the new &amp;quot;center of the universe&amp;quot;. Its a cool
way of visualizing relational data.
&lt;/p&gt;
&lt;p&gt;
Then I thought about the specific challenges I would have to solve in order to build
the solution myself. I knew my data would have a central point and other points around
it at various distances. Related points would have a line connecting them &amp;#x2014;
not all points are related to each other. Each point would also display a short keyword
or phrase.
&lt;/p&gt;
&lt;p&gt;
So, to put it in mathematical terms, I had a center point at (0,0) that was surrounded
by multiple invisible circles. The solution had to plot an unknown number of points
on the appropriate circle. The size of each point could vary between 40 pixels and
4 pixels in size. The unique phrase beside each point could remain the same size.
Finally, related points need a line connecting them.
&lt;/p&gt;
&lt;p&gt;
I selected Silverlight for my proof-of-concept vehicle. Its a technology that can
extend a web page and draw shapes or play video, like Adobe Flash. I first heard of
this technology a while back at the &lt;a href="http://visitmix.com/" target="_blank"&gt;MIX06
conference&lt;/a&gt; in Vegas. Silverlight runs on Windows and Mac OS X today and they've
announced plans to support Linux so there's no worries about the supported platforms. 
&lt;/p&gt;
&lt;p&gt;
I use XAML or Extensible Application Markup Language to express how the Silverlight
component appears on the page. The XAML used in Silverlight is a subset of the XAML
used in WPF applications since Silverlight is browser based while WPF apps can take
advantage of the full Windows platform. Just like a new version of the Adobe Flash
player, you have to download and install the Silverlight component the first time.
Then any page on the Internet that uses Silverlight can take advantage of the plugin.
It takes less than 60 seconds on standard machine to download the 1MB file and install
it. Here's the button created with 100% XAML just by launching Visual Studio and clicking
File, New Project, Silverlight Project. With just pure XML, Silverlight can draw a
fancy glossy button. Pretty cool.
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Silverlight Sample" src="http://www.andrewdothay.net/silverlight/theta/silverlight-file-new.png" border="0" /&gt;
&lt;/p&gt;
&lt;p&gt;
Now my problem was the math. How could I calculate the points on a circle? So I headed
straight to The Wife; a number crunching machine with more degrees than that Nick
Lachey's boy band.
&lt;/p&gt;
&lt;p&gt;
The Wife &lt;strike&gt;taught&lt;/strike&gt; reminded me about some fundamental principles of
algebra and geometry. As she tells it, this is sophomore/junior level high school
stuff. First, I needed to calculate the central angle between two consecutive points.
We'll call that theta. As it turns out, it doesn't matter where the points are, providing
they lie on the same circle. For starters, I just wanted an even distribution, so
if &amp;quot;n&amp;quot; equals the number of points on the circle then (2pi)/n gives me theta.
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Calculating Theta" src="http://www.andrewdothay.net/silverlight/theta/theta.png" border="0" /&gt;
&lt;/p&gt;
&lt;p&gt;
Next, I need to start calculating the exact (x,y) coordinates of the points on the
circle. The first point is easy, its just (r,0) where &amp;quot;r&amp;quot; is the radius
of the circle. 
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Calculating Points on a Circle" src="http://www.andrewdothay.net/silverlight/theta/point1.png" border="0" /&gt;
&lt;/p&gt;
&lt;p&gt;
The second point is a little tougher as it gets into sine and cosine. These are just
names for ratios in a triangle. The mnemonic SOHCAHTOA helps you remember this on
quiz day. Let's look at a following right triangle. 
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Right Triangle" src="http://www.andrewdothay.net/silverlight/theta/right-triangle.png" border="0" /&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Sine is calculated as &amp;quot;opposite over hypotenuse&amp;quot;, or the &amp;quot;SOH&amp;quot;
part of the mnemonic 
&lt;/li&gt;
&lt;li&gt;
Cosine is calculated as &amp;quot;adjacent over hypotenuse&amp;quot;, or the &amp;quot;CAH&amp;quot;
part of the mnemonic 
&lt;/li&gt;
&lt;li&gt;
Just for good measure, the tangent is &amp;quot;opposite over adjacent&amp;quot;, the &amp;quot;TOA&amp;quot;
part 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Now that I have all the ingredients, I can bake my pi. Ha! Ok, onto the task of plotting
the points. The second and subsequent (x,y) values of my points are calculated by
the following formulas.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
P&lt;sub&gt;0&lt;/sub&gt; = (r,0) 
&lt;/li&gt;
&lt;li&gt;
P&lt;sub&gt;1&lt;/sub&gt; = (r(cos(&amp;#x3B8;), r(sin(&amp;#x3B8;)) 
&lt;/li&gt;
&lt;li&gt;
P&lt;sub&gt;2&lt;/sub&gt; = (r(cos(2&amp;#x3B8;), r(sin(2&amp;#x3B8;)) 
&lt;/li&gt;
&lt;li&gt;
P&lt;sub&gt;3&lt;/sub&gt; = (r(cos(3&amp;#x3B8;), r(sin(3&amp;#x3B8;)) 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
For the &amp;quot;x&amp;quot; coordinate, I multiply the radius by the cosine of theta. The
cosine of theta is &amp;quot;b&amp;quot; divided by &amp;quot;c&amp;quot;. For the &amp;quot;y&amp;quot; coordinate,
I multiply the radius by the sine of theta. The sine of theta is &amp;quot;a&amp;quot; divided
by &amp;quot;c&amp;quot;. In case its not obvious,&amp;#xA0; the P&lt;sub&gt;2&lt;/sub&gt; and subsequent
points need multiples of theta, so the formula has that minor adjustment.
&lt;/p&gt;
&lt;p&gt;
To apply this information, I created a simple XML file with some elements that define
the number of points to draw and some supporting information. I'll just focus on a
single circle or level for now. If I can make one, I can make more really fast.
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="XML Data Source" src="http://www.andrewdothay.net/silverlight/theta/xml-inverted-transparent.png" border="0" /&gt;
&lt;/p&gt;
&lt;p&gt;
Next, I created a simple ASP.Net page that reads the XML file and outputs the necessary
XAML that will allow Silverlight to draw the chart. My C# code iterates over the list
of elements in the XML file can calculates the (X,Y) coordinates using the previous
formulas. Just to keep things simple, I linked all the points to the center for now.
Later on, it'll be easy enough to link other points together with lines as I have
already calculated all of the necessary (X,Y) values. You can download my solution
through the link at the bottom of the post.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.andrewdothay.net/silverlight/theta/xaml-output.png" target="_blank"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="XAML Output" src="http://www.andrewdothay.net/silverlight/theta/xaml-output-thumb.png" align="right" border="0" /&gt;&lt;/a&gt;This
XAML block produces the following output in Silverlight shown below. As you can see,
XAML is just a special XML syntax that is pretty easy to pick up. 
&lt;/p&gt;
&lt;p&gt;
To draw an ellipse shape, you add the &amp;lt;ellipse /&amp;gt; element. To draw a line on
the canvas, you add an &amp;lt;line /&amp;gt; element. Of course there is tooling available
to abstract these details away, but its important to have a fundamental understanding
of the work going on under the covers.
&lt;/p&gt;
&lt;p&gt;
Silverlight translates the XAML markup into pretty images as shown below.
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="Silverlight Custom Chart" src="http://www.andrewdothay.net/silverlight/theta/result-inverted.png" border="0" /&gt;
&lt;/p&gt;
&lt;p&gt;
If this &amp;quot;build&amp;quot; solution turns out to be a winner, we'll be able to apply
nice gradients to the images, add click() events to the bubbles so more information
is available through a pop-up and maybe even add the &amp;quot;wet floor&amp;quot; look the
feels so cliche these days. These are easy enough in Silverlight, so I didn't spend
anytime on the glossy extras just yet. 
&lt;/p&gt;
&lt;p&gt;
So, my entire exploration of the &amp;quot;build&amp;quot; option in Silverlight took about
two hours, including the time spent with The Wife &amp;#x2014; time well spent, indeed.
It'll be interesting to see how the evaluation of my solution options pan out. Can
you tell I love my job?
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;a href="http://www.andrewdothay.net/silverlight/theta/solution.zip"&gt;Download the
solution&lt;/a&gt; described in this blog post.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=55c54bd4-fc54-4aab-b79a-f20c6dbfc3f4" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,55c54bd4-fc54-4aab-b79a-f20c6dbfc3f4.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=9e7c492f-945a-409a-b6f3-85364ad81149</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,9e7c492f-945a-409a-b6f3-85364ad81149.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,9e7c492f-945a-409a-b6f3-85364ad81149.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=9e7c492f-945a-409a-b6f3-85364ad81149</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
There are tons of blog entries <a href="http://wpfwonderland.wordpress.com/2007/01/21/wpfe-fix-missing-intellisense-in-visual-studio/" target="_blank">like
this one explaining how to get intellisense</a> for WPF/e using the February 2007
CTP. The SDK for that release has a file named wpfe.xsd and you drop it into your
VS.Net schema folder here:
</p>
        <p>
          <code>C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas</code>
        </p>
        <p>
I'm using the Silverlight 1.1 alpha bits, and the 1.1 SDK doesn't have a file named
wpfe.xsd, so I was baffled for a minute. The Silverlight 1.1 SDK is laid out quite
differently and comes in a handy zip file instead of a chunky MSI file like its predecessor.
</p>
        <p>
Perhaps its just too early on a Sunday morning, but it took me a few minutes to realize
that (A) the 1.1 SDK does have a file named Silverlight.xsd and (2) dropping
Silverlight.xsd into my VS.Net schema folder does the trick. I'm going back to bed.
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=9e7c492f-945a-409a-b6f3-85364ad81149" />
      </body>
      <title>Intellisense for XAML using Silverlight in Visual Studio.Net</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,9e7c492f-945a-409a-b6f3-85364ad81149.aspx</guid>
      <link>http://www.a7drew.com/blog/2007/05/06/IntellisenseForXAMLUsingSilverlightInVisualStudioNet.aspx</link>
      <pubDate>Sun, 06 May 2007 16:38:50 GMT</pubDate>
      <description>&lt;p&gt;
There are tons of blog entries &lt;a href="http://wpfwonderland.wordpress.com/2007/01/21/wpfe-fix-missing-intellisense-in-visual-studio/" target="_blank"&gt;like
this one explaining how to get intellisense&lt;/a&gt; for WPF/e using the February 2007
CTP. The SDK for that release has a file named wpfe.xsd and you drop it into your
VS.Net schema folder here:
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
I'm using the Silverlight 1.1 alpha bits, and the 1.1 SDK doesn't have a file named
wpfe.xsd, so I was baffled for a minute. The Silverlight 1.1 SDK is laid out quite
differently and comes in a handy zip file instead of a chunky MSI file like its predecessor.
&lt;/p&gt;
&lt;p&gt;
Perhaps its just too early on a Sunday morning, but it took me a few minutes to realize
that (A) the 1.1 SDK&amp;nbsp;does have&amp;nbsp;a file named Silverlight.xsd and (2) dropping
Silverlight.xsd into my VS.Net schema folder does the trick. I'm going back to bed.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=9e7c492f-945a-409a-b6f3-85364ad81149" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,9e7c492f-945a-409a-b6f3-85364ad81149.aspx</comments>
      <category>Silverlight</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=da3b6958-7686-457e-a5a8-e260ca9ccd7c</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,da3b6958-7686-457e-a5a8-e260ca9ccd7c.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,da3b6958-7686-457e-a5a8-e260ca9ccd7c.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=da3b6958-7686-457e-a5a8-e260ca9ccd7c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Yep. I had a feeling. My buddy, <a href="http://whitepdx.com/blogs/kelly/default.aspx" target="_blank">Kelly</a>,
just called fro MIX07 where they just announced the 1.0 beta and the 1.1 alpha of <a href="http://www.microsoft.com/silverlight/downloads.aspx" target="_blank">Silverlight</a> today. 
</p>
        <p>
The 1.1 alpha has the sweet C# code inside it. I can't wait to get started. It also
has ominous "for developers only" text next to the download link. Who else would come
to this page?
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=da3b6958-7686-457e-a5a8-e260ca9ccd7c" />
      </body>
      <title>Silverlight 1.0 Beta and 1.1 Alpha</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,da3b6958-7686-457e-a5a8-e260ca9ccd7c.aspx</guid>
      <link>http://www.a7drew.com/blog/2007/04/30/Silverlight10BetaAnd11Alpha.aspx</link>
      <pubDate>Mon, 30 Apr 2007 20:58:31 GMT</pubDate>
      <description>&lt;p&gt;
Yep. I had a feeling. My buddy, &lt;a href="http://whitepdx.com/blogs/kelly/default.aspx" target="_blank"&gt;Kelly&lt;/a&gt;,
just called fro MIX07 where they just announced the 1.0 beta and the 1.1 alpha of &lt;a href="http://www.microsoft.com/silverlight/downloads.aspx" target="_blank"&gt;Silverlight&lt;/a&gt;&amp;nbsp;today. 
&lt;/p&gt;
&lt;p&gt;
The 1.1 alpha has the sweet C# code inside it. I can't wait to get started. It also
has ominous "for developers only" text next to the download link. Who else would come
to this page?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=da3b6958-7686-457e-a5a8-e260ca9ccd7c" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,da3b6958-7686-457e-a5a8-e260ca9ccd7c.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.a7drew.com/blog/Trackback.aspx?guid=4b8d7183-369e-41b9-b242-53f13d1e9b5e</trackback:ping>
      <pingback:server>http://www.a7drew.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.a7drew.com/blog/PermaLink,guid,4b8d7183-369e-41b9-b242-53f13d1e9b5e.aspx</pingback:target>
      <dc:creator>Andrew Hay</dc:creator>
      <wfw:comment>http://www.a7drew.com/blog/CommentView,guid,4b8d7183-369e-41b9-b242-53f13d1e9b5e.aspx</wfw:comment>
      <wfw:commentRss>http://www.a7drew.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=4b8d7183-369e-41b9-b242-53f13d1e9b5e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN: 0px 20px 10px 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="206" alt="Silverlight Samples In Action" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/SilverlightCramSession_134E2/sliverlight1%5B9%5D.png" width="219" align="left" border="0" /> For
no particular reason, I decided to make this weekend a <a href="http://www.microsoft.com/silverlight/" target="_blank">Silverlight</a> Cram
Session. Two of my fellow developers are on a plane (and perhaps have already started
the party) at <a href="http://www.visitmix.com/" target="_blank">MIX07</a>. 
</p>
        <p>
From everything that's been said in the prior two weeks, I expect some pretty sweet
announcments at MIX. My friend, <a href="http://www.morks.org/" target="_blank">Erik</a>,
is also getting ramped up on Silverlight. He presented at Innotech and is giving v2
at the <a href="http://pdx.techevents.info/codecamp/3/default.aspx" target="_blank">PDX
Code Camp</a>. 
</p>
        <p>
So, I downloaded the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c744cbb8-d4d9-4bf9-ad5c-eef36e064911&amp;displaylang=en" target="_blank">Feb
2007 Silverlight SDK</a> and the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=515684FD-C8A0-4588-88C5-54CE224925E7&amp;displaylang=en" target="_blank">Feb
2007 CTP Sample Pack</a>. For some odd reason, I feel that they are already obsolete.
However, they served their purpose quite well. The WPF/E Quickstart that comes with
the SDK rocks - you should just block out some time and go through it. The author
of this content did an spectacular job of explaining new technology in a way that
just worked. I can't recall anything that was more well written. Its just brilliant.
</p>
        <p>
I bit it off in 30 minute chunks and devoured the entire Quickstart samples on Saturday
afternoon. I started writing each example manually, and then by the middle, I
succumbed to the clip-board inheritence methodology.
</p>
        <p>
It's weird to think back to Friday when I had just a conceptual idea of what WPF and
Silverlight does from various podcasts on Channel9, Hanselminutes, DotNetRocks
and DNRTV. Now, after doing it for several hours, I get it. 
</p>
        <p>
Sweet.
</p>
        <p>
This is one of the biggest reasons to love my job; and boy, do I. Good stuff
like this gives you the will to come back for more, day after day, week after week.
</p>
        <p>
I'm still in a mode where NotePad2 or VS.Net 2005 is my best friend for XAML. Perhaps
I'll shed that kinship and move on to Expressions later. For now, I'll just bask in
the glory of learning something new and wondering how I can implement various types
of media experiences with lines, rectangles, elipsi (pural?), polygons, polylines,
and paths.
</p>
        <img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=4b8d7183-369e-41b9-b242-53f13d1e9b5e" />
      </body>
      <title>Silverlight Cram Session</title>
      <guid isPermaLink="false">http://www.a7drew.com/blog/PermaLink,guid,4b8d7183-369e-41b9-b242-53f13d1e9b5e.aspx</guid>
      <link>http://www.a7drew.com/blog/2007/04/30/SilverlightCramSession.aspx</link>
      <pubDate>Mon, 30 Apr 2007 04:58:24 GMT</pubDate>
      <description>&lt;p&gt;
&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN: 0px 20px 10px 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=206 alt="Silverlight Samples In Action" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/SilverlightCramSession_134E2/sliverlight1%5B9%5D.png" width=219 align=left border=0&gt; For
no particular reason,&amp;nbsp;I decided to make this weekend a &lt;a href="http://www.microsoft.com/silverlight/" target=_blank&gt;Silverlight&lt;/a&gt; Cram
Session. Two of my fellow developers are on a plane (and perhaps have already started
the party) at &lt;a href="http://www.visitmix.com/" target=_blank&gt;MIX07&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
From everything that's been said in the prior two weeks, I expect some pretty sweet
announcments at MIX. My friend, &lt;a href="http://www.morks.org/" target=_blank&gt;Erik&lt;/a&gt;,
is also getting ramped up on Silverlight. He presented at Innotech and is giving v2
at the &lt;a href="http://pdx.techevents.info/codecamp/3/default.aspx" target=_blank&gt;PDX
Code Camp&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
So, I downloaded the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c744cbb8-d4d9-4bf9-ad5c-eef36e064911&amp;amp;displaylang=en" target=_blank&gt;Feb
2007 Silverlight SDK&lt;/a&gt;&amp;nbsp;and the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=515684FD-C8A0-4588-88C5-54CE224925E7&amp;amp;displaylang=en" target=_blank&gt;Feb
2007 CTP Sample Pack&lt;/a&gt;. For some odd reason, I feel that they are already obsolete.
However, they served their purpose quite well. The WPF/E Quickstart that comes with
the SDK rocks - you should just block out some time and go through it. The author
of this content did an spectacular job of explaining new technology in a way that
just worked. I can't recall anything that was more well written. Its just brilliant.
&lt;/p&gt;
&lt;p&gt;
I bit it off in 30 minute chunks and devoured the entire Quickstart samples on Saturday
afternoon. I started writing each&amp;nbsp;example manually, and then by the middle, I
succumbed to the clip-board inheritence methodology.
&lt;/p&gt;
&lt;p&gt;
It's weird to think back to Friday when I had just a conceptual idea of what WPF and
Silverlight&amp;nbsp;does from various podcasts on Channel9, Hanselminutes, DotNetRocks
and DNRTV. Now, after doing it for several hours, I get it. 
&lt;/p&gt;
&lt;p&gt;
Sweet.
&lt;/p&gt;
&lt;p&gt;
This is one of the biggest reasons to&amp;nbsp;love my job; and boy, do I. Good stuff
like this gives you the will to come back for more, day after day, week after week.
&lt;/p&gt;
&lt;p&gt;
I'm still in a mode where NotePad2 or VS.Net 2005 is my best friend for XAML. Perhaps
I'll shed that kinship and move on to Expressions later. For now, I'll just bask in
the glory of learning something new and wondering how I can implement various types
of media experiences with lines, rectangles, elipsi (pural?),&amp;nbsp;polygons, polylines,
and paths.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.a7drew.com/blog/aggbug.ashx?id=4b8d7183-369e-41b9-b242-53f13d1e9b5e" /&gt;</description>
      <comments>http://www.a7drew.com/blog/CommentView,guid,4b8d7183-369e-41b9-b242-53f13d1e9b5e.aspx</comments>
      <category>learning</category>
      <category>Silverlight</category>
    </item>
  </channel>
</rss>