<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" 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/" version="2.0"><channel><title>Karsten Januszewski</title><description>IRhetoric: Convergence in the Simulacrum</description><link>http://www.rhizohm.net/</link><language>en-us</language><pubDate>Fri, 25 Jul 2008 09:32:49 GMT</pubDate><generator>Oxite</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/irhetoric" type="application/rss+xml" /><item><title>Silverlight Carousel and WPF Training Site Ported To Beta 2</title><description>&lt;p&gt;Both &lt;a href="http://silverlight.net/learn/learnvideo.aspx?video=33734"&gt;Yet Another Carousel (YAC)&lt;/a&gt; and the &lt;a href="http://www.visitmix.com/University/wpf/bc08/"&gt;WPF training site&lt;/a&gt; (which uses YAC) have been ported to Silverlight Beta 2.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/64/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/64/default.aspx</link><pubDate>Fri, 20 Jun 2008 21:11:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/64/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/64/trackback/default.aspx</trackback:ping><category>Silverlight 2</category></item><item><title>Twitter</title><description>&lt;p&gt;I recently removed the pull from Twitter on my blog. Because they have been down so much and because that widget is not AJAX-ified, it was causing my blog page to fail to load.&amp;#160; Interesting consequence of using services in the cloud and making me remember that everything has to be asynch and decoupled these days...&lt;/p&gt; &lt;a href="http://technorati.com/claim/pqj8ucc7au" rel="me"&gt;Technorati Profile&lt;/a&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/63/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/63/default.aspx</link><pubDate>Tue, 27 May 2008 21:03:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/63/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>2</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/63/trackback/default.aspx</trackback:ping></item><item><title>Portfolio as WPF and ASP.NET</title><description>&lt;p&gt;I recently wanted to put together a portfolio page of the various code and samples that I've worked on over the last few years.&amp;#160; To do so, I created a very simple xml file, which you can see &lt;a href="http://rhizohm.net/portfolio/archive.xml"&gt;here&lt;/a&gt;.&amp;#160; Then, I decided to create two different UI experiences to display the UI, one in ASP.NET and one as a WPF .XBAP.&amp;#160; I added &lt;a href="http://rhizohm.net/portfolio/portfoliochecker.htm"&gt;a page&lt;/a&gt; that uses javascript to detect if a user has .NET 3.0 and, if they do, I send them to the &lt;a href="http://rhizohm.net/portfolio/portfolioxbap.xbap"&gt;.XBAP&lt;/a&gt;.&amp;#160; If they don't, I send them to the &lt;a href="http://rhizohm.net/portfolio/portfolio.aspx"&gt;ASP.NET page&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Each implementation turned out to be pretty simple to create and have quite a few similarities. &lt;/p&gt;  &lt;p&gt;I like how both data models have something in place to handle nested hierarchies.&amp;#160; In ASP.NET, it is done by using a &lt;strong&gt;Repeater&lt;/strong&gt; inside a &lt;strong&gt;Repeater&lt;/strong&gt;, setting the DataSource with an XPathSelect.&amp;#160; In WPF, it is done by nesting an ItemsControl inside the DataTemplate, setting the &lt;strong&gt;ItemsSource&lt;/strong&gt; to the right XPath.&lt;/p&gt;  &lt;p&gt;I also had to handle the case where I didn't have a string value. For example, not all samples have videos, which in the XML looks like this: &amp;lt;VideoUri/&amp;gt;.&amp;#160; In ASP.NET, if I had an empty string,&amp;#160; the syntax I used to not display the URL was to put an expression in the Visible field:    &lt;br /&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre class="csharpcode"&gt;Visible='&lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;#XPath(&lt;span class="str"&gt;&amp;quot;VideoUri&amp;quot;&lt;/span&gt;) != &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;'&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;In WPF, I first thought that the built-in &lt;strong&gt;BooleanToVisibilityConverter &lt;/strong&gt;would do the trick, but because you can't do expressions in WPF databinding, I had to whip up a quick converter:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; EmptyStringToVisibilityConverter : IValueConverter
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; Convert(&lt;span class="kwrd"&gt;object&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;, Type targetType, &lt;span class="kwrd"&gt;object&lt;/span&gt; parameter, CultureInfo culture)
        {
            &lt;span class="kwrd"&gt;string&lt;/span&gt; strValue = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty((&lt;span class="kwrd"&gt;string&lt;/span&gt;)&lt;span class="kwrd"&gt;value&lt;/span&gt;))
                &lt;span class="kwrd"&gt;return&lt;/span&gt; Visibility.Collapsed;
            &lt;span class="kwrd"&gt;else&lt;/span&gt;
                &lt;span class="kwrd"&gt;return&lt;/span&gt; Visibility.Visible;

        }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; ConvertBack(&lt;span class="kwrd"&gt;object&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;, Type targetType, &lt;span class="kwrd"&gt;object&lt;/span&gt; parameter, CultureInfo culture)
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;;
        }
    }&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;And then in the XAML, I used the converter as such:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="csharpcode"&gt;Visibility=&lt;span class="str"&gt;&amp;quot;{Binding Mode=Default, XPath=VideoUri, Converter={StaticResource StringToVis}}&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Here's some little lessons learned and gotchas:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ASP.NET: When using the asp:HyperLink tag in conjunction with the #XPath syntax, I had to use single quotes (') instead of double quotes (&amp;quot;) to make the parser happy.&lt;/li&gt;

  &lt;li&gt;WPF: Remember to wrap your ItemsControl in a ScrollViewer, since scrolling doesn't come for free with &lt;strong&gt;ItemsControl&lt;/strong&gt;.&lt;/li&gt;

  &lt;li&gt;WPF: I used the &lt;a href="http://www.blagoev.com/Blog/post/Building-a-WPF-LinkLabel-control.aspx"&gt;LinkLabel&lt;/a&gt; control by &lt;a href="http://www.blagoev.com/Blog/"&gt;Lubo Blagoev&lt;/a&gt; which was quite nifty.&amp;#160; &lt;/li&gt;

  &lt;li&gt;WPF: To download the XML from the server to the XBAP, I used the pack://siteoforigin:,,,/ syntax.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, recursively, I've added the code for my portfolio to &lt;a href="http://rhizohm.net/portfolio/portfoliochecker.htm"&gt;my portfolio&lt;/a&gt;, which is where you can get the code. The next thing I want to do is add a tag cloud to the application, probably using LINQ. I also want to make the WPF page more interesting to show what you can do above and beyond just displaying the information.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/62/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/62/default.aspx</link><pubDate>Wed, 21 May 2008 19:41:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/62/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>3</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/62/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Archiving My Text Messages: Windows Mobile 5.0 Development</title><description>&lt;p&gt;I have a Windows Mobile 5.0 cellphone and realized recently that all my text messages were locked up on the phone -- ActiveSync doesn't sync them.&amp;#160; There's probably applications out there that will archive your text messages, but being a dev, I figured I'd do it myself.&amp;#160; Unfortunately, the .NET libraries don't support querying the SMS message store directly, so I ended up using a third party library, &lt;a href="http://inthehand.com" target="_blank"&gt;In The Hand&lt;/a&gt;, which worked out quite nicely.&amp;#160; The code was pretty darned simple; it took me a lot longer to realize that I needed &lt;a href="https://blogs.msdn.com/sivarv/archive/2005/09/20/471863.aspx" target="_blank"&gt;to install the SDK certs&lt;/a&gt; onto my phone in order to deploy an application to the phone. I ended up also having to run the rapiconfig tool: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Tools&amp;gt;rapiconfig /p SdkCerts.xml&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This made everything happy (tip of the hat to &lt;a href="http://blogs.conchango.com/stuartpreston/archive/2005/11/10/2376.aspx" target="_blank"&gt;Stuart Preston&lt;/a&gt;).&amp;#160; But once I was able to talk to the phone, application development was quick.&amp;#160; I just walk the different folders and built an XML file out of them. I figure I can work with the XML at some point if I want to do some visualization of my text history. &lt;a href="http://www.rhizohm.net/download/program.txt" target="_blank"&gt;Here's the code&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Now, I want to write a threaded text app.&amp;#160; I know this is in Windows Mobile 6.1, but it would be handy to have on Windows Mobile 5.0.&amp;#160; There's a few apps already out there that do this, but why buy it when you can build it? &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/61/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/61/default.aspx</link><pubDate>Mon, 12 May 2008 22:53:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/61/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/61/trackback/default.aspx</trackback:ping></item><item><title>Interview With Effective UI</title><description>&lt;p&gt;&lt;a href="http://www.effectiveui.com/"&gt;Effective UI&lt;/a&gt; has put together a site called the &lt;a href="http://www.uiresourcecenter.com"&gt;User Interface Resource Center&lt;/a&gt;.&amp;#160; They were kind enough to interview me about WPF, Silverlight, Expression and more.&amp;#160; As they put it:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;In the 2008 whitepaper &amp;#8220;The New Iteration,&amp;#8221; Karsten Januszewski teams up with Jaime Rodriguez to spotlight what Microsoft has dubbed the XAML revolution. Based on interviews with early Windows Presentation (WPF) and Silverlight users, Januszewski drills into emerging Microsoft technologies and explores how the designer/developer collaborative process is undergoing change. But, what's the bigger picture? Why is Microsoft investing so heavily in UI Technologies? What are the business benefits that will drive adoption in a field traditionally dominated by rivals? These questions and others are answered here. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can read &lt;a href="http://www.uiresourcecenter.com/ui-technologies/microsoft-silverlight/articles.html?s=3_3_1"&gt;the full article here&lt;/a&gt; or &lt;a href="http://www.uiresourcecenter.com/ui-technologies/microsoft-silverlight/articles/karsten_interview_edit-1.mp3"&gt;download the interview&lt;/a&gt;.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/60/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/60/default.aspx</link><pubDate>Tue, 06 May 2008 16:16:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/60/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/60/trackback/default.aspx</trackback:ping><category>Silverlight</category><category>Silverlight 2</category><category>WPF</category></item><item><title>Transitionals</title><description>&lt;p&gt;It was almost a year ago that the transition controls were quietly released for WPF, which &lt;a href="http://blogs.msdn.com/karstenj/archive/2007/05/08/transition-and-reveal-new-custom-controls-for-wpf-updated-avalon-feature-fest.aspx" target="_blank"&gt;I blogged about and included in the WPF Feature Fest&lt;/a&gt; (&lt;a href="http://wpf.netfx3.com/files/folders/code_snippets/entry3752.aspx" target="_blank"&gt;source&lt;/a&gt; and &lt;a href="http://wpf.netfx3.com/direct/avalonfeaturefest/publish.htm" target="_blank"&gt;deployed app&lt;/a&gt;):&lt;/p&gt;  &lt;p&gt;&lt;img height="222" src="http://winfx.members.winisp.net/images/limecat1.jpg" width="205" /&gt; &lt;img height="222" src="http://winfx.members.winisp.net/images/limecat2.jpg" width="205" /&gt; &lt;/p&gt;  &lt;p&gt;The guts of this project is now available as &lt;a href="http://www.codeplex.com/transitionals" target="_blank"&gt;Transitionals on Codeplex&lt;/a&gt;.&amp;#160; A lot of the code has been refactored quite nicely. What's really great about this release is the accompanying documentation, which is incredibly thorough.&amp;#160; &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/59/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/59/default.aspx</link><pubDate>Tue, 29 Apr 2008 20:13:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/59/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/59/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Bruce Sterling on Interaction Design</title><description>&lt;p&gt;Just came across this video on &lt;a href="http://www.adaptivepath.com/blog/2008/04/23/ux-week-2008-new-speakers-including-bruce-sterling/"&gt;Adaptive Path's blog&lt;/a&gt; of Bruce Sterling talking about Interaction Design:&lt;/p&gt;  &lt;p&gt;&lt;object type="application/x-shockwave-flash" height="302" width="400" data="http://www.vimeo.com/moogaloop.swf?clip_id=769193&amp;amp;server=www.vimeo.com&amp;amp;fullscreen=1&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color="&gt;&lt;/object&gt;    &lt;br /&gt;&lt;a href="http://www.vimeo.com/769193/l:embed_769193"&gt;Bruce Sterling&lt;/a&gt; from &lt;a href="http://www.vimeo.com/user378630/l:embed_769193"&gt;Innovationsforum&lt;/a&gt; on &lt;a href="http://vimeo.com/l:embed_769193"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Missed him at SxSW this year, but this video gave me my fix.&amp;#160; He's really clear on what &lt;a href="http://www.openspime.com/"&gt;spimes&lt;/a&gt; are right at the beginning.&amp;#160; He has to do this to establish his&amp;#160; overall theme, which is to think about interaction design not in literary terms -- &amp;quot;sense of wonder,&amp;quot; etc. -- but just &amp;quot;don't make me think&amp;quot; and &amp;quot;reduce my cognitive load.&amp;quot;&amp;#160; He's dead on right here.&amp;#160;&amp;#160; And some interesting commentary on Google and Microsoft at about 22:00.&amp;#160; Microsoft as &amp;quot;vehicle&amp;quot; compared to Google as &amp;quot;techno-social.&amp;quot;&amp;#160; And a funny comment about Flickr at about 32:00. His quote from Tony Dunn: &amp;quot;My default mental model of a user is a tortured, existential soul drifting through complex technologically mediated consumer landscape.&amp;quot;&amp;#160;&amp;#160; Nice. And a quote from Bruce: &amp;quot;The net and its adjuncts are becoming a hybrid meta medium that links everyone...the former hierarchies of the creative disciplines are coming violently apart, right in front of our eyes.&amp;#160; Yet at the same historic moment, profoundly powerful networks are assembling.&amp;quot;&amp;#160; Sterling is an elder for this era.&amp;#160; &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/58/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/58/default.aspx</link><pubDate>Fri, 25 Apr 2008 20:17:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/58/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/58/trackback/default.aspx</trackback:ping><category>Rhizohm</category><category>Web 2.0</category></item><item><title>Using Flotzam At A Conference</title><description>&lt;p&gt;Here is a guide for using Flotzam at a conference:&lt;/p&gt;  &lt;p&gt;Flotzam at a conference is fun. It gives the audience the ability to immediately participate in the event as well as on the blogosphere. Their photos, twitters, etc, show up on the big screen.&lt;/p&gt;  &lt;p&gt;If you would like to see Flotzam in action, you can (1) install the application from &lt;a href="http://www.flotzam.com"&gt;http://www.flotzam.com&lt;/a&gt; or (2) watch a video about the application at &lt;a href="http://flotzam.com/video.htm"&gt;http://flotzam.com/video.htm&lt;/a&gt;. You can also watch a video that discusses the Mix Flotzam Restyle contest and the winners here: &lt;a href="http://visitmix.com/blogs/News/Flotzam-Design-Contest-Winner/"&gt;http://visitmix.com/blogs/News/Flotzam-Design-Contest-Winner/&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;If you aren&amp;#8217;t familiar with these social networks used by Flotzam, here&amp;#8217;s a brief intro of what they are and why they are interesting.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Twitter allows you to text messages from your phone to the Twitter service, which then get posted on the web. So, by displaying Twitters from conference attendees, you can see almost real time information about what people are saying about the conference.&lt;/li&gt;    &lt;li&gt;Flickr and Facebook integration is about allowing attendees to upload their photos of the event to their service and then Flotzam will pull and display their photos.&lt;/li&gt;    &lt;li&gt;Digg is service that allows the community to post interesting stories and then vote on their relevance.&lt;/li&gt;    &lt;li&gt;RSS is a syndication format supported widely &amp;#8211; you can display any RSS feed through Flotzam.&lt;/li&gt;    &lt;li&gt;YouTube is a site that allows people to upload video.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The end result is that Flotzam aggregates all these networks and does a fun visualization.&lt;/p&gt;  &lt;p&gt;A few things to note: &lt;/p&gt;  &lt;p&gt;&amp;#183; If there is another social network you want to add to Flotzam, it requires more code to be written. There&amp;#8217;s an explanation of how to do it here: &lt;a href="http://flotzam.com/blog/post/How-To-Add-A-New-Datasource-To-Flotzam.aspx"&gt;http://flotzam.com/blog/post/How-To-Add-A-New-Datasource-To-Flotzam.aspx&lt;/a&gt;. An easier route to getting different data into Flotzam is if that social network supports RSS.&lt;/p&gt;  &lt;p&gt;&amp;#183; Because Flotzam pulls data real time, there is the chance that inappropriate content could appear on the screen.&lt;/p&gt;  &lt;p&gt;&lt;ins cite="mailto:Karsten%20Januszewski" datetime="2008-04-15T16:34"&gt;&lt;/ins&gt;&lt;/p&gt;  &lt;p&gt;If you would like to use Flotzam for your conference, you need to do the following:&lt;/p&gt;  &lt;p&gt;1. Download the .exe build of Flotzam here:&amp;#160; &lt;a href="http://www.flotzam.com/download/flotzam.zip"&gt;http://www.flotzam.com/download/flotzam.zip&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;2. You should have a machine with w/2GB RAM and a video card of 256MB. Be sure to test on your hardware to catch any issues in advance.&lt;/p&gt;  &lt;p&gt;3. The machine &lt;i&gt;must&lt;/i&gt; have network access. Flotzam does not do well with intermittent connectivity; if you can&amp;#8217;t guarantee a stable connection to the internet, &lt;i&gt;don&amp;#8217;t use Flotzam&lt;/i&gt;.&lt;/p&gt;  &lt;p&gt;4. Determine what feeds you want Flotzam to display. &lt;/p&gt;  &lt;p&gt;Note that you will need to somehow communicate to the attendees how to access the services you set up. Another option is to not let attendees know about the tags and simply have your conference folks twitter and upload photos.    &lt;br /&gt;    &lt;br /&gt;Here are the steps to configuring Flotzam:&lt;/p&gt;  &lt;p&gt;1. All settings can be changed by clicking SETTINGS AND OPTIONS in the upper left corner.&lt;/p&gt;  &lt;p&gt;2. For example, if you want everyone who is at the event have their Twitters appear, you can create a Twitter account such as &lt;b&gt;myconference&lt;/b&gt;, let people know about it, and then specify for Flotzam to &amp;#8220;Watch My Followers&amp;#8221; in the Twitter settings panel, providing the username and password for the &lt;b&gt;myconference&lt;/b&gt; twitter account.&lt;/p&gt;  &lt;p&gt;3. If you set up a Facebook event for your conference, you can enter the Event ID in the Facebook settings panel. The Event ID found in the URL when on the Facebook event itself, so if the URL for the event is &lt;a href="http://www.facebook.com/event.php?eid=2367953648"&gt;http://www.facebook.com/event.php?eid=2367953648&lt;/a&gt; the event id is 2367953648). You'll also have to provide you credentials to Facebook.&lt;/p&gt;  &lt;p&gt;4. If you want to add a different Flickr tag, you can modify the tag in the Flickr settings Panel. &lt;/p&gt;  &lt;p&gt;5. You can specify a DIGG setting and a YouTube tag.&lt;/p&gt;  &lt;p&gt;6. If you want to manage which RSS feeds show up, you need to do that management in Internet Explorer.&lt;/p&gt;  &lt;p&gt;7. Lastly, if you want to have different skins show up, you can check that box in the general settings tab.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;hr align="left" width="33%" size="1" /&gt;  &lt;p&gt;&lt;a name="_msocom_1"&gt;&lt;/a&gt;&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/57/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/57/default.aspx</link><pubDate>Fri, 18 Apr 2008 19:58:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/57/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/57/trackback/default.aspx</trackback:ping><category>Flotzam</category><category>Web 2.0</category><category>WPF</category></item><item><title>Updates to Flotzam</title><description>&lt;p&gt;I realized that the code base I used for &lt;a href="http://www.flotzam.com/"&gt;Flotzam&lt;/a&gt; for the MIX conference was not posted and there are a few interesting things that have been updated in the code that people may be interested in:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;For MIX, we displayed photos that were posted to the MIX event on Facebook.&amp;#160; How do you get all photos from an event from Facebook? Officially, there isn't an API for this.&amp;#160; Unofficially, it can be done through FQL by simply calling photos.get and passing the event id.&amp;#160; I extended the Facebook .NET wrapper and added a method called GetEventPhotos that does this. The reason this is interesting is if you want to use Flotzam at a conference and want to access the photos from a Facebook event. &lt;/li&gt;    &lt;li&gt;I also added a setting that allows you to choose whether to show photos from Facebook friends or show photos from an event or both. &lt;/li&gt;    &lt;li&gt;Another thing we did at MIX was to show all twitters from anyone following the event.&amp;#160; I didn't have this officially wired up in the settings, but now it is.&amp;#160; It is a little confusing: if you pick, &amp;quot;watch me and my friends&amp;quot; you are seeing the tweets of people you follow. But if you pick &amp;quot;watch my followers&amp;quot; you are getting the last tweet of anyone who is following you.&amp;#160; It is kind of goofy because the APIs return a different schema depending on which you pick, so the code has to do some casting between .NET types, since I serialize everything. &lt;/li&gt;    &lt;li&gt;I've also added a setting so you can either choose to have the skins randomly toggle or you can just stick with one skin. &lt;/li&gt;    &lt;li&gt;I've also gone ahead and uploaded the source code with the .PNG sequences done by &lt;a href="http://jmorrill.hjtcentral.com/"&gt;Jeremiah Morrill&lt;/a&gt;.&amp;#160; With all those images, the download is 50 mb.&amp;#160; As such, I've made one version of the project that doesn't have the .PNG sequences which is smaller. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://flotzam.com/download/sourcecode/source.zip"&gt;Download the code with PNG sequences&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://flotzam.com/download/sourcecode/sourcenopng.zip"&gt;Download the code without PNG sequences&lt;/a&gt;.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/56/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/56/default.aspx</link><pubDate>Tue, 15 Apr 2008 00:37:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/56/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/56/trackback/default.aspx</trackback:ping><category>Facebook</category><category>WPF</category></item><item><title>LOLCODE</title><description>&lt;p&gt;Was watching a &lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=392011" target="_blank"&gt;Channel 9 interview on the DLR&lt;/a&gt; and found out about &lt;a href="http://lolcode.com/" target="_blank"&gt;LOLCODE&lt;/a&gt;.&amp;#160; Too funny.&lt;/p&gt;  &lt;p&gt;&lt;img src="http://www.katurday.com/wp-content/uploads/katurdaycom_lolcode1.jpg" /&gt;&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/55/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/55/default.aspx</link><pubDate>Mon, 14 Apr 2008 20:56:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/55/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/55/trackback/default.aspx</trackback:ping></item><item><title>Using Silverlight Carousel For Video</title><description>&lt;p&gt;I recently used the &lt;a href="http://www.rhizohm.net/download/YetAnotherCarousel.zip" target="_blank"&gt;Silverlight 2 Carousel sample&lt;/a&gt; I wrote for the &lt;a href="http://www.visitmix.com/University/wpf/bc08/ " target="_blank"&gt;WPF Boot Camp application&lt;/a&gt; and encountered a gotcha that some others may hit. Each carousel contains multiple videos, between 5 - 10.&amp;#160; Initially, the source of the video was coming from an mms:// URI, streamed from a Windows server. All worked no problem.&amp;#160; But, the video quality was sub par and I had other videos that were better quality, but not streamed over mms://. I switched to the higher quality videos, which are buffered over http://.&amp;#160; When I did that, the carousel would only display two videos at a time and the other panels would not display any video, even with each of the videos set with auto-play to false. I realized the reason was that the browser itself was throttling the ability of the Silverlight application to begin buffering the videos.&amp;#160; It would only handle two at a time. &lt;/p&gt;  &lt;p&gt;The solution?&amp;#160; Rather than begin to buffer all the videos, I display screenshots of each video.&amp;#160; Then, when the user clicks play, I actually load and play the video. If you want the code I used to built the site, you can download it &lt;a href="http://www.rhizohm.net/download/wpfbootcamp.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I also fixed a bug in the carousel code where layout wasn't centering the carousel, which is in the latest build of the carousel.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/54/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/54/default.aspx</link><pubDate>Fri, 11 Apr 2008 22:25:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/54/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>3</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/54/trackback/default.aspx</trackback:ping><category>Silverlight 2</category></item><item><title>Tweaking The Default Styles For Silverlight 2 Controls</title><description>&lt;p&gt;In WPF, when styling a control, Blend has a very handy feature which allows you to get at the default style and template for any control, simply by right clicking the control and selecting &amp;quot;Edit Control Parts (Template)&amp;quot; and then selecting &amp;quot;Edit a Copy...&amp;quot;&amp;#160; These styles and control templates are great places to start when restyling controls.&lt;/p&gt;  &lt;p&gt;Unfortunately, Silverlight 2 doesn't have the corrallary in Blend (yet).&amp;#160; However, this is easy to get around once you get a hold of the &lt;a href="http://rhizohm.net/download/generic.zip" target="_blank"&gt;generic.xaml&lt;/a&gt; file for all the Silverlight controls. I went ahead and posted it, although there are two other places you can get an &amp;quot;official&amp;quot; copy. First is the source code for the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=EA93DD89-3AF2-4ACB-9CF4-BFE01B3F02D4&amp;amp;displaylang=en" target="_blank"&gt;Silverlight Controls&lt;/a&gt; themselves.&amp;#160; Second is by using &lt;a href="http://www.aisto.com/roeder/dotnet/" target="_blank"&gt;Reflector&lt;/a&gt;, loading C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Client\System.Windows.Controls.dll and looking at its resources in the disassembler. &lt;/p&gt;  &lt;p&gt;Once you have &lt;a href="http://rhizohm.net/download/generic.zip" target="_blank"&gt;generic.xaml&lt;/a&gt;, restyling controls by tweaking the existing styles is simple.&amp;#160; First, cut/paste the contents of generic.xaml (either all the styles or just the style of the control you want to restyle) into the resources of either app.xaml or one of your pages (depending on the scope you are seeking.) Second, give the style an &lt;strong&gt;x:Key&lt;/strong&gt; value so that you can reference it later. Finally, add that style attribute to your control in XAML: Style=&amp;quot;{StaticResource CustomButton}&amp;quot;.&amp;#160; That's it!&amp;#160; Now you can tweak the style of the button, even changing the storyboards that get fired as a result of different states. &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/53/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/53/default.aspx</link><pubDate>Tue, 01 Apr 2008 18:55:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/53/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>4</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/53/trackback/default.aspx</trackback:ping><category>Silverlight 2</category></item><item><title>What To Do When Breakpoints Disappear and Debugging Dies In Silverlight 2</title><description>&lt;p&gt;For some random reason, occasionally Silverlight 2 projects will suddenly no longer support debugging.&amp;#160; Very frustrating.&amp;#160; Fortunately, the fix is pretty simple:&lt;/p&gt;  &lt;p&gt;Right click on the Web in the Solution Explorer pane.&amp;#160; If you have a Web project, you will see &amp;quot;Property Pages&amp;quot;, if you have a Web Application project you will see &amp;quot;Properties&amp;quot;.&amp;#160; Select that.&lt;/p&gt;  &lt;p&gt;Under &amp;quot;Property Pages&amp;quot; select &amp;quot;Start Options&amp;quot; and make sure that both &amp;quot;Silverlight&amp;quot; and &amp;quot;ASP.NET&amp;quot; are checked, &amp;quot;Native Code&amp;quot; and &amp;quot;SQL Server&amp;quot; are unchecked.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;img src="http://www.rhizohm.net/images/dialog.png" /&gt;&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/52/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/52/default.aspx</link><pubDate>Tue, 01 Apr 2008 18:35:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/52/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/52/trackback/default.aspx</trackback:ping><category>Silverlight 2</category></item><item><title>Using A UserControl As A DataTemplate in Silverlight 2 and Blend 2</title><description>&lt;p&gt;Recently learned a nifty trick from &lt;a href="http://blois.us/blog" target="_blank"&gt;Pete Blois&lt;/a&gt; about how to use a UserControl as a DataTemplate in Silverlight 2.&amp;#160; This is real handy, because it allows for a more WPF-like workflow, allowing a designer to create data templates in Blend. With this workflow, the designer can go ahead and build out the data template as a UserControl. He/she may need some help from the developer to wire up the data fields -- in fact, the recommendation would be that the developer maybe create a dummy project with all the fields for the designer and then the designer can party on. (I modeled this technique here for WPF and &lt;a href="http://flotzam.com/blog/post/How-To-Remix-Flotzam-Screencast-Part-1-Reskinning-The-Templates.aspx" target="_blank"&gt;reskinning Flotzam&lt;/a&gt;.)&lt;/p&gt;  &lt;p&gt; So, here's a real simple data template from a user control:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;UserControl
    xmlns=&lt;span style="color: #006080"&gt;&amp;quot;http://schemas.microsoft.com/client/2007&amp;quot;&lt;/span&gt;
    xmlns:x=&lt;span style="color: #006080"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;
    xmlns:d=&lt;span style="color: #006080"&gt;&amp;quot;http://schemas.microsoft.com/expression/blend/2008&amp;quot;&lt;/span&gt;
    xmlns:mc=&lt;span style="color: #006080"&gt;&amp;quot;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;quot;&lt;/span&gt;
    mc:Ignorable=&lt;span style="color: #006080"&gt;&amp;quot;d&amp;quot;&lt;/span&gt;
    x:Class=&lt;span style="color: #006080"&gt;&amp;quot;SilverlightApplication1.DataView&amp;quot;&lt;/span&gt;
    d:DesignWidth=&lt;span style="color: #006080"&gt;&amp;quot;149&amp;quot;&lt;/span&gt; d:DesignHeight=&lt;span style="color: #006080"&gt;&amp;quot;36&amp;quot;&lt;/span&gt; Width=&lt;span style="color: #006080"&gt;&amp;quot;153&amp;quot;&lt;/span&gt; &amp;gt;

    &amp;lt;Grid x:Name=&lt;span style="color: #006080"&gt;&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt; Background=&lt;span style="color: #006080"&gt;&amp;quot;#FFFF0000&amp;quot;&lt;/span&gt; &amp;gt;
        &amp;lt;TextBlock HorizontalAlignment=&lt;span style="color: #006080"&gt;&amp;quot;Left&amp;quot;&lt;/span&gt; VerticalAlignment=&lt;span style="color: #006080"&gt;&amp;quot;Top&amp;quot;&lt;br /&gt;&lt;/span&gt;              Text=&lt;span style="color: #006080"&gt;&amp;quot;{Binding}&amp;quot;&lt;/span&gt; TextWrapping=&lt;span style="color: #006080"&gt;&amp;quot;Wrap&amp;quot;&lt;/span&gt;/&amp;gt;
    &amp;lt;/Grid&amp;gt;
