<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Alan Cobb's Blog</title>
    <link>http://www.alancobb.com/blog/</link>
    <description>Silverlight, WPF and .NET</description>
    <language>en-us</language>
    <copyright>Alan Cobb</copyright>
    <lastBuildDate>Mon, 10 Nov 2008 06:55:58 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7180.0</generator>
    <managingEditor>AlansBlog@alancobb.com</managingEditor>
    <webMaster>AlansBlog@alancobb.com</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/AlanCobb" type="application/rss+xml" /><item>
      <trackback:ping>http://www.alancobb.com/blog/Trackback.aspx?guid=f4982c1f-b533-4555-acf2-aa416b4aadf1</trackback:ping>
      <pingback:server>http://www.alancobb.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.alancobb.com/blog/PermaLink,guid,f4982c1f-b533-4555-acf2-aa416b4aadf1.aspx</pingback:target>
      <dc:creator>Alan Cobb</dc:creator>
      <wfw:comment>http://www.alancobb.com/blog/CommentView,guid,f4982c1f-b533-4555-acf2-aa416b4aadf1.aspx</wfw:comment>
      <wfw:commentRss>http://www.alancobb.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f4982c1f-b533-4555-acf2-aa416b4aadf1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <em>Modified on 2008-Nov-16: (See notes added about Vista at the end)</em>
        </p>
        <p>
Here are my <a href="http://www.alancobb.com/pub2/Presentations/20081108/Cobb_Alan_SilverlightDebugging-2008-11-08.ppt">PowerPoint
slides</a> and <a href="http://www.alancobb.com/pub2/Presentations/20081108/SVCodeCamp2008Nov-DemoAppVS2008Solutions-ForSilverlightDebuggingTalk-AlanCobb.zip">demo
code</a> used in my Silverlight Debugging presentation at the 2008 Silicon Valley
Code Camp at Foothill College on Saturday November 8, 2008.  The demo code is
three separate VS2008 solutions in a ZIP file.  They were built with the SL2RTW
Silverlight Tools for VS2008+SP1.  Below are screen shots of two of those demo
apps.
</p>
        <!-- 2008-09-06: ASC: Replaced table around 2 images below with
		floating divs.  Now browser window can be narrowed more, because
		the 2 images will go from side-by-side to vertically stacked as
		browser window narrows.
	-->
        <div>
          <div style="FLOAT: left; MARGIN-BOTTOM: 0.5em; MARGIN-RIGHT: 0.5em">
            <div>
              <img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-Capture-CodeCamp-Little-Silverlight-BootStrap-LoaderApp-WithRedComment-400x300.jpg" />
            </div>
            <div style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; PADDING-TOP: 0.5em">Little
Silverlight "bootstrap" loader<br />
demo (loads bigger Silverlight app). 
</div>
          </div>
          <div style="FLOAT: left; MARGIN-BOTTOM: 0.5em">
            <div>
              <img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-Capture-CodeCamp-Performance-DemoApp-400x300.jpg" />
            </div>
            <div style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; PADDING-TOP: 0.5em">Performance
demo (MaxFrameRate). 
</div>
          </div>
          <br style="CLEAR: both; HEIGHT: 0px" />
        </div>
        <p>
Thanks for coming!
</p>
        <p>
Alan Cobb
</p>
        <p>
          <em>--------------------------------------------------------------------------<br /></em>
          <em>2008-Nov-16: Some added notes about problems on Vista:</em>
        </p>
        <p>
During my Code Camp session on 2008-Nov-08 I was running on XP.  Afterward
I tried re-building and re-running the demos under Vista.  I ran into two problems
worth mentioning:
</p>
        <p>
1) After you download the ZIP file containing these demos, Vista (or XP too depending
on your settings) is suspicious of any of the files in the ZIP.  You will get
warnings from VS2008 when you try to build the demo projects.  To prevent those
warnings, do the following:  Right click on the ZIP file in Windows Explorer. 
At the bottom of the "General" tab in Vista there should be an "Unblock" button. 
Press the "Unblock" button and the warnings for this particular ZIP file will stop.
</p>
        <p>
2) Getting Fiddler to spy on traffic to localhost when running on Vista:<br />
One standard trick to allow Fiddler to spy on HTTP traffic to localhost is to add
a "." at the end of localhost.  For example:  <a href="http://localhost.:4444/LittleLoaderAppTestPage.html">http://localhost.:4444/LittleLoaderAppTestPage.html</a> 
When I tried that on Vista I got an error message from Fiddler. In order to make
the "localhost." trick work on Vista I needed to change one of Fiddler's
settings.  Specifically: Tools / Fiddler Options / General tab. Uncheck
the "Enable IPv6" checkbox.  I don't know why that works, but it did for me. 
I learned about this Vista fix <a href="http://colinborrowman.spaces.live.com/blog/cns!5BE1E6D14CDF840F!232.entry">here</a>.
</p>
        <img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=f4982c1f-b533-4555-acf2-aa416b4aadf1" />
      </body>
      <title>My Silverlight debugging talk at SV Code Camp - Slides and demo code</title>
      <guid isPermaLink="false">http://www.alancobb.com/blog/PermaLink,guid,f4982c1f-b533-4555-acf2-aa416b4aadf1.aspx</guid>
      <link>http://feedproxy.google.com/~r/AlanCobb/~3/4DsGF6VM4ZY/MySilverlightDebuggingTalkAtSVCodeCampSlidesAndDemoCode.aspx</link>
      <pubDate>Mon, 10 Nov 2008 06:55:58 GMT</pubDate>
      <description>&lt;p&gt;
&lt;em&gt;Modified on 2008-Nov-16: (See notes added about Vista at the end)&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
Here are my &lt;a href="http://www.alancobb.com/pub2/Presentations/20081108/Cobb_Alan_SilverlightDebugging-2008-11-08.ppt"&gt;PowerPoint
slides&lt;/a&gt; and &lt;a href="http://www.alancobb.com/pub2/Presentations/20081108/SVCodeCamp2008Nov-DemoAppVS2008Solutions-ForSilverlightDebuggingTalk-AlanCobb.zip"&gt;demo
code&lt;/a&gt; used in my Silverlight Debugging presentation at the 2008 Silicon Valley
Code Camp at Foothill College on Saturday November 8, 2008.&amp;nbsp; The demo code is
three separate VS2008 solutions in a ZIP file.&amp;nbsp; They were built with the SL2RTW
Silverlight Tools for VS2008+SP1.&amp;nbsp; Below are screen shots of two of those demo
apps.
&lt;/p&gt;
&lt;!-- 2008-09-06: ASC: Replaced table around 2 images below with
		floating divs.  Now browser window can be narrowed more, because
		the 2 images will go from side-by-side to vertically stacked as
		browser window narrows.
	--&gt;
&lt;div&gt;
&lt;div style="FLOAT: left; MARGIN-BOTTOM: 0.5em; MARGIN-RIGHT: 0.5em"&gt;
&lt;div&gt;&lt;img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-Capture-CodeCamp-Little-Silverlight-BootStrap-LoaderApp-WithRedComment-400x300.jpg"&gt; 
&lt;/div&gt;
&lt;div style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; PADDING-TOP: 0.5em"&gt;Little
Silverlight "bootstrap" loader&lt;br&gt;
demo (loads bigger Silverlight app). 
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="FLOAT: left; MARGIN-BOTTOM: 0.5em"&gt;
&lt;div&gt;&lt;img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-Capture-CodeCamp-Performance-DemoApp-400x300.jpg"&gt; 
&lt;/div&gt;
&lt;div style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; PADDING-TOP: 0.5em"&gt;Performance
demo (MaxFrameRate). 
&lt;/div&gt;
&lt;/div&gt;
&lt;br style="CLEAR: both; HEIGHT: 0px"&gt;
&lt;/div&gt;
&lt;p&gt;
Thanks for coming!
&lt;/p&gt;
&lt;p&gt;
Alan Cobb
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;--------------------------------------------------------------------------&lt;br&gt;
&lt;/em&gt;&lt;em&gt;2008-Nov-16: Some added notes about&amp;nbsp;problems on Vista:&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
During my Code Camp&amp;nbsp;session on 2008-Nov-08 I was running on XP.&amp;nbsp; Afterward
I tried re-building and re-running the demos under Vista.&amp;nbsp; I ran into two problems
worth mentioning:
&lt;/p&gt;
&lt;p&gt;
1) After you download the ZIP file containing these demos, Vista (or XP too depending
on your settings) is suspicious of any of the files in the ZIP.&amp;nbsp; You will get
warnings from VS2008 when you try to build the demo projects.&amp;nbsp; To prevent those
warnings, do the following:&amp;nbsp; Right click on the ZIP file in Windows Explorer.&amp;nbsp;
At the bottom of the "General" tab in Vista there should be an "Unblock" button.&amp;nbsp;
Press the "Unblock" button and the warnings for this particular ZIP file will stop.
&lt;/p&gt;
&lt;p&gt;
2) Getting Fiddler to spy on traffic to localhost when running on Vista:&lt;br&gt;
One standard trick to allow Fiddler to spy on HTTP traffic to localhost is to add
a "." at the end of localhost.&amp;nbsp; For example:&amp;nbsp; &lt;a href="http://localhost.:4444/LittleLoaderAppTestPage.html"&gt;http://localhost.:4444/LittleLoaderAppTestPage.html&lt;/a&gt;&amp;nbsp;
When I tried that on Vista I&amp;nbsp;got an error message from Fiddler. In order to&amp;nbsp;make
the "localhost." trick&amp;nbsp;work on Vista I needed to change one of&amp;nbsp;Fiddler's
settings.&amp;nbsp; Specifically: Tools / Fiddler Options / General tab.&amp;nbsp;Uncheck
the "Enable IPv6" checkbox.&amp;nbsp; I don't know why that works, but it did for me.&amp;nbsp;
I learned about this Vista fix &lt;a href="http://colinborrowman.spaces.live.com/blog/cns!5BE1E6D14CDF840F!232.entry"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=f4982c1f-b533-4555-acf2-aa416b4aadf1" /&gt;</description>
      <comments>http://www.alancobb.com/blog/CommentView,guid,f4982c1f-b533-4555-acf2-aa416b4aadf1.aspx</comments>
      <category>debugging</category>
      <category>Silverlight</category>
    <feedburner:origLink>http://www.alancobb.com/blog/2008/11/10/MySilverlightDebuggingTalkAtSVCodeCampSlidesAndDemoCode.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.alancobb.com/blog/Trackback.aspx?guid=4e8798cd-d985-4d2c-8a1d-0d926dcfe150</trackback:ping>
      <pingback:server>http://www.alancobb.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.alancobb.com/blog/PermaLink,guid,4e8798cd-d985-4d2c-8a1d-0d926dcfe150.aspx</pingback:target>
      <dc:creator>Alan Cobb</dc:creator>
      <wfw:comment>http://www.alancobb.com/blog/CommentView,guid,4e8798cd-d985-4d2c-8a1d-0d926dcfe150.aspx</wfw:comment>
      <wfw:commentRss>http://www.alancobb.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=4e8798cd-d985-4d2c-8a1d-0d926dcfe150</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p style="PADDING-RIGHT: 0px; MARGIN-TOP: 0px; PADDING-LEFT: 0px; MARGIN-BOTTOM: 0.8em; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">
          <strong>Summary:<br /></strong>This post discusses one short-coming of the <a href="http://www.nbcolympics.com/video/index.html">NBCOlympics.com
Silverlight video player</a> and shows a simple CSS tweak you can make to force the
video to completely fill the IE7 browser window, even when running full screen
on a big monitor.
</p>
        <!-- 2008-09-06: ASC: Replaced table around 2 images below with
		floating divs.  Now browser window can be narrowed more, because
		the 2 images will go from side-by-side to vertically stacked as
		browser window narrows.
	-->
        <div>
          <div style="FLOAT: left; MARGIN-BOTTOM: 0.5em; MARGIN-RIGHT: 0.5em">
            <div>
              <img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-Capture-Olympics-Silverlight-Video-Player-Before-Forced-To-Full-Screen-With-Added-Callouts.jpg" />
            </div>
            <div style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; PADDING-TOP: 0.5em">Stock
player before tweaking.<br />
(Fixed-size 848x480 pixel video) 
</div>
          </div>
          <div style="FLOAT: left; MARGIN-BOTTOM: 0.5em">
            <div>
              <img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-Capture-Olympics-Silverlight-Video-Player-After-Forced-To-Full-Screen.jpg" />
            </div>
            <div style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; PADDING-TOP: 0.5em">After
CSS tweaked to force full-screen. 
</div>
          </div>
          <br style="CLEAR: both; HEIGHT: 0px" />
        </div>
        <p style="MARGIN-TOP: 0px">
Some people have criticized <a href="http://silverlight.net/forums/t/22318.aspx">[1]</a><a href="http://newteevee.com/2008/08/10/does-the-olympics-video-suck-for-you-too/">[2]</a> aspects
of the Silverlight "HD" video player that NBC is using to show the Olympics on
the Internet (only available in North America). One of the biggest irritations is
that there is no stock way to make the video window fill a large monitor. This has
led some people to <a href="http://silverlight.net/forums/p/22318/79301.aspx#79301">erroneously
suspect</a> this may reveal a technical limitation in Silverlight's ability to "stretch"
video. 
</p>
        <p>
Since I have been working on my own SL video player demo app, and since I'm interested
in SL debugging, I looked at the site's code to see if it could be "coaxed" into full
screen mode. It turns out that just changing two lines of CSS styling is all it takes
to go full screen.  If you only want to see the "how to tweak" details,
you can skip the following "why?" section. 
</p>
        <p>
          <strong>Background: Why no full screen mode?</strong>
          <br />
If all it takes to go full screen is changing two lines of CSS, then clearly the fixed
848x480 video window was a deliberate design decision. Why would Microsoft and NBC make
that choice? Tom Taylor of Microsoft has offered at least a partial <a href="http://silverlight.net/forums/p/22318/79223.aspx#79223">explanation</a>.
He says one factor was that when you scale the video to fill a larger screen the compression
artifacts are more apparent. That is true. Another, probably more important,
factor is: "...restrictions placed on the usage of full screen video by the IOC".  Tom
says it is "absolutely false" that NBC made the choice out of fear that
a "too good" player might undermine their cash cow of conventional TV broadcasts of
the Olympics. Whether that's true or not, some early reports suggest the large
amount of video on the NBC site actually helps increase the TV audience (at least
with a somewhat neutered SL player).
</p>
        <p>
Tom says "most people have 1024x768 monitors or less", but according <a href="http://www.upsdell.com/BrowserNews/stat_trends.htm">Browser
News</a>, "~91% of page accesses" come from browsers with resolutions of 1024x768
and higher.  Even if the average user is still at 1024x768, it isn't that hard
to create a liquid layout that adapts as well to 800x600 resolution as to 2560x1600. 
One of the biggest attractions of Silverlight and WPF for me as a developer is that
they are vector based (highly scalable), and have strong support for liquid layouts. 
<br /></p>
        <p>
          <strong>Workarounds:</strong>
          <br />
Regardless of why they chose a "small" fixed layout, how can we get the scalable,
full-screen behavior that many of us want?
</p>
        <p>
          <strong>Simple non-programmer fixes:</strong>
          <br />
Actually, the simplest ways to get full-screen behavior don't require any programming:
As discussed in the same <a href="http://silverlight.net/forums/p/22318/79223.aspx#79223">silverlight.net
forum thread</a>, one solution is to just temporarily drop your display resolution
down to 1024x768. The disadvantage is that it also forces the OS and all your other
programs down to that low resolution too.
</p>
        <p>
Probably the best fix is to download Firefox 3 (ironic from MS's point of view) and
use its "zoom in" mode to expand the Olympics video to full screen. Unfortunately,
IE7's own "zoom in" mode has an issue that prevents it from working well in this case.
Yes, IE7 will zoom in on the video, but the banner ad on the same page periodically
shifts to the right for some reason, pushing part of the video out of view. 
</p>
        <p>
          <strong>More technical fixes:</strong>
          <strong>
            <br />
          </strong>Since this is a technical blog, and most of us are "devs", we'll look for
a more programmer-level fix. Actually, both the following fixes are quite simple
once you know what to tweak. 
</p>
        <p>
          <strong>Technique #1: Add a personal style sheet rule:</strong>
          <br />
For this one I just added the following CSS rule to the <a href="http://webdesign.about.com/od/css/ht/htcssuseriewin.htm">personal
style sheet</a> I use with IE:
</p>
        <div style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 1em; BORDER-TOP: black 1px solid; PADDING-LEFT: 1em; PADDING-BOTTOM: 1em; MARGIN: 1em; BORDER-LEFT: black 1px solid; PADDING-TOP: 1em; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #dcdcdc">#videoPlaybackHost<br />
{       width: 105% !important;   /* Stock
player uses fixed 1002px */<br />
        height: 200% !important;  /* Stock
player uses fixed 524px */<br />
} 
</div>
        <p>
The CSS "id selector" #videoPlaybackHost refers to the DIV element holding the Silverlight
control that displays the video.  I've replaced the fixed 1002 pixel width with
a width of 105%.  That makes the video stretch to fill the entire width of the
browser window, regardless of how small or large you make it.  What a concept!
:)  Although the 200% height seems odd, that was what worked on my 1600x1200
display.  You can tune those percentages, or switch to large fixed
numbers like a 1000px height, to suit your particular monitor size.
</p>
        <p>
After you create or edit the custom style sheet, you need to restart IE7.  Also,
when the smaller browser pop-up window that holds the video appears, you need
to press the "ENLARGE VIDEO" button on the player and press F11 to make that browser window border
resizable. 
</p>
        <p>
          <strong>Technique #2: Create a "bookmarklet" to tweak the DIV style to full screen:<br /></strong>This second technique was <a href="http://silverlight.net/forums/p/22318/81262.aspx#81262">suggested
by "slyi"</a> on the Silverlight forums.  Although creating a personal style
sheet is easy, this is even easier (thanks slyi).  I had never created a "bookmarklet"
before, but it was simple enough.  For those of you who haven't used <a href="http://en.wikipedia.org/wiki/Bookmarklet">bookmarklets</a>,
the basic idea is to use the text of a little Javascript program as the href
address in a hyperlink / bookmark.  When you click the link, instead of openning
another web page, your few lines of Javascript run.  
</p>
        <p>
First create a regular favorite (IE) or bookmark (FF).  Then right click on the
favorite and select "properties".  Now paste the following single long line of
Javascript into the URL field:
</p>
        <div style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 1em; BORDER-TOP: black 1px solid; PADDING-LEFT: 1em; PADDING-BOTTOM: 1em; MARGIN: 1em; BORDER-LEFT: black 1px solid; PADDING-TOP: 1em; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #dcdcdc">javascript:var
o1=document.getElementById('videoPlaybackHost'); o1.style.width='105%'; o1.style.height='200%';void(null) 
</div>
        <p>
Finally, once the video player window is open and you have clicked the "ENLARGE VIDEO"
button, you just click the bookmarklet containing the above code and it will force
the video to fill the browser window.
</p>
        <p>
One problem is that the video player window normally opens with just a title bar,
but no menus and hence no bookmarklets/favorites to click.  To get around that
in IE7 you can copy the URL at the top of the video window into the address bar of
a full browser window.  Or just click this <a href="http://www.nbcolympics.com/video/player.html?assetid=0816_hd_sob_en095&amp;channelcode=sportso">URL
to a random video</a> to get you into the player.  Now your bookmarks menu should
be available. 
</p>
        <p>
          <strong>Doing the analysis with IE Developer Toolbar or Firebug:</strong>
          <br />
I used the <a href="http://en.wikipedia.org/wiki/IE_Developer_Toolbar">IE Developer
Toolbar</a> (IEDT) add-on with IE to come up with the above simple CSS fix. 
You can use <a href="http://getfirebug.com/">Firebug</a> on Firefox to do the
same thing.  IEDT and Firebug both show you the element tree for the host HTML
page.  You can browse down to the nested DIVs containing the Silverlight control
and interactively tweak their CSS styles!   
</p>
        <img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-capture-IEDevToolbar-after-forced-SL-player-to-full-screen--With-my-callouts-600x503.jpg" />
        <br />
        <p>