&amp;lt;/UserControl&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Note the use of the {Binding} syntax, which will just default bind to the single property on my data class. You could of course name the property you are binding to in the more likely case that you had more properties in your class. &lt;/p&gt;

&lt;p&gt;Then, the xaml file that actually uses this as a data template looks like this:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;UserControl x:Class=&lt;span style="color: #006080"&gt;&amp;quot;SilverlightApplication1.Page&amp;quot;&lt;/span&gt;
    xmlns=&lt;span style="color: #006080"&gt;&amp;quot;http://schemas.microsoft.com/client/2007&amp;quot;&lt;/span&gt; 
    xmlns:x=&lt;span style="color: #006080"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt; 
    Width=&lt;span style="color: #006080"&gt;&amp;quot;400&amp;quot;&lt;/span&gt; Height=&lt;span style="color: #006080"&gt;&amp;quot;300&amp;quot;&lt;/span&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; xmlns:SilverlightApplication1=&lt;span style="color: #006080"&gt;&amp;quot;&lt;strong&gt;clr-namespace:SilverlightApplication1;assembly=SilverlightApplication1&lt;/strong&gt;&amp;quot;&lt;/span&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; xmlns:d=&lt;span style="color: #006080"&gt;&lt;a href="http://schemas.microsoft.com/expression/blend/2008"&gt;http://schemas.microsoft.com/expression/blend/2008&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; xmlns:mc=&lt;span style="color: #006080"&gt;&lt;a href="http://schemas.openxmlformats.org/markup-compatibility/2006"&gt;http://schemas.openxmlformats.org/markup-compatibility/2006&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; mc:Ignorable=&lt;span style="color: #006080"&gt;&amp;quot;d&amp;quot;&lt;/span&gt;&amp;gt;
    &amp;lt;UserControl.Resources&amp;gt;
        &amp;lt;SilverlightApplication1:DataSource x:Key=&lt;span style="color: #006080"&gt;&amp;quot;DataSourceDS&amp;quot;&lt;/span&gt; d:IsDataSource=&lt;span style="color: #006080"&gt;&amp;quot;True&amp;quot;&lt;/span&gt;/&amp;gt;
    &amp;lt;/UserControl.Resources&amp;gt; 
    &amp;lt;Grid x:Name=&lt;span style="color: #006080"&gt;&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt; Background=&lt;span style="color: #006080"&gt;&amp;quot;White&amp;quot;&lt;/span&gt;&amp;gt;
        &amp;lt;ListBox Margin=&lt;span style="color: #006080"&gt;&amp;quot;8,8,165,8&amp;quot;&lt;/span&gt; ItemsSource=&lt;span style="color: #006080"&gt;&amp;quot;{Binding Items, Mode=OneWay, &lt;br /&gt;            Source={StaticResource DataSourceDS}}&amp;quot;&lt;/span&gt;&amp;gt;
            &amp;lt;ListBox.ItemTemplate&amp;gt;
                &amp;lt;DataTemplate&amp;gt;
                    &amp;lt;Grid Background=&lt;span style="color: #006080"&gt;'Blue'&lt;/span&gt; HorizontalAlignment=&lt;span style="color: #006080"&gt;'Stretch'&lt;/span&gt;&amp;gt;
                        &amp;lt;SilverlightApplication1:DataView /&amp;gt;
                    &amp;lt;/Grid&amp;gt;
                &amp;lt;/DataTemplate&amp;gt;
            &amp;lt;/ListBox.ItemTemplate&amp;gt;
        &amp;lt;/ListBox&amp;gt;
    &amp;lt;/Grid&amp;gt;