This screen shows IEDT in action, after I have tweaked the DIV's width and height
on-the-fly.  And yes, they really do have <a href="http://www.nbcolympics.com/video/player.html?assetid=0815_BVBGirls_JA228">cheerleaders
at the Olympics</a>.
</p>
        <p>
          <strong>The more conventional "full screen" mode of Silverlight:</strong>
          <br />
Finally, although I like this liquid layout technique for going "full screen",
Silverlight also supports a more literal full screen mode, where the Silverlight app
can immediately jump to fill the entire screen without any surrounding browser chrome. 
There is a whole <a href="http://msdn.microsoft.com/en-us/library/cc189023(VS.95).aspx">section
in the documentation</a> about it.  Most other Silverlight video players offer
that capability.  Like this player <a href="http://www.codeplex.com/sl2videoplayer/">sample
on CodePlex</a>. 
</p>
        <p>
Alan Cobb
</p>
        <img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=4e8798cd-d985-4d2c-8a1d-0d926dcfe150" />
      </body>
      <title>Tweaking the NBCOlympics.com Silverlight video player to run full screen </title>
      <guid isPermaLink="false">http://www.alancobb.com/blog/PermaLink,guid,4e8798cd-d985-4d2c-8a1d-0d926dcfe150.aspx</guid>
      <link>http://feedproxy.google.com/~r/AlanCobb/~3/L-CPtU_HDPU/TweakingTheNBCOlympicscomSilverlightVideoPlayerToRunFullScreen.aspx</link>
      <pubDate>Sun, 17 Aug 2008 17:54:31 GMT</pubDate>
      <description>&lt;p style="PADDING-RIGHT: 0px; MARGIN-TOP: 0px; PADDING-LEFT: 0px; MARGIN-BOTTOM: 0.8em; PADDING-BOTTOM: 0px; PADDING-TOP: 0px"&gt;
&lt;strong&gt;Summary:&lt;br&gt;
&lt;/strong&gt;This post discusses one short-coming of the &lt;a href="http://www.nbcolympics.com/video/index.html"&gt;NBCOlympics.com
Silverlight video player&lt;/a&gt; and shows a simple CSS tweak you can make to force the
video&amp;nbsp;to completely fill the IE7 browser window, even when running full screen
on a big monitor.
&lt;/p&gt;
&lt;!-- 2008-09-06: ASC: Replaced table around 2 images below with
		floating divs.  Now browser window can be narrowed more, because
		the 2 images will go from side-by-side to vertically stacked as
		browser window narrows.
	--&gt;
&lt;div&gt;
&lt;div style="FLOAT: left; MARGIN-BOTTOM: 0.5em; MARGIN-RIGHT: 0.5em"&gt;
&lt;div&gt;&lt;img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-Capture-Olympics-Silverlight-Video-Player-Before-Forced-To-Full-Screen-With-Added-Callouts.jpg"&gt; 
&lt;/div&gt;
&lt;div style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; PADDING-TOP: 0.5em"&gt;Stock
player before tweaking.&lt;br&gt;
(Fixed-size 848x480 pixel video) 
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="FLOAT: left; MARGIN-BOTTOM: 0.5em"&gt;
&lt;div&gt;&lt;img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-Capture-Olympics-Silverlight-Video-Player-After-Forced-To-Full-Screen.jpg"&gt; 
&lt;/div&gt;
&lt;div style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; PADDING-TOP: 0.5em"&gt;After
CSS tweaked to force full-screen. 
&lt;/div&gt;
&lt;/div&gt;
&lt;br style="CLEAR: both; HEIGHT: 0px"&gt;
&lt;/div&gt;
&lt;p style="MARGIN-TOP: 0px"&gt;
Some people have&amp;nbsp;criticized &lt;a href="http://silverlight.net/forums/t/22318.aspx"&gt;[1]&lt;/a&gt; &lt;a href="http://newteevee.com/2008/08/10/does-the-olympics-video-suck-for-you-too/"&gt;[2]&lt;/a&gt; aspects
of the&amp;nbsp;Silverlight "HD" video player that NBC is using to show the Olympics on
the Internet (only available in North America). One of the biggest irritations is
that there is no stock way to make the video window fill a large monitor. This has
led some people to &lt;a href="http://silverlight.net/forums/p/22318/79301.aspx#79301"&gt;erroneously
suspect&lt;/a&gt; this may reveal a technical limitation in Silverlight's ability to "stretch"
video. 
&lt;/p&gt;
&lt;p&gt;
Since I have been working on my own SL video player demo app, and since I'm interested
in SL debugging, I looked at the site's code to see if it could be "coaxed" into full
screen mode. It turns out that just changing two lines of CSS styling is all it takes
to go full screen.&amp;nbsp; If you&amp;nbsp;only want to see the "how to tweak" details,
you can skip the following "why?" section. 
&lt;p&gt;
&lt;strong&gt;Background: Why no full screen mode?&lt;/strong&gt;
&lt;br&gt;
If all it takes to go full screen is changing two lines of CSS, then clearly the fixed
848x480 video window was a deliberate design decision. Why would Microsoft and NBC&amp;nbsp;make
that choice? Tom Taylor of Microsoft has offered at least a partial &lt;a href="http://silverlight.net/forums/p/22318/79223.aspx#79223"&gt;explanation&lt;/a&gt;.
He says one factor was that when you scale the video to fill a larger screen the compression
artifacts are more apparent. That is true. Another, probably&amp;nbsp;more important,
factor is: "...restrictions placed on the usage of full screen video by the IOC".&amp;nbsp;&amp;nbsp;Tom
says it is&amp;nbsp;"absolutely false"&amp;nbsp;that NBC made the choice out of fear that
a "too good" player might undermine their cash cow of conventional TV broadcasts of
the Olympics. Whether that's true or not,&amp;nbsp;some early reports suggest the large
amount of video on the NBC site&amp;nbsp;actually helps increase the TV audience (at least
with a somewhat neutered SL player).
&lt;/p&gt;
&lt;p&gt;
Tom says "most people have 1024x768 monitors or less", but according &lt;a href="http://www.upsdell.com/BrowserNews/stat_trends.htm"&gt;Browser
News&lt;/a&gt;, "~91% of page accesses" come from browsers with&amp;nbsp;resolutions of 1024x768
and higher.&amp;nbsp; Even if the average user is still at 1024x768, it isn't that hard
to create a liquid layout that adapts&amp;nbsp;as well to 800x600&amp;nbsp;resolution as to&amp;nbsp;2560x1600.&amp;nbsp;
One of the biggest attractions of Silverlight and WPF for me as a developer is that
they are vector based (highly scalable), and have strong support for liquid layouts. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Workarounds:&lt;/strong&gt;
&lt;br&gt;
Regardless of why they chose a "small" fixed layout, how can we get the scalable,
full-screen behavior that many of us want?
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Simple non-programmer fixes:&lt;/strong&gt;
&lt;br&gt;
Actually, the simplest ways to get full-screen behavior don't require any programming:
As discussed in the same &lt;a href="http://silverlight.net/forums/p/22318/79223.aspx#79223"&gt;silverlight.net
forum thread&lt;/a&gt;, one solution is to just temporarily drop your display resolution
down to 1024x768. The disadvantage is that it also forces the OS and all your other
programs down to that low resolution too.
&lt;/p&gt;
&lt;p&gt;
Probably the best fix is to download Firefox 3 (ironic from MS's point of view) and
use its "zoom in" mode to expand the Olympics video to full screen. Unfortunately,
IE7's own "zoom in" mode has an issue that prevents it from working well in this case.
Yes, IE7 will zoom in on the video, but the banner ad on the same page periodically
shifts to the right for some reason, pushing part of the video out of view. 
&lt;p&gt;
&lt;strong&gt;More technical fixes:&lt;/strong&gt;&lt;strong&gt;
&lt;br&gt;
&lt;/strong&gt;Since this is a technical blog, and most of us are "devs", we'll look for
a more programmer-level fix. Actually, both the following fixes are&amp;nbsp;quite simple
once you know what to tweak. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Technique #1: Add a personal style sheet rule:&lt;/strong&gt;
&lt;br&gt;
For this one I just added the following CSS rule to the &lt;a href="http://webdesign.about.com/od/css/ht/htcssuseriewin.htm"&gt;personal
style sheet&lt;/a&gt; I use with IE:
&lt;/p&gt;
&lt;div style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 1em; BORDER-TOP: black 1px solid; PADDING-LEFT: 1em; PADDING-BOTTOM: 1em; MARGIN: 1em; BORDER-LEFT: black 1px solid; PADDING-TOP: 1em; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #dcdcdc"&gt;#videoPlaybackHost&lt;br&gt;
{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 105% !important;&amp;nbsp;&amp;nbsp; /* Stock
player uses fixed 1002px */&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 200% !important;&amp;nbsp; /* Stock
player uses fixed 524px */&lt;br&gt;
} 
&lt;/div&gt;
&lt;p&gt;
The CSS "id selector" #videoPlaybackHost refers to the DIV element holding the Silverlight
control that displays the video.&amp;nbsp; I've replaced the fixed 1002 pixel width with
a width of 105%.&amp;nbsp; That makes the video stretch to fill the entire width of the
browser window, regardless of how small or large you make it.&amp;nbsp; What a concept!
:)&amp;nbsp; Although the 200%&amp;nbsp;height seems odd, that was what worked on my 1600x1200
display.&amp;nbsp; You can tune&amp;nbsp;those percentages, or&amp;nbsp;switch to large fixed
numbers like a 1000px height, to suit your&amp;nbsp;particular monitor size.
&lt;/p&gt;
&lt;p&gt;
After you create or edit the custom style sheet, you need to restart IE7.&amp;nbsp; Also,
when the smaller browser pop-up window that holds the video appears, you&amp;nbsp;need
to press the "ENLARGE VIDEO" button on the player and press F11 to make that browser&amp;nbsp;window&amp;nbsp;border
resizable. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Technique #2: Create a "bookmarklet" to tweak the DIV style&amp;nbsp;to full screen:&lt;br&gt;
&lt;/strong&gt;This second technique was &lt;a href="http://silverlight.net/forums/p/22318/81262.aspx#81262"&gt;suggested
by "slyi"&lt;/a&gt; on the Silverlight forums.&amp;nbsp; Although creating a personal style
sheet is easy, this is even easier (thanks slyi).&amp;nbsp; I had never created a "bookmarklet"
before, but it was simple enough.&amp;nbsp; For those of you&amp;nbsp;who haven't used &lt;a href="http://en.wikipedia.org/wiki/Bookmarklet"&gt;bookmarklets&lt;/a&gt;,
the&amp;nbsp;basic idea is to use the text of a little Javascript program as the href
address in a hyperlink / bookmark.&amp;nbsp; When you click the link, instead of&amp;nbsp;openning
another web page, your&amp;nbsp;few lines of Javascript run.&amp;nbsp;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
First create a regular favorite (IE) or bookmark (FF).&amp;nbsp; Then right click on the
favorite and select "properties".&amp;nbsp; Now paste the following single long line of
Javascript into the URL field:
&lt;/p&gt;
&lt;div style="BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 1em; BORDER-TOP: black 1px solid; PADDING-LEFT: 1em; PADDING-BOTTOM: 1em; MARGIN: 1em; BORDER-LEFT: black 1px solid; PADDING-TOP: 1em; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #dcdcdc"&gt;javascript:var
o1=document.getElementById('videoPlaybackHost'); o1.style.width='105%'; o1.style.height='200%';void(null) 
&lt;/div&gt;
&lt;p&gt;
Finally, once the video player window is open and you have clicked the "ENLARGE VIDEO"
button, you just click the bookmarklet containing the above code and it will force
the video to fill the browser window.
&lt;/p&gt;
&lt;p&gt;
One problem is that the video player window normally opens with just a title bar,
but no menus and hence no bookmarklets/favorites to click.&amp;nbsp; To get around that
in IE7 you can copy the URL at the top of the video window into the address bar of
a full browser window.&amp;nbsp; Or just click this&amp;nbsp;&lt;a href="http://www.nbcolympics.com/video/player.html?assetid=0816_hd_sob_en095&amp;amp;channelcode=sportso"&gt;URL
to a random video&lt;/a&gt; to get you into the player.&amp;nbsp; Now your bookmarks menu should
be available. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Doing the analysis with IE Developer Toolbar or Firebug:&lt;/strong&gt;
&lt;br&gt;
I used the &lt;a href="http://en.wikipedia.org/wiki/IE_Developer_Toolbar"&gt;IE Developer
Toolbar&lt;/a&gt; (IEDT) add-on with IE to come up with the above simple CSS fix.&amp;nbsp;
You can&amp;nbsp;use &lt;a href="http://getfirebug.com/"&gt;Firebug&lt;/a&gt; on Firefox to do the
same thing.&amp;nbsp; IEDT and Firebug both show you the element tree for the host HTML
page.&amp;nbsp; You can browse down to the nested DIVs containing the Silverlight control
and interactively tweak their CSS styles!&amp;nbsp;&amp;nbsp; 
&lt;/p&gt;
&lt;img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/Screen-capture-IEDevToolbar-after-forced-SL-player-to-full-screen--With-my-callouts-600x503.jpg"&gt;
&lt;br&gt;
&lt;p&gt;
This screen shows IEDT in action, after I have tweaked the DIV's width and height
on-the-fly.&amp;nbsp; And yes, they really do have &lt;a href="http://www.nbcolympics.com/video/player.html?assetid=0815_BVBGirls_JA228"&gt;cheerleaders
at the Olympics&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;The more conventional "full screen" mode of Silverlight:&lt;/strong&gt;
&lt;br&gt;
Finally, although I like&amp;nbsp;this liquid layout technique for going "full screen",
Silverlight also supports a more literal full screen mode, where the Silverlight app
can immediately jump to fill the entire screen without any surrounding browser chrome.&amp;nbsp;
There is a whole &lt;a href="http://msdn.microsoft.com/en-us/library/cc189023(VS.95).aspx"&gt;section
in the documentation&lt;/a&gt; about it.&amp;nbsp; Most other Silverlight video players offer
that capability.&amp;nbsp; Like&amp;nbsp;this player &lt;a href="http://www.codeplex.com/sl2videoplayer/"&gt;sample
on CodePlex&lt;/a&gt;.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Alan Cobb
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=4e8798cd-d985-4d2c-8a1d-0d926dcfe150" /&gt;</description>
      <comments>http://www.alancobb.com/blog/CommentView,guid,4e8798cd-d985-4d2c-8a1d-0d926dcfe150.aspx</comments>
      <category>debugging</category>
      <category>Silverlight</category>
      <category>video</category>
    <feedburner:origLink>http://www.alancobb.com/blog/2008/08/17/TweakingTheNBCOlympicscomSilverlightVideoPlayerToRunFullScreen.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.alancobb.com/blog/Trackback.aspx?guid=ba5c10b9-5c10-4285-af2a-eca6502c8e8f</trackback:ping>
      <pingback:server>http://www.alancobb.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.alancobb.com/blog/PermaLink,guid,ba5c10b9-5c10-4285-af2a-eca6502c8e8f.aspx</pingback:target>
      <dc:creator>Alan Cobb</dc:creator>
      <wfw:comment>http://www.alancobb.com/blog/CommentView,guid,ba5c10b9-5c10-4285-af2a-eca6502c8e8f.aspx</wfw:comment>
      <wfw:commentRss>http://www.alancobb.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ba5c10b9-5c10-4285-af2a-eca6502c8e8f</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Motivation:<br /></strong>What if you want the user of your Silverlight app to be able to change some
properties of your UI dynamically on-the-fly? For example, it would be nice to let
your user set the FontSize to their liking at runtime and have that new size used
by all controls immediately.
</p>
        <p>
One way to do that is with data binding and a shared "app-global" "binding-relay"
object. The graphic below shows the UI of this sample app and how its elements are
indirectly connected with data binding via a "binding-relay" object. This general
technique has been described by other people as part of larger articles (see for example, <a href="http://www.u2u.info/Blogs/Peter/Lists/Posts/Post.aspx?ID=271">here</a> and <a href="http://blogs.microsoft.co.il/blogs/tamir/archive/2008/03/07/building-custom-user-control-in-silverlight-2-0-how-to-build-code-snippet-for-vs-as-bonus.aspx">here</a> [both
links are slow]), but here I want to emphasize just this one technique. Although it
has some disadvantages, it's a useful pattern to have in your toolbox.
</p>
        <p>
My sample app is split into two sections. The group of "controller" elements in the
upper half is used to dynamically change the properties of the "controlled" TextBlocks
in the lower half. The graphic below shows the UI of this sample app and how its elements
are indirectly connected with data binding.
</p>
        <p>
          <img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" alt="Annotated screen capture of sample app demoing Silverlight data binding using a binding-relay object" src="http://www.alancobb.com/blog/content/binary/DynamicStylesForSilverlightByDataBindingToAGlobalBindingRelayObject_ScreenCaptureOfSampleApp-v4B.png" />
        </p>
        <p>
          <a href="http://www.alancobb.com/pub/SL2/Samples/BindingRelay/SL2B2/BindingRelaySample_SL2B2TestPage.html">Live
copy of this sample app (SL2B2 version) </a>
        </p>
        <p>
          <a href="http://www.alancobb.com/pub/SL2/Samples/BindingRelay/SL2B2/BindingRelaySample_SL2B2.zip">Sample
source code as zipped VS2008 solution</a>
          <br />
(After you unzip and rebuild it, remember to again set the HTML page in the web project
as the Start Page before you run it with F5.)
</p>
        <p>
          <strong>How it works:</strong>
          <br />
We start by creating a custom class that exposes the global properties we want to
support. For example, "double dFontSize". In this sample the class is called CBindingRelayClass_ApplicationWideSettings.
We create a single shared instance of that class by instantiating it in the App.Resources
section of our App.xaml. Now multiple elements anywhere in our application can bind
their FontSize properties as targets to the dFontSize source property on the global
object. This class must support the INotifyPropertyChanged interface. That's how the
binding system is alerted when one of our global properties is changed. Then the binding
system "relays" that change out to all the bound targets of that global source property.
That's why I call it a "binding-relay" object.
</p>
        <p>
We drive changes to the global dFontSize property with a Slider. The Slider is TwoWay
bound back to the global binding source object. The binding mode for the Slider must
be TwoWay in order for it to drive the value of the dFontSize property (changes flowing
from target back to source). Normal OneWay binding only moves changes in the other
direction, from binding source to target.
</p>
        <p>
So those are the basic "tricks" behind this technique.
</p>
        <p>
          <strong>More implementation details:<br /></strong>It's easy enough to use TwoWay binding to make the Slider drive a property
like dFontSize because it has the simple type double. But what about a type like FontFamily?
In this sample I use a ListBox to choose the FontFamily. But instead of TwoWay binding,
I fall back on an "old school" event handler. In the ListBox.SelectionChanged event
handler I "manually" instantiate a new FontFamily object based on the selected line
in the ListBox and assign it to the oFontFamily property on the global "binding relay"
object.
</p>
        <p>
What about the Slider driving the oSolidColorBrush property on the global object?
There I also go "old school" rather than using TwoWay binding. In the Slider.ValueChanged
event handler I "manually" translate the Slider Value (which ranges from 0x000000
to 0xffffff) into an RGB color, use that to instantiate a new SolidColorBrush and
finally assign that to the global oSolidColorBrush property.
</p>
        <p>