&amp;lt;/UserControl&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Note that in the attribute where I register the namespace for the datasource, I explicitly refer to the assembly.&amp;#160; This is a gotcha when doing this; normally you don't need to refer to the assembly if it is in the same class, but in this case you do. &lt;/p&gt;

&lt;p&gt;And there you have it.&amp;#160; &lt;a href="http://rhizohm.net/download/silverlightapplication1.zip" target="_blank"&gt;Download the code&lt;/a&gt; here if you'd like.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/51/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/51/default.aspx</link><pubDate>Mon, 31 Mar 2008 23:00:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/51/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>2</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/51/trackback/default.aspx</trackback:ping><category>Silverlight 2</category></item><item><title>Reading a file from the server in Silverlight 2</title><description>&lt;p&gt;I recently was working on a Silverlight 2 project and needed to &amp;quot;phone home&amp;quot; from the .xap back to the server of origin to get a text file from the server. It wasn't completely obvious how to do this at first, so I figured I'd share the code I wrote if others need to do something similar. Note a couple things: &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;You'll need to add a reference to System.Net.dll and using statements for System.Net and System.IO.&lt;/li&gt;    &lt;li&gt;The ASP.NET WebDev server used for development will run the project on a random port. You can change this behavior so you have a consistent port number. Click on the project node in Solution Explorer and open the properties window (press F4). Change the &amp;#8220;Use dynamic ports&amp;#8221; property from True to False and edit the port number.&lt;/li&gt;    &lt;li&gt;If you try to go to a server other than the server of origin, you'll most likely run into cross site scripting issues.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre  style="width:500" &gt;    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;partial&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Page&lt;/span&gt; : &lt;span style="color: rgb(43,145,175)"&gt;UserControl
&lt;/span&gt;    {
        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; Page()
        {
            InitializeComponent();
            &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.Loaded += &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;RoutedEventHandler&lt;/span&gt;(Page_Loaded);
        }

        &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; Page_Loaded(&lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43,145,175)"&gt;RoutedEventArgs&lt;/span&gt; e)
        {
            &lt;span style="color: rgb(0,128,0)"&gt;//you may need to change this path depending on your web server
&lt;/span&gt;            &lt;span style="color: rgb(43,145,175)"&gt;WebRequest&lt;/span&gt; request = &lt;span style="color: rgb(43,145,175)"&gt;WebRequest&lt;/span&gt;.Create(&lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Uri&lt;/span&gt;(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;http://localhost:4386/io_web/textfile.txt&amp;quot;&lt;/span&gt;));
            request.Method = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;;
            request.ContentType = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;text/plain&amp;quot;&lt;/span&gt;;
            request.BeginGetResponse(&lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;AsyncCallback&lt;/span&gt;(ResponseReady), request);
            
        }

        &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; ResponseReady(&lt;span style="color: rgb(43,145,175)"&gt;IAsyncResult&lt;/span&gt; asyncResult)
        {
            &lt;span style="color: rgb(43,145,175)"&gt;WebRequest&lt;/span&gt; request = asyncResult.AsyncState &lt;span style="color: rgb(0,0,255)"&gt;as&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;WebRequest&lt;/span&gt;;
            &lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; (&lt;span style="color: rgb(43,145,175)"&gt;WebResponse&lt;/span&gt; response = request.EndGetResponse(asyncResult))
            {
                &lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; (&lt;span style="color: rgb(43,145,175)"&gt;Stream&lt;/span&gt; responseStream = response.GetResponseStream())
                {
                    &lt;span style="color: rgb(43,145,175)"&gt;StreamReader&lt;/span&gt; reader = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;StreamReader&lt;/span&gt;(responseStream);
                    &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; s = reader.ReadLine();
                    System.Diagnostics.&lt;span style="color: rgb(43,145,175)"&gt;Debug&lt;/span&gt;.WriteLine(s);
                }
            }
        }        

    }&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/50/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/50/default.aspx</link><pubDate>Mon, 31 Mar 2008 18:39:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/50/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>4</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/50/trackback/default.aspx</trackback:ping><category>Silverlight 2</category></item></channel></rss>