In theory we could have used TwoWay binding to drive the values of both these more
complex properties. That would require writing value converter classes that implement
IValueConverter. For example, we should be able to write a value converter that translates
back and forth between the types double and SolidColorBrush. My preliminary experiments
under SL2B2 with TwoWay binding using value converters for more complex types didn't
work, so I haven't shown that here.<br /><br /><strong>Disadvantages:<br /></strong>Although using a "binding-relay" object does let you dynamically change properties
in real-time, it also has some disadvantages. One burden is just that you need to
define and instantiate the binding-relay object somewhere. In contrast to the current
Silverlight version, WPF's binding system allows you to directly bind one element
to another, without needing a "relay" object in between (<a href="http://www.wpfdude.com/articles/BindingToElement.aspx">See
for example</a>). So in WPF you could directly bind the FontSize property of one element
to the output of a Slider control. Another drawback is the extra binding XAML you
must add to every control that consumes the "dynamic property". For example: <font color="#ff0000">FontSize</font><font color="#0000ff">="{</font><font color="#a31515">Binding</font><font color="#ff0000"> dFontSize</font><font color="#0000ff">}".</font><br /><br /><strong>New "property value inheritance" of font properties in Silverlight:<br /></strong>This technique's ability to dynamically control the font properties of many
target elements simultaneously seemed a bit more impressive before SL2 Beta 2. But
now SL2B2 has introduced more "property value inheritance" to Silverlight, something
which <a href="http://msdn.microsoft.com/en-us/library/ms753197.aspx">WPF already
broadly supports</a>. Most of the font-related properties (like FontSize and FontFamily)
have been moved to the Control class in SL2B2. Now those values are "inherited" by
the child elements inside a given control. This means you can set the FontSize and
FontFamily once on a UserControl and those values will cascade (like in CSS) down
to the child elements. To demonstrate that you can add these bound properties to the
XAML that defines the Page UserControl:<br /><br /><font color="#ff0000"> FontSize</font><font color="#0000ff">="{</font><font color="#a31515">Binding</font><font color="#ff0000"> dFontSize</font><font color="#0000ff">}"<br /></font><font color="#ff0000"> FontFamily</font><font color="#0000ff">="{</font><font color="#a31515">Binding</font><font color="#ff0000"> oFontFamily</font><font color="#0000ff">}"
</font></p>
        <p>
After that change when you vary the FontSize Slider, the text size changes everywhere
on the Page, not just in the lower half. We are still using the "binding-relay" object,
but now it is unnecessary to duplicate the same binding XAML on every target element.
</p>
        <p>
Alan Cobb
</p>
        <img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=ba5c10b9-5c10-4285-af2a-eca6502c8e8f" />
      </body>
      <title>Changing Silverlight properties dynamically with a "binding-relay" object </title>
      <guid isPermaLink="false">http://www.alancobb.com/blog/PermaLink,guid,ba5c10b9-5c10-4285-af2a-eca6502c8e8f.aspx</guid>
      <link>http://feedproxy.google.com/~r/AlanCobb/~3/N1aLGmsFC5s/ChangingSilverlightPropertiesDynamicallyWithABindingrelayObject.aspx</link>
      <pubDate>Thu, 17 Jul 2008 21:39:06 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;Motivation:&lt;br&gt;
&lt;/strong&gt;What if you want the user of your Silverlight app to be able to change some
properties of your UI dynamically on-the-fly? For example, it would be nice to let
your user set the FontSize to their liking at runtime and have that new size used
by all controls immediately.
&lt;/p&gt;
&lt;p&gt;
One way to do that is with data binding and a shared "app-global" "binding-relay"
object. The graphic below shows the UI of this sample app and how its elements are
indirectly connected with data binding via a "binding-relay" object. This general
technique has been described by other people as part of larger articles (see for example, &lt;a href="http://www.u2u.info/Blogs/Peter/Lists/Posts/Post.aspx?ID=271"&gt;here&lt;/a&gt; and &lt;a href="http://blogs.microsoft.co.il/blogs/tamir/archive/2008/03/07/building-custom-user-control-in-silverlight-2-0-how-to-build-code-snippet-for-vs-as-bonus.aspx"&gt;here&lt;/a&gt; [both
links are slow]), but here I want to emphasize just this one technique. Although it
has some disadvantages, it's a useful pattern to have in your toolbox.
&lt;/p&gt;
&lt;p&gt;
My sample app is split into two sections. The group of "controller" elements in the
upper half is used to dynamically change the properties of the "controlled" TextBlocks
in the lower half. The graphic below shows the UI of this sample app and how its elements
are indirectly connected with data binding.
&lt;/p&gt;
&lt;p&gt;
&lt;img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" alt="Annotated screen capture of sample app demoing Silverlight data binding using a binding-relay object" src="http://www.alancobb.com/blog/content/binary/DynamicStylesForSilverlightByDataBindingToAGlobalBindingRelayObject_ScreenCaptureOfSampleApp-v4B.png"&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.alancobb.com/pub/SL2/Samples/BindingRelay/SL2B2/BindingRelaySample_SL2B2TestPage.html"&gt;Live
copy of this sample app (SL2B2 version) &lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.alancobb.com/pub/SL2/Samples/BindingRelay/SL2B2/BindingRelaySample_SL2B2.zip"&gt;Sample
source code as zipped VS2008 solution&lt;/a&gt; 
&lt;br&gt;
(After you unzip and rebuild it, remember to again set the HTML page in the web project
as the Start Page before you run it with F5.)
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;How it works:&lt;/strong&gt;
&lt;br&gt;
We start by creating a custom class that exposes the global properties we want to
support. For example, "double dFontSize". In this sample the class is called CBindingRelayClass_ApplicationWideSettings.
We create a single shared instance of that class by instantiating it in the App.Resources
section of our App.xaml. Now multiple elements anywhere in our application can bind
their FontSize properties as targets to the dFontSize source property on the global
object. This class must support the INotifyPropertyChanged interface. That's how the
binding system is alerted when one of our global properties is changed. Then the binding
system "relays" that change out to all the bound targets of that global source property.
That's why I call it a "binding-relay" object.
&lt;/p&gt;
&lt;p&gt;
We drive changes to the global dFontSize property with a Slider. The Slider is TwoWay
bound back to the global binding source object. The binding mode for the Slider must
be TwoWay in order for it to drive the value of the dFontSize property (changes flowing
from target back to source). Normal OneWay binding only moves changes in the other
direction, from binding source to target.
&lt;/p&gt;
&lt;p&gt;
So those are the basic "tricks" behind this technique.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;More implementation details:&lt;br&gt;
&lt;/strong&gt;It's easy enough to use TwoWay binding to make the Slider drive a property
like dFontSize because it has the simple type double. But what about a type like FontFamily?
In this sample I use a ListBox to choose the FontFamily. But instead of TwoWay binding,
I fall back on an "old school" event handler. In the ListBox.SelectionChanged event
handler I "manually" instantiate a new FontFamily object based on the selected line
in the ListBox and assign it to the oFontFamily property on the global "binding relay"
object.
&lt;/p&gt;
&lt;p&gt;
What about the Slider driving the oSolidColorBrush property on the global object?
There I also go "old school" rather than using TwoWay binding. In the Slider.ValueChanged
event handler I "manually" translate the Slider Value (which ranges from 0x000000
to 0xffffff) into an RGB color, use that to instantiate a new SolidColorBrush and
finally assign that to the global oSolidColorBrush property.
&lt;/p&gt;
&lt;p&gt;
In theory we could have used TwoWay binding to drive the values of both these more
complex properties. That would require writing value converter classes that implement
IValueConverter. For example, we should be able to write a value converter that translates
back and forth between the types double and SolidColorBrush. My preliminary experiments
under SL2B2 with TwoWay binding using value converters for more complex types didn't
work, so I haven't shown that here.&lt;br&gt;
&lt;br&gt;
&lt;strong&gt;Disadvantages:&lt;br&gt;
&lt;/strong&gt;Although using a "binding-relay" object does let you dynamically change properties
in real-time, it also has some disadvantages. One burden is just that you need to
define and instantiate the binding-relay object somewhere. In contrast to the current
Silverlight version, WPF's binding system allows you to directly bind one element
to another, without needing a "relay" object in between (&lt;a href="http://www.wpfdude.com/articles/BindingToElement.aspx"&gt;See
for example&lt;/a&gt;). So in WPF you could directly bind the FontSize property of one element
to the output of a Slider control. Another drawback is the extra binding XAML you
must add to every control that consumes the "dynamic property". For example: &lt;font color=#ff0000&gt;FontSize&lt;/font&gt;&lt;font color=#0000ff&gt;="{&lt;/font&gt;&lt;font color=#a31515&gt;Binding&lt;/font&gt;&lt;font color=#ff0000&gt; dFontSize&lt;/font&gt;&lt;font color=#0000ff&gt;}".&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;strong&gt;New "property value inheritance" of font properties in Silverlight:&lt;br&gt;
&lt;/strong&gt;This technique's ability to dynamically control the font properties of many
target elements simultaneously seemed a bit more impressive before SL2 Beta 2. But
now SL2B2 has introduced more "property value inheritance" to Silverlight, something
which &lt;a href="http://msdn.microsoft.com/en-us/library/ms753197.aspx"&gt;WPF already
broadly supports&lt;/a&gt;. Most of the font-related properties (like FontSize and FontFamily)
have been moved to the Control class in SL2B2. Now those values are "inherited" by
the child elements inside a given control. This means you can set the FontSize and
FontFamily once on a UserControl and those values will cascade (like in CSS) down
to the child elements. To demonstrate that you can add these bound properties to the
XAML that defines the Page UserControl:&lt;br&gt;
&lt;br&gt;
&lt;font color=#ff0000&gt; FontSize&lt;/font&gt;&lt;font color=#0000ff&gt;="{&lt;/font&gt;&lt;font color=#a31515&gt;Binding&lt;/font&gt;&lt;font color=#ff0000&gt; dFontSize&lt;/font&gt;&lt;font color=#0000ff&gt;}"&lt;br&gt;
&lt;/font&gt;&lt;font color=#ff0000&gt; FontFamily&lt;/font&gt;&lt;font color=#0000ff&gt;="{&lt;/font&gt;&lt;font color=#a31515&gt;Binding&lt;/font&gt;&lt;font color=#ff0000&gt; oFontFamily&lt;/font&gt;&lt;font color=#0000ff&gt;}"
&lt;/p&gt;
&gt; 
&lt;p&gt;
After that change when you vary the FontSize Slider, the text size changes everywhere
on the Page, not just in the lower half. We are still using the "binding-relay" object,
but now it is unnecessary to duplicate the same binding XAML on every target element.
&lt;/p&gt;
&lt;p&gt;
Alan Cobb
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=ba5c10b9-5c10-4285-af2a-eca6502c8e8f" /&gt;</description>
      <comments>http://www.alancobb.com/blog/CommentView,guid,ba5c10b9-5c10-4285-af2a-eca6502c8e8f.aspx</comments>
      <category>data binding</category>
      <category>Silverlight</category>
    <feedburner:origLink>http://www.alancobb.com/blog/2008/07/17/ChangingSilverlightPropertiesDynamicallyWithABindingrelayObject.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.alancobb.com/blog/Trackback.aspx?guid=42a03f28-736e-400b-988f-3b4078d97f38</trackback:ping>
      <pingback:server>http://www.alancobb.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.alancobb.com/blog/PermaLink,guid,42a03f28-736e-400b-988f-3b4078d97f38.aspx</pingback:target>
      <dc:creator>Alan Cobb</dc:creator>
      <wfw:comment>http://www.alancobb.com/blog/CommentView,guid,42a03f28-736e-400b-988f-3b4078d97f38.aspx</wfw:comment>
      <wfw:commentRss>http://www.alancobb.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=42a03f28-736e-400b-988f-3b4078d97f38</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A great tool for debugging Silverlight 2 cross-domain problems is the free "debugging
proxy" tool called <a href="http://www.fiddler2.com/fiddler2/">Fiddler</a>. 
Fiddler acts like an "HTTP sniffer".  It lets you watch as your browser has HTTP-conversations
with servers.  This post is a very brief example of using Fiddler to "spy" on
Silverlight 2 as it looks for cross-domain policy files.  For the demo I'm using <a href="http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx">ScottGu's
Silverlight 2 Digg client demo</a>.  Scott now has downloadable Silverlight 2
sources for his demo <a href="http://www.scottgu.com/blogposts/slbeta1apps/diggsample.zip">here</a>.
(I did a translation to WPF in a previous <a href="http://www.alancobb.com/blog/2008/02/26/TranslatingScottGusSilverlightDiggClientToWPF.aspx">blog
article</a>.)
</p>
        <p>
If you download and build Scott's SL2 demo and have Fiddler installed, you should
be able to capture a "trace" of the HTTP requests made by Silverlight to the
Digg site, and the responses.  In the attached screen capture of Fiddler you
can see Silverlight first try to open clientaccesspolicy.xml from Digg's site and
fail, but then try and succeed to open crossdomain.xml.  You can also see the
contents of crossdomain.xml that were returned.  The '*' is allowing any domain
to call Digg's APIs.
</p>
        <p>
          <img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/SilverlightCrossDomainDebuggingWithFiddler_ScreenShot_650wide.png" />
        </p>
        <p>
When it comes to testing some unknown site to see if it has cross-domain policy files,
one technique is to just hit that domain with your browser and see if it can find
those files.  For example, if you type this URI into the browser: <a href="http://services.digg.com/crossdomain.xml">http://services.digg.com/crossdomain.xml</a>,
the browser will successfully find it and show you its contents.  So their "welcome"
sign has been lit.
</p>
        <p>
          <img src="http://www.alancobb.com/blog/content/binary/SilverlightCrossDomainDebuggingWithFiddler_TestingForPolicyFileWithBrowser.jpg" />
        </p>
        <p>
Alan Cobb
</p>
        <img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=42a03f28-736e-400b-988f-3b4078d97f38" />
      </body>
      <title>How to debug Silverlight 2 cross-domain problems with Fiddler </title>
      <guid isPermaLink="false">http://www.alancobb.com/blog/PermaLink,guid,42a03f28-736e-400b-988f-3b4078d97f38.aspx</guid>
      <link>http://feedproxy.google.com/~r/AlanCobb/~3/0dPDyl6IBXk/HowToDebugSilverlight2CrossdomainProblemsWithFiddler.aspx</link>
      <pubDate>Wed, 26 Mar 2008 23:23:09 GMT</pubDate>
      <description>&lt;p&gt;
A great tool for debugging Silverlight 2 cross-domain problems is the free "debugging
proxy" tool called &lt;a href="http://www.fiddler2.com/fiddler2/"&gt;Fiddler&lt;/a&gt;.&amp;nbsp;
Fiddler acts like an "HTTP sniffer".&amp;nbsp; It lets you watch as your browser has&amp;nbsp;HTTP-conversations
with servers.&amp;nbsp; This post is a very brief example of using Fiddler to "spy" on
Silverlight 2 as it looks for cross-domain policy files.&amp;nbsp; For the demo I'm using &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx"&gt;ScottGu's
Silverlight 2 Digg client demo&lt;/a&gt;.&amp;nbsp; Scott now has downloadable Silverlight 2
sources for his demo &lt;a href="http://www.scottgu.com/blogposts/slbeta1apps/diggsample.zip"&gt;here&lt;/a&gt;.
(I did&amp;nbsp;a translation to WPF in a previous &lt;a href="http://www.alancobb.com/blog/2008/02/26/TranslatingScottGusSilverlightDiggClientToWPF.aspx"&gt;blog
article&lt;/a&gt;.)
&lt;/p&gt;
&lt;p&gt;
If you download and build Scott's SL2 demo and have Fiddler installed, you should
be able to capture a "trace" of the HTTP requests&amp;nbsp;made by Silverlight to the
Digg site, and the responses.&amp;nbsp; In the attached screen capture of Fiddler you
can see Silverlight first try to open clientaccesspolicy.xml from Digg's site and
fail, but then try and succeed to open crossdomain.xml.&amp;nbsp; You can also see the
contents of crossdomain.xml that were returned.&amp;nbsp; The '*' is allowing any domain
to call Digg's APIs.
&lt;/p&gt;
&lt;p&gt;
&lt;img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" src="http://www.alancobb.com/blog/content/binary/SilverlightCrossDomainDebuggingWithFiddler_ScreenShot_650wide.png"&gt;
&lt;/p&gt;
&lt;p&gt;
When it comes to testing some unknown site to see if it has cross-domain policy files,
one technique is to just hit that domain with your browser and see if it can find
those files.&amp;nbsp; For example, if you type this URI into the browser: &lt;a href="http://services.digg.com/crossdomain.xml"&gt;http://services.digg.com/crossdomain.xml&lt;/a&gt;,
the browser will successfully find it and show you its contents.&amp;nbsp; So their "welcome"
sign has been lit.
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.alancobb.com/blog/content/binary/SilverlightCrossDomainDebuggingWithFiddler_TestingForPolicyFileWithBrowser.jpg"&gt;
&lt;/p&gt;
&lt;p&gt;
Alan Cobb
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=42a03f28-736e-400b-988f-3b4078d97f38" /&gt;</description>
      <comments>http://www.alancobb.com/blog/CommentView,guid,42a03f28-736e-400b-988f-3b4078d97f38.aspx</comments>
    <feedburner:origLink>http://www.alancobb.com/blog/2008/03/26/HowToDebugSilverlight2CrossdomainProblemsWithFiddler.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.alancobb.com/blog/Trackback.aspx?guid=6f44f36a-c494-48e2-9fc5-618feb0a3c7c</trackback:ping>
      <pingback:server>http://www.alancobb.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.alancobb.com/blog/PermaLink,guid,6f44f36a-c494-48e2-9fc5-618feb0a3c7c.aspx</pingback:target>
      <dc:creator>Alan Cobb</dc:creator>
      <wfw:comment>http://www.alancobb.com/blog/CommentView,guid,6f44f36a-c494-48e2-9fc5-618feb0a3c7c.aspx</wfw:comment>
      <wfw:commentRss>http://www.alancobb.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=6f44f36a-c494-48e2-9fc5-618feb0a3c7c</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'm doing an <a href="https://www.cmpevents.com/SDw8/a.asp?option=C&amp;V=11&amp;SessID=7010">"Introduction
to Silverlight"</a> presentation tomorrow (2008-Mar-07) at SD-West-2008 in Santa Clara,
California focusing on the .NET based Silverlight 2.
</p>
        <p>
Here are my PowerPoint <a href="http://www.alancobb.com/blog/content/binary/Cobb_Alan_IntroductionToSilverlight_CD-v09-SD-West-2008--2008-Mar-07.ppt">slides</a> (5.3MB).
</p>
        <p>
Alan Cobb
</p>
        <img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=6f44f36a-c494-48e2-9fc5-618feb0a3c7c" />
      </body>
      <title>SD-West-2008 PPT Slides for My "Introduction to Silverlight" Presentation</title>
      <guid isPermaLink="false">http://www.alancobb.com/blog/PermaLink,guid,6f44f36a-c494-48e2-9fc5-618feb0a3c7c.aspx</guid>
      <link>http://feedproxy.google.com/~r/AlanCobb/~3/FVV4r_9oMDQ/SDWest2008PPTSlidesForMyIntroductionToSilverlightPresentation.aspx</link>
      <pubDate>Fri, 07 Mar 2008 03:14:00 GMT</pubDate>
      <description>&lt;p&gt;
I'm doing an &lt;a href="https://www.cmpevents.com/SDw8/a.asp?option=C&amp;amp;V=11&amp;amp;SessID=7010"&gt;"Introduction
to Silverlight"&lt;/a&gt; presentation tomorrow (2008-Mar-07) at SD-West-2008 in Santa Clara,
California&amp;nbsp;focusing on the&amp;nbsp;.NET based Silverlight 2.
&lt;/p&gt;
&lt;p&gt;
Here are&amp;nbsp;my PowerPoint &lt;a href="http://www.alancobb.com/blog/content/binary/Cobb_Alan_IntroductionToSilverlight_CD-v09-SD-West-2008--2008-Mar-07.ppt"&gt;slides&lt;/a&gt; (5.3MB).
&lt;/p&gt;
&lt;p&gt;
Alan Cobb
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=6f44f36a-c494-48e2-9fc5-618feb0a3c7c" /&gt;</description>
      <comments>http://www.alancobb.com/blog/CommentView,guid,6f44f36a-c494-48e2-9fc5-618feb0a3c7c.aspx</comments>
      <category>Silverlight</category>
    <feedburner:origLink>http://www.alancobb.com/blog/2008/03/07/SDWest2008PPTSlidesForMyIntroductionToSilverlightPresentation.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.alancobb.com/blog/Trackback.aspx?guid=0f4d7080-5fac-4475-bc43-53869512a500</trackback:ping>
      <pingback:server>http://www.alancobb.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.alancobb.com/blog/PermaLink,guid,0f4d7080-5fac-4475-bc43-53869512a500.aspx</pingback:target>
      <dc:creator>Alan Cobb</dc:creator>
      <wfw:comment>http://www.alancobb.com/blog/CommentView,guid,0f4d7080-5fac-4475-bc43-53869512a500.aspx</wfw:comment>
      <wfw:commentRss>http://www.alancobb.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0f4d7080-5fac-4475-bc43-53869512a500</wfw:commentRss>
      <slash:comments>8</slash:comments>
      <title>Translating ScottGu’s Silverlight “Digg Client” to WPF</title>
      <guid isPermaLink="false">http://www.alancobb.com/blog/PermaLink,guid,0f4d7080-5fac-4475-bc43-53869512a500.aspx</guid>
      <link>http://feedproxy.google.com/~r/AlanCobb/~3/V1ZGNv3qqy4/TranslatingScottGusSilverlightDiggClientToWPF.aspx</link>
      <pubDate>Tue, 26 Feb 2008 23:01:07 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;As Jesse Liberty has &lt;a href="http://silverlight.net/blogs/jesseliberty/archive/2008/02/24/learning-silverlight-2-more-things-you-can-do-today.aspx"&gt;suggested&lt;/a&gt;,
since the Silverlight 2 beta has not yet been released I decided to do a WPF implementation
of ScottGu’s excellent Silverlight 2 &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx"&gt;“Digg
client” tutorial&lt;/a&gt; (thanks Scott!).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;It
turned out to be a bit harder than I expected, but I did learn things.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Below
I list the changes I had to make to translate Scott’s Silverlight 2 app to WPF.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Scott
already lists some of these in &lt;a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-8-creating-a-digg-desktop-application-using-wpf.aspx"&gt;step
8&lt;/a&gt; of his tutorial.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;You can download my working &lt;a href="http://www.alancobb.com/blog/content/binary/WpfDiggClient-TranslationToWpfOfScottGuDiggSample.zip"&gt;WPF
VS-2008 solution here&lt;/a&gt;.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Arial&gt;&lt;strong&gt;Converting to a WPF “Navigation App”:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;To create a browser-like experience similar to Silverlight
I wrote my version as a WPF “navigation app”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Another
way would be as an XBAP, but since Scott used a full WPF desktop app, so did I.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;To
make it a WPF “navigation app” I had to replace Scott’s outer Window with a NavigationWindow.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Scott’s
original Silverlight UserControl subclass has the name Page, but WPF already has a
general Page class used by navigation apps.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Therefore
I replaced his UserControl base class with a WPF Page base class, and named the derived
class Page1.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;img src="http://www.alancobb.com/blog/content/binary/WpfDiggClient-ListOfStoriesView.jpg"&gt;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&lt;/font&gt;
&lt;/o:p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Arial&gt;&lt;strong&gt;Emulating Silverlight 2’s HyperlinkButton:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Arial&gt;Since WPF does not have an exact equivalent of
Silverlight 2’s HyperlinkButton class, Scott replaces it with a TextBlock.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I’m
not sure if Scott wrote the extra WPF code to do it, but I decided to make the TextBlock
actually behave like a “hyperlink”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Therefore
when clicked it must actually navigate to the target HTML page, and it must expose
bindable dependency properties (DPs) that emulate HyperlinkButton’s DPs.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I
ended up creating a UserControl called HyperlinkButton_ForWPF to encapsulate this
functionality and wrap the TextBlock.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;To support data binding I needed to add two custom
DPs to HyperlinkButton_ForWPF: Content2 and NavigateUri.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Why
call it Content2 and not Content like Silverlight does?&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Because
UserControl already has a DP named Content.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;There
might be a way to “repurpose” the UserControl.Content DP, but the things I tried didn’t
work, so I just added the custom Content2 DP instead.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Arial&gt;Once the HyperlinkButton_ForWPF was working,
I was able to click on the title text for an individual Digg HTML article and have
the outer NavigationWindow get filled with that HTML page.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Initially
pressing the back button did return me to the original Page, but all the existing
Digg content was gone.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;That is the&amp;nbsp;default
behavior of a WPF navigation app.&amp;nbsp; It recreates each page from scratch whenever
it is reentered.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;But we want the
state of the Page saved, so that we don’t need to requery Digg each time.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;By
setting Page.KeepAlive to true, we get the desired state-retaining behavior.&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Arial&gt;&lt;img src="http://www.alancobb.com/blog/content/binary/WpfDiggClient-StoryDetailsView-WithEmulatedHyperlinkButton.jpg"&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Arial&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Arial&gt;&lt;img src="http://www.alancobb.com/blog/content/binary/WpfDiggClient-ViewingOneHTMLStory.jpg"&gt;&amp;nbsp;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Arial&gt;&lt;strong&gt;Calling the Digg Web API:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;Scott uses a WebClient object to query the Digg web
API.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I needed to make several changes
before it would work correctly under WPF.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The
original version&amp;nbsp;returned HTTP error code 403 in response to my queries.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Digg’s
documentation says that our HTTP query request must include a User-Agent HTTP Header.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Adding
that fixed the 403 errors.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Another problem
was that apostrophes in stories were displayed with&amp;nbsp;strange characters.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The
fix for that was to explicitly tell the WebClient object to assume UTF-8 encoding.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;I modified Scott’s original Digg query a little also.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Instead
of just requesting 20 random stories from a given topic (/stories/topic/{topic name}),
I used a different endpoint (/stories/topic/{topic name}/popular).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The
added &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;“popular” part asks for the most
popular stories.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I also added a “sort”
parameter, so the most popular stories are at the top of&amp;nbsp;the list.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;By
the way, there are only about 50 “topics” that this endpoint queries for, so don’t
expect to be able to put any arbitrary phrase in the search box (as if it were Google).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The
list of topics is here: &lt;/font&gt;&lt;a href="http://apidoc.digg.com/Topics"&gt;&lt;font face=Arial&gt;http://apidoc.digg.com/Topics&lt;/font&gt;&lt;/a&gt;&lt;font color=#000000&gt;&lt;font face=Arial&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;For
example, “basketball”, “microsoft” or “music”.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;What was my conclusion from all this?&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;That
it will be great when we actually get the real Silverlight 2 beta to play with, rather
than trying to approximate it :).&lt;br&gt;
&lt;br&gt;
Alan Cobb&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=0f4d7080-5fac-4475-bc43-53869512a500" /&gt;</description>
      <comments>http://www.alancobb.com/blog/CommentView,guid,0f4d7080-5fac-4475-bc43-53869512a500.aspx</comments>
      <category>Silverlight</category>
      <category>WPF</category>
    <feedburner:origLink>http://www.alancobb.com/blog/2008/02/26/TranslatingScottGusSilverlightDiggClientToWPF.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.alancobb.com/blog/Trackback.aspx?guid=ca63d35a-31f1-4bea-80a5-24ed594b41a7</trackback:ping>
      <pingback:server>http://www.alancobb.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.alancobb.com/blog/PermaLink,guid,ca63d35a-31f1-4bea-80a5-24ed594b41a7.aspx</pingback:target>
      <dc:creator>Alan Cobb</dc:creator>
      <wfw:comment>http://www.alancobb.com/blog/CommentView,guid,ca63d35a-31f1-4bea-80a5-24ed594b41a7.aspx</wfw:comment>
      <wfw:commentRss>http://www.alancobb.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ca63d35a-31f1-4bea-80a5-24ed594b41a7</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The main point of this article is to make my reformatted, more debuggable version
of Silverlight available to other people for download:
</p>
        <p>
      For 2007-09 v1.0 SDK:  <a href="http://www.alancobb.com/pub2/SilverlightDebuggingTalk/Silverlight_DebugPretty_V10.js">Silverlight_DebugPretty_V10.js</a> <br />
      For 2007-09 v1.1 SDK:  <a href="http://www.alancobb.com/pub2/SilverlightDebuggingTalk/Silverlight_DebugPretty_V11.js">Silverlight_DebugPretty_V11.js</a><br /><br /><strong>Background and explanation:<br /></strong>As you probably know, <a href="http://msdn2.microsoft.com/en-us/library/bb412401.aspx">Silverlight.js</a> is
a helper file that all Silverlight applications are required to use when starting
up.  To make it download faster it has been "<a href="http://en.wikipedia.org/wiki/Minify">minified</a>"
into a single line of JavaScript 7000+ characters long.  That's OK for production
use, but it makes the source code unusable for debugging.  For debugging you
want to be able to use Visual Studio to single step through readable, understandable
source code and look at variable values and stack traces.<br /><br /><img src="http://www.alancobb.com/blog/content/binary/VSScreen_StockOneLineSilverlightJs.jpg" /><br /></p>
        <p>
The 2007-07 version of the Silverlight SDK included such a reformatted Silverlight.js
(even including some descriptive comments [gasp!]), but I couldn't find one in the
2007-09 versions of the SDK.  So I made the ones linked to above.  
</p>
        <p>
          <img src="http://www.alancobb.com/blog/content/binary/VSScreen_Reformatted400LineSilverlightJs.jpg" />
        </p>
        <p>
To do the reformatting ("pretty printing") I started with a free trial copy of the
commercial <a href="http://www.polystyle.com/">Polystyle</a> code-reformatter
product.  That turned the single JavaScript line into about 400 readable lines,
with proper indenting.  I followed that with a little hand editing to visually
separate the individual methods with lines of asterisks.  One could go even further
and add some descriptive comments.<br /><br />
Once you are a old hand at JavaScript and Silverlight you probably won't spend much
time looking at Silverlight.js.  But if you are like me, with a background in
C# and C++ you may initially find JavaScript's behavior somewhat "odd" and mysterious. 
It can be instructive to single step through the startup code in Silverlight.js. 
See how one of the first steps is to "instantiate" all the methods of the Silverlight
object so they can be called later?
</p>
        <p>
          <strong>Minification and obfuscation:</strong>
          <br />
I found out via petemounce on the Silverlight Forum (see: <a href="http://silverlight.net/forums/t/5697.aspx">http://silverlight.net/forums/t/5697.aspx</a>)
that there are tools available specifically for the task of minimizing the size of
("<a href="http://en.wikipedia.org/wiki/Minify">minifying</a>") your JavaScript or
HTML.  See: <a href="http://www.julienlecomte.net/blog/2007/08/13/introducing-the-yui-compressor/">http://www.julienlecomte.net/blog/2007/08/13/introducing-the-yui-compressor/</a></p>
        <p>
This is closely related to the task of obfuscation, in which you try to make your
code harder to reverse engineer.  Deliberately debugger-unfriendly.  See: <a href="http://yuiblog.com/blog/2006/03/06/minification-v-obfuscation/">http://yuiblog.com/blog/2006/03/06/minification-v-obfuscation/</a></p>
        <img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=ca63d35a-31f1-4bea-80a5-24ed594b41a7" />
      </body>
      <title>A more debuggable Silverlight.js :</title>
      <guid isPermaLink="false">http://www.alancobb.com/blog/PermaLink,guid,ca63d35a-31f1-4bea-80a5-24ed594b41a7.aspx</guid>
      <link>http://feedproxy.google.com/~r/AlanCobb/~3/e6QtDdsFaOk/AMoreDebuggableSilverlightjs.aspx</link>
      <pubDate>Sun, 21 Oct 2007 02:40:44 GMT</pubDate>
      <description>&lt;p&gt;
The main point of this article is to make my reformatted, more debuggable version
of Silverlight available to other people for download:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;For 2007-09 v1.0 SDK:&amp;nbsp; &lt;a href="http://www.alancobb.com/pub2/SilverlightDebuggingTalk/Silverlight_DebugPretty_V10.js"&gt;Silverlight_DebugPretty_V10.js&lt;/a&gt;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;For 2007-09 v1.1 SDK:&amp;nbsp; &lt;a href="http://www.alancobb.com/pub2/SilverlightDebuggingTalk/Silverlight_DebugPretty_V11.js"&gt;Silverlight_DebugPretty_V11.js&lt;/a&gt; 
&lt;br&gt;
&lt;br&gt;
&lt;strong&gt;Background and explanation:&lt;br&gt;
&lt;/strong&gt;As you probably know, &lt;a href="http://msdn2.microsoft.com/en-us/library/bb412401.aspx"&gt;Silverlight.js&lt;/a&gt; is
a helper file that all Silverlight applications are required to use when starting
up.&amp;nbsp; To make it download faster it has been "&lt;a href="http://en.wikipedia.org/wiki/Minify"&gt;minified&lt;/a&gt;"
into a single line of JavaScript 7000+ characters long.&amp;nbsp; That's OK for production
use, but it makes the source code unusable for debugging.&amp;nbsp; For debugging you
want to be able to use Visual Studio to single step through readable, understandable
source code and look at variable values and stack traces.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.alancobb.com/blog/content/binary/VSScreen_StockOneLineSilverlightJs.jpg"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
The 2007-07 version of the Silverlight SDK included such a reformatted Silverlight.js
(even including some descriptive comments [gasp!]), but I couldn't find one in the
2007-09 versions of the SDK.&amp;nbsp; So I made the ones linked to above.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.alancobb.com/blog/content/binary/VSScreen_Reformatted400LineSilverlightJs.jpg"&gt;
&lt;/p&gt;
&lt;p&gt;
To do the reformatting ("pretty printing") I started with a free trial copy of the
commercial &lt;a href="http://www.polystyle.com/"&gt;Polystyle&lt;/a&gt;&amp;nbsp;code-reformatter
product.&amp;nbsp; That turned the single JavaScript line into about 400 readable lines,
with proper indenting.&amp;nbsp; I followed that with a little hand editing to visually
separate the individual methods with lines of asterisks.&amp;nbsp; One could go even further
and add some descriptive comments.&lt;br&gt;
&lt;br&gt;
Once you are a old hand at JavaScript and Silverlight you probably won't spend much
time looking at Silverlight.js.&amp;nbsp; But if you are like me, with a background in
C# and C++ you may initially find JavaScript's behavior somewhat "odd" and mysterious.&amp;nbsp;
It can be instructive to single step through the startup code in Silverlight.js.&amp;nbsp;
See how one of the first steps is to "instantiate" all the methods of the Silverlight
object so they can be called later?
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Minification and obfuscation:&lt;/strong&gt;
&lt;br&gt;
I found out via petemounce on the Silverlight Forum (see: &lt;a href="http://silverlight.net/forums/t/5697.aspx"&gt;http://silverlight.net/forums/t/5697.aspx&lt;/a&gt;)
that there are tools available specifically for the task of minimizing the size of
("&lt;a href="http://en.wikipedia.org/wiki/Minify"&gt;minifying&lt;/a&gt;") your JavaScript or
HTML.&amp;nbsp; See: &lt;a href="http://www.julienlecomte.net/blog/2007/08/13/introducing-the-yui-compressor/"&gt;http://www.julienlecomte.net/blog/2007/08/13/introducing-the-yui-compressor/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
This is closely related to the task of obfuscation, in which you try to make your
code harder to reverse engineer.&amp;nbsp; Deliberately debugger-unfriendly.&amp;nbsp; See: &lt;a href="http://yuiblog.com/blog/2006/03/06/minification-v-obfuscation/"&gt;http://yuiblog.com/blog/2006/03/06/minification-v-obfuscation/&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=ca63d35a-31f1-4bea-80a5-24ed594b41a7" /&gt;</description>
      <comments>http://www.alancobb.com/blog/CommentView,guid,ca63d35a-31f1-4bea-80a5-24ed594b41a7.aspx</comments>
      <category>Silverlight</category>
      <category>debugging</category>
    <feedburner:origLink>http://www.alancobb.com/blog/2007/10/21/AMoreDebuggableSilverlightjs.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.alancobb.com/blog/Trackback.aspx?guid=0ab4d5ad-5b47-4bb0-a0f0-ee3e759d3a5e</trackback:ping>
      <pingback:server>http://www.alancobb.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.alancobb.com/blog/PermaLink,guid,0ab4d5ad-5b47-4bb0-a0f0-ee3e759d3a5e.aspx</pingback:target>
      <dc:creator>Alan Cobb</dc:creator>
      <wfw:comment>http://www.alancobb.com/blog/CommentView,guid,0ab4d5ad-5b47-4bb0-a0f0-ee3e759d3a5e.aspx</wfw:comment>
      <wfw:commentRss>http://www.alancobb.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0ab4d5ad-5b47-4bb0-a0f0-ee3e759d3a5e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hi,
</p>
        <p>
This is my new blog.  Interesting Silverlight, WPF and .NET technical content
to follow...
</p>
        <p>
          <strong>Regarding how this blog was designed and implemented:</strong>
          <br />
My visual design priorities for this site's HTML/CSS were a liquid layout and
good tolerance of text resizing.  Similar to <a href="http://news.google.com">http://news.google.com</a>.
</p>
        <p>
As the footer shows, this blog is currently implemented with dasBlog 2.x running on
ASP.NET 2.0.  I'm currently hosted on GoDaddy and happy with them.  To get
the visual look and liquid resizing behavior I wanted, I needed to modify some of
dasBlog's ASP.NET C# code as well as the page templates and CSS.
</p>
        <p>
Alan Cobb
</p>
        <img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=0ab4d5ad-5b47-4bb0-a0f0-ee3e759d3a5e" />
      </body>
      <title>First entry for Alan Cobb's new blog (Done 2007-10-03)</title>
      <guid isPermaLink="false">http://www.alancobb.com/blog/PermaLink,guid,0ab4d5ad-5b47-4bb0-a0f0-ee3e759d3a5e.aspx</guid>
      <link>http://feedproxy.google.com/~r/AlanCobb/~3/uQ7xNlu6tiI/FirstEntryForAlanCobbsNewBlogDone20071003.aspx</link>
      <pubDate>Wed, 03 Oct 2007 18:56:22 GMT</pubDate>
      <description>&lt;p&gt;
Hi,
&lt;/p&gt;
&lt;p&gt;
This is my new blog.&amp;nbsp; Interesting Silverlight, WPF and .NET technical content
to follow...
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Regarding how this blog was designed and implemented:&lt;/strong&gt;
&lt;br&gt;
My visual design priorities for this site's HTML/CSS were a&amp;nbsp;liquid layout and
good tolerance of text resizing.&amp;nbsp; Similar to &lt;a href="http://news.google.com"&gt;http://news.google.com&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
As the footer shows, this blog is currently implemented with dasBlog 2.x running on
ASP.NET 2.0.&amp;nbsp; I'm currently hosted on GoDaddy and happy with them.&amp;nbsp; To get
the visual look and liquid resizing behavior I wanted, I needed to modify some of
dasBlog's ASP.NET C# code as well as the page templates and CSS.
&lt;/p&gt;
&lt;p&gt;
Alan Cobb
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.alancobb.com/blog/aggbug.ashx?id=0ab4d5ad-5b47-4bb0-a0f0-ee3e759d3a5e" /&gt;</description>
      <comments>http://www.alancobb.com/blog/CommentView,guid,0ab4d5ad-5b47-4bb0-a0f0-ee3e759d3a5e.aspx</comments>
      <category>dasBlog</category>
    <feedburner:origLink>http://www.alancobb.com/blog/2007/10/03/FirstEntryForAlanCobbsNewBlogDone20071003.aspx</feedburner:origLink></item>
  </channel>
</rss>
