<?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:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>The Digital Lifestyle Developer Blog</title><link>http://thedigitallifestyle.com/cs/blogs/developer/default.aspx</link><description>Windows Media Center development hints, tips, tutorials and information</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/TheDigitalLifestyleDeveloperBlog" type="application/rss+xml" /><item><title>Not The Only One</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/9Cd5HzPeqSU/not-the-only-one.aspx</link><pubDate>Thu, 04 Dec 2008 23:10:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:10995</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=10995</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/12/05/not-the-only-one.aspx#comments</comments><description>&lt;p&gt;Looks like I&amp;#39;m not the only one experiencing erratic wakeup issues&amp;nbsp;after the installation of the&amp;nbsp;TV Pack:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://thegreenbutton.com/forums/8/286420/ShowThread.aspx"&gt;http://thegreenbutton.com/forums/8/286420/ShowThread.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Looks like&amp;nbsp;a major glitch in the pack, but one that hasn&amp;#39;t had too much official response as yet. Has anyone else out there found a similar problem? Perhaps we can band together and solve whatever this issue is.&lt;/p&gt;
&lt;p&gt;Also, I&amp;#39;m currently searching for work (I&amp;#39;m not out of work - just looking at a change of scene). If anyone is interested in a Media Center, C++ or C# developer and is ideally Australian based, please let me know!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=10995" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/129-5j9DwRCd-91sPIeTg-BV0dg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/129-5j9DwRCd-91sPIeTg-BV0dg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/129-5j9DwRCd-91sPIeTg-BV0dg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/129-5j9DwRCd-91sPIeTg-BV0dg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/9Cd5HzPeqSU" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/12/05/not-the-only-one.aspx</feedburner:origLink></item><item><title>Look Ma, No Buttons!</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/rSe9HTW-I2g/look-ma-no-buttons.aspx</link><pubDate>Tue, 02 Dec 2008 21:33:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:10714</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=10714</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/12/03/look-ma-no-buttons.aspx#comments</comments><description>&lt;p&gt;A user of EMUCenter showed me his new Media Center remote a few days ago on my forums, and I discovered that Microsoft has left out the &amp;#39;#&amp;#39; and &amp;#39;*&amp;#39; buttons on the latest generation of their control.&lt;/p&gt;
&lt;p&gt;Of course, MS has always stated that there is no guarantee that those particular buttons will be present. But this leaves us with a dilemma.&lt;/p&gt;
&lt;p&gt;There are now basically no &amp;#39;spare&amp;#39; buttons present on the remote control. If we need to create a context menu (or a &amp;#39;more&amp;#39;&amp;nbsp;menu, like right-clicking on an icon in Windows) we are presented with a problem - which button on the remote can we override?&lt;/p&gt;
&lt;p&gt;The ideal button is &amp;#39;i&amp;#39;, but unfortunately MS has restricted this. We can&amp;#39;t override it. I used to use &amp;#39;#&amp;#39; and &amp;#39;*&amp;#39; extensively, but now they aren&amp;#39;t present in new remotes. My applications often use the text buttons, so the numbers are off limits, so are all the &amp;#39;play&amp;#39; buttons (eg. skip forward etc.) because someone may be watching media while accessing the application. &lt;/p&gt;
&lt;p&gt;So...are there any more options?&lt;/p&gt;
&lt;p&gt;At the end of the day, the answer is basically &amp;#39;no&amp;#39;. Which means we either severely limit our applications to suit this situation, or we have to put in a little extra work. I&amp;#39;m going to detail my current &amp;#39;suggestion&amp;#39; for how to take care of this problem. I have chosen to replace a seperate button with a&amp;nbsp;&lt;strong&gt;press and hold&lt;/strong&gt;. So we simply hold the &amp;#39;Select&amp;#39; button down for a&amp;nbsp;second or so&amp;nbsp;in order to bring up my context menus.&lt;/p&gt;
&lt;p&gt;One major caveat - this solution does NOT work for mouse input due to the fact that there is very little mouse monitoring available in Media Center. We can still respond to a click as per normal, but we can&amp;#39;t capture a click-and-hold or a right-click.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The biggest problem is that this involves a significantly more complicated setup, because the &amp;#39;Clicked&amp;#39; member of the &amp;#39;ClickHandler&amp;#39; class only responds to the user&amp;nbsp;&lt;strong&gt;releasing&lt;/strong&gt; the button. We can&amp;#39;t capture the start of the button press. So we basically have to throw out &amp;#39;ClickHandler&amp;#39; and replace it with something else. &lt;/p&gt;
&lt;p&gt;A suitable handler is &amp;#39;KeyHandler&amp;#39;. But with a KeyHandler, we can&amp;#39;t capture mouse input - which causes the issue with the mouse that I explained earlier.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, we need...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; A &lt;strong&gt;KeyHandler&lt;/strong&gt; to handle the &amp;#39;Space&amp;#39; button.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; A &lt;strong&gt;KeyHandler&lt;/strong&gt; to handle the &amp;#39;Enter&amp;#39; button.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; A &lt;strong&gt;ClickHandler&lt;/strong&gt; to handle mouse input.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; A &lt;strong&gt;Timer&lt;/strong&gt; to gauge the amount of time our button has been held.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&lt;strong&gt;Bool&lt;/strong&gt; to set if the timer has expired.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;These can be created as locals...&lt;/p&gt;
&lt;p&gt;&amp;lt;Locals&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;ClickHandler Name=&amp;quot;MouseHandler&amp;quot; HandleEnterSpaceKeys=&amp;quot;false&amp;quot; HandlerStage=&amp;quot;Bubbled&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;KeyHandler Name=&amp;quot;SpaceHandler&amp;quot; Key=&amp;quot;Space&amp;quot; Handle=&amp;quot;true&amp;quot; HandlerStage=&amp;quot;Bubbled&amp;quot; Repeat=&amp;quot;false&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;KeyHandler Name=&amp;quot;EnterHandler&amp;quot; Key=&amp;quot;Enter&amp;quot; Handle=&amp;quot;true&amp;quot; HandlerStage=&amp;quot;Bubbled&amp;quot; Repeat=&amp;quot;false&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Timer Name=&amp;quot;PressTimer&amp;quot; Key=&amp;quot;Space&amp;quot; Handle=&amp;quot;true&amp;quot; HandlerStage=&amp;quot;Bubbled&amp;quot; Interval=&amp;quot;1000&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;cor:Bool Name=&amp;quot;TimerExpired&amp;quot; Bool=&amp;quot;false&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Locals&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, the first step is to recognise that our button has been pressed. We will do this with the Space handler, to begin with.&lt;/p&gt;
&lt;p&gt;Unlike the ClickHandler.Clicked, SpaceHandler.Pressed turns on the moment we press the button, and because we have disabled &amp;#39;Repeat&amp;#39; when we declared it, it will STAY on for as long as the user holds down the button.&lt;/p&gt;
&lt;p&gt;&amp;lt;Rules&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Changed Source=&amp;quot;[SpaceHandler.Pressed]&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Changed&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Rules&amp;gt;&lt;/p&gt;
&lt;p&gt;This will capture when the space-bar is pressed. But this is a &lt;strong&gt;changed&lt;/strong&gt; condition, which means that it will be fired both when the button is pressed, and when the button is released. So in order to ensure the button is being pressed, we need to add a &lt;em&gt;condition&lt;/em&gt; to the rule.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Conditions&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Equality Source=&amp;quot;[SpaceHandler.Pressed]&amp;quot; Value=&amp;quot;true&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Conditions&amp;gt;&lt;/p&gt;
&lt;p&gt;And finally, we need to turn on the timer.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Actions&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target=&amp;quot;[TimerExpired]&amp;quot; Value=&amp;quot;false&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target=&amp;quot;[PressTimer.Enabled]&amp;quot; Value=&amp;quot;true&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Actions&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There. The next step is to handle the timer &amp;#39;ticking&amp;#39; to indicate that we have been holding for long enough. Our first step is to deactivate the timer, then we set the boolean Local we created.&lt;/p&gt;
&lt;p&gt;&amp;lt;Changed Target=&amp;quot;[PressTimer.Tick]&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Actions&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target=&amp;quot;[PressTimer.Enabled]&amp;quot; Value=&amp;quot;false&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target=&amp;quot;[TimerExpired]&amp;quot; Value=&amp;quot;true&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Actions&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Changed&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Finally, we need to respond to the release of the button. We do this with the exact opposite statement to the one we used to detect the start of the click. &lt;/p&gt;
&lt;p&gt;Once we have created our rule, we then simply disable the timer (when the timer has not yet expired) and perform any actions required.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Changed Source=&amp;quot;[SpaceHandler.Pressed]&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Conditions&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Equality Source=&amp;quot;[SpaceHandler.Pressed]&amp;quot; Value=&amp;quot;&lt;strong&gt;false&lt;/strong&gt;&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Equality Source=&amp;quot;[TimerExpired]&amp;quot; Value=&amp;quot;&lt;strong&gt;false&lt;/strong&gt;&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Conditions&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Actions&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target=&amp;quot;[PressTimer.Enabled]&amp;quot; Value=&amp;quot;false&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;!--Do anything here you would do if the user gave a traditional click event. --&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Actions&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Changed&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are two options with how we behave. If we want to respond to our &amp;#39;held down&amp;#39; event immediately once the timer has expired (ie. it is bringing up your popup window immediately after 1 second, even if the user has their button still held down) - you do this by adding the action code to the &amp;#39;Tick&amp;#39; handler. The other method is to respond after the user releases the button, which you do by copying the above rule and changing the &amp;#39;TimerExpired&amp;#39; test to &amp;#39;false&amp;#39;.&lt;/p&gt;
&lt;p&gt;You can of course add any animations, sound effects etc. that you want to any of the rules above.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Another Quick Warning&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; If your popup/context menu contains elements that respond to a button press and you bring up the popup as part of the timer event (ie. as soon as the timer ticks, the popup appears), you&amp;#39;ll find the user still has their Select button pressed down. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; When the user RELEASES their select button, the ClickHandler on the currently selected item is triggered. This is BAD.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; I have an established work-around for this. I create a boolean property on my main Interface object called &amp;#39;StillHeldDown&amp;#39;. In the&amp;nbsp;rule that starts the timer, I set &amp;#39;StillHeldDown&amp;#39; to &amp;#39;true&amp;#39;, and turn it off in the rule that detects that the button was released early. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; In the &amp;#39;Clicked&amp;#39; rule within the UI items that are in my context menu, I check for &amp;#39;StillHeldDown&amp;#39;. If it&amp;#39;s &amp;#39;true&amp;#39;, I set it back to &amp;#39;false&amp;#39;. If it&amp;#39;s &amp;#39;false&amp;#39;, I do whatever I would normally do with a mouse click.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; This basically creates a buffer that &amp;#39;eats&amp;#39; the first Clicked event that occurs on the item&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=10714" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ns92nuGzZtZC_PJR3kBHJELI_zg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ns92nuGzZtZC_PJR3kBHJELI_zg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ns92nuGzZtZC_PJR3kBHJELI_zg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ns92nuGzZtZC_PJR3kBHJELI_zg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/rSe9HTW-I2g" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/12/03/look-ma-no-buttons.aspx</feedburner:origLink></item><item><title>TV Pack Installing &amp; Startup Issues</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/w3J73yfXZEE/tv-pack-installing-amp-startup-issues.aspx</link><pubDate>Sat, 15 Nov 2008 02:38:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:9780</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=9780</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/11/15/tv-pack-installing-amp-startup-issues.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Two things I&amp;#39;ll mention today - one is to do with development, one is a tip for those having trouble with Media Center startup since installing the TV Pack.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;Part 1 - Installing on Media Center with the TV Pack Installed&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;#39;Fiji&amp;#39; - or the Media Center TV Pack - is a MUST have for Media Center owners in Australia. I find it criminal that it&amp;#39;s only available to OEM&amp;#39;s, but on the other hand I can also see it breaking some peoples configurations, since you do need to scan for new channels, play with your lineup and it interrupts 3rd party Guide applications, which are required in this country.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Installing onto Fiji is done exactly the same way as usual (ie. using an installer based on the WiX example that comes with the Media Center SDK) - but there is a small glitch with the example.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; For Fiji, Microsoft changed the version number from 5.0 to 5.1 - and unfortunately, their example checks for a version number of &amp;#39;5.0&amp;#39;. This means that any installer based on the SDK example won&amp;#39;t install on Windows 7 or on the TV Pack.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; The easiest fix? Just delete the condition from your WiX file. Simply search for the text &amp;#39;5.0&amp;#39; and erase the condition. It appears in TWO different places in your installer, so make sure you get both.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Part 2 - Startup Issues Since Installing Media Center&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Since installing the TV pack myself, I&amp;#39;ve been having two issues. The first is that all of my TV-Pack equipped Vista PC&amp;#39;s are waking themselves up at approximately 4:00am, but that&amp;#39;s not the actual problem I&amp;#39;m discussing here.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; The problem I had is that Media Center was starting up when the &amp;#39;Welcome&amp;#39; screen was still showing. Technically, this sounds like a great idea since it should give you a seamless transition into Media Center after your machine starts up. Unfortunately, it was starting up so early that the video card didn&amp;#39;t seem to be ready for it (or appropriate drivers were not installed quite yet) meaning that I would get an error message and when Media Center finally DID turn up, it was in the ugly &amp;#39;GUI&amp;#39; mode (no smooth animations, glitchy playback etc.)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; How did I fix it? I grabbed a small utility called &amp;quot;Startup Delayer&amp;quot; from &amp;quot;r2 Studios&amp;quot;. I&amp;#39;m not going to rabbit on too long about it - this isn&amp;#39;t an ad - but it helped me resolve the problem by delaying the startup of Media Center until the Welcome screen had gone and my video drivers were fully up to speed. It also&amp;nbsp;improved my startup time slightly. If you are having a similar issue, try downloading it from &lt;a href="http://www.r2.com.au/software.php?page=2&amp;amp;show=startdelay"&gt;http://www.r2.com.au/software.php?page=2&amp;amp;show=startdelay&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=9780" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3jfBiT7nRzWAyRjt-lQ4ZGErmV4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3jfBiT7nRzWAyRjt-lQ4ZGErmV4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3jfBiT7nRzWAyRjt-lQ4ZGErmV4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3jfBiT7nRzWAyRjt-lQ4ZGErmV4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/w3J73yfXZEE" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Error+Message/default.aspx">Error Message</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Startup/default.aspx">Startup</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/11/15/tv-pack-installing-amp-startup-issues.aspx</feedburner:origLink></item><item><title>Addinistrator - Now Shipping</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/lMYDOcYc2Y4/addinistrator-now-shipping.aspx</link><pubDate>Fri, 07 Nov 2008 02:44:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:9598</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=9598</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/11/07/addinistrator-now-shipping.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&amp;nbsp; For those who haven&amp;#39;t noticed, my new applications are shipping with Addinistrator.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; The basic idea of Addinistrator is allowing users to have much better control over their Start menu and other entry points for Media Center applications. It lets you choose which two Start menus are visible, create your own start menus and edit the contents of existing ones, delete and shuffle programs around etc.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; It also interfaces with my existing products, EMUCenter and Yougle.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; If you have Yougle installed, Addinistrator allows you to add internet radio stations to the &amp;#39;Radio&amp;#39; menu&amp;nbsp;(Yougle is used to actually play the streams) without having to stuff around with MCL files. Just enter the name, URL and a thumbnail image and you are away.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; If you have EMUCenter installed, Addinistrator allows you to create Start and Program menu entries for non-Media Center applications (windows applications, emulators etc.). Simply choose &amp;#39;Add Program&amp;#39; and you can launch Internet Explorer, your favourite games, MSN chat etc. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Only the &amp;#39;Work In Progress&amp;#39; builds currently have Addinistrator - if you feel like trying it out, give it a go.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; I&amp;#39;m thinking of making the program available to the development community as a whole. One other feature I&amp;#39;m thinking of adding is making it a replacement for &amp;#39;RegisterMCEApp&amp;#39; - allowing you to register programs through Addinistrator. Why? The main reason is a simple one - I&amp;#39;d like to make Start menu creation and the sort order of your Start menu items part of the XML file format, to allow applications to register themselves without needing to make seperate x64 and x86 installers to make the required registry entries.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; There&amp;#39;s also another upshot - users will be warned if they are about to lose a strip from their Start menu and Addinistrator will let them choose which strips they want to keep.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; If you would be interested in bundling Addinistrator, or tying your package in to offer more functionality, please let me know by posting a comment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=9598" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kKua5VXl9-p_my65b0XJECg10ys/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kKua5VXl9-p_my65b0XJECg10ys/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kKua5VXl9-p_my65b0XJECg10ys/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kKua5VXl9-p_my65b0XJECg10ys/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/lMYDOcYc2Y4" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/11/07/addinistrator-now-shipping.aspx</feedburner:origLink></item><item><title>Interacting with Media Center</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/iNt31DcFhHs/interacting-with-media-center.aspx</link><pubDate>Thu, 06 Nov 2008 21:39:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:9595</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=9595</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/11/07/interacting-with-media-center.aspx#comments</comments><description>&lt;p&gt;I haven&amp;#39;t really covered how to interact with Media Center itself through much of these posts.&lt;/p&gt;
&lt;p&gt;Although there isn&amp;#39;t a lot you can actually get Media Center to do, it&amp;#39;s often vital to make your application play different types of media or have some control over the Media Center experience - such as creating notifications, playing sounds etc.&lt;/p&gt;
&lt;p&gt;All of this is done through the &lt;strong&gt;AddInHost&lt;/strong&gt; object - &lt;a href="http://msdn.microsoft.com/en-us/library/aa468251.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa468251.aspx&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One of the nice touches is that the &lt;strong&gt;AddInHost&lt;/strong&gt; class has a static member called &lt;em&gt;current&lt;/em&gt; that contains the interface to Media Center - you don&amp;#39;t need to go to any great lengths to access it. Within the AddInHost object are a number of properties that give you feedback or control on the state of Media Center. They are all relatively well documented in the SDK, so I&amp;#39;ll only cover the most important.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MediaCenterEnvironment&lt;/strong&gt; (&lt;a href="http://msdn.microsoft.com/en-us/library/bb189320.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb189320.aspx&lt;/a&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb188796.aspx"&gt;&lt;/a&gt;) is used to perform real control over Media Center. You can use this class to launch new addins, to navigate to new pages, play media and show dialog boxes equivalent to the normal Windows &amp;#39;MessageBox&amp;#39;. It can also be used to get and set properties, such as volume levels, mode of the screen, parental controls level etc.&lt;/p&gt;
&lt;p&gt;To navigate to a new MCML page, you use the following line...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AddInHost.Current.MediaCenterEnvironment.NavigateToPage(&lt;/strong&gt;&lt;em&gt;&amp;lt;page&amp;gt;&lt;/em&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To show a message - which is very good for debugging - you can use...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AddInHost.Current.MediaCenterEnvironment.Dialog(&lt;/strong&gt;&lt;em&gt;&amp;lt;text&amp;gt;,&amp;lt;title&amp;gt;,&amp;lt;buttons&amp;gt;,&amp;lt;timeout&amp;gt;,&amp;lt;ismodal&amp;gt;&lt;/em&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This function is &lt;em&gt;very&lt;/em&gt; similar to the Win32 &amp;#39;MsgBox&amp;#39; or the .NET MessageBox class. The only really new thing is the &amp;#39;IsModal&amp;#39; property, which is used to tell Media Center if the program should halt and wait for a response (&lt;em&gt;true&lt;/em&gt;) or if it should allow the program to continue in the background (&lt;em&gt;false&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And one of the most important....&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AddInHost.Current.MediaCenterEnvironment.PlayMedia(&lt;/strong&gt;&lt;em&gt;&amp;lt;mediatype&amp;gt;,&amp;lt;media&amp;gt;,&amp;lt;addtoqueue&amp;gt;&lt;/em&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This function is used to play a media item. The actual &amp;#39;Media&amp;#39; parameter takes the URL/path to your media. You should use &amp;#39;addtoqueue&amp;#39; only if you are adding music - using this parameter with other types of item can cause issues.&lt;/p&gt;
&lt;p&gt;This is one of the very few functions you can use that will actually crash Media Center, so be careful. All other functions are completely isolated from Media Center, so if you crash you only take out your addin rather than Media Center as a whole. With PlayMedia, you can bring down the entire Media Center experience by playing invalid files. Please take care with all URLs you pass to this function.&lt;/p&gt;
&lt;p&gt;For videos or pictures, after a call to PlayMedia you may want to consider calling &lt;strong&gt;AddInHost.Current.MediaCenterEnvironment.MediaExperience.GoToFullScreen - &lt;/strong&gt;which (fairly obviously) will show your media in fullscreen, rather than appearing in the bottom corner of your program.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A word of warning for people debugging in MCMLPad - because your addin isn&amp;#39;t launched from Media Center with MCMLPad, you will still have access to the AddInHost object, but the &lt;em&gt;current&lt;/em&gt; member will be &lt;strong&gt;empty&lt;/strong&gt;. If you are planning on debugging with MCMLPad, please ensure you place a check that &lt;strong&gt;AddInHost.Current&lt;/strong&gt; is not null before each call that uses the object.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=9595" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HX6U-RcsBv8XJnlFZC-ppwv743o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HX6U-RcsBv8XJnlFZC-ppwv743o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HX6U-RcsBv8XJnlFZC-ppwv743o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HX6U-RcsBv8XJnlFZC-ppwv743o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/iNt31DcFhHs" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/11/07/interacting-with-media-center.aspx</feedburner:origLink></item><item><title>An Incomplete Book - But Still A Book</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/XeTatTrhfX8/an-incomplete-book-but-still-a-book.aspx</link><pubDate>Wed, 02 Jul 2008 00:24:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:7687</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=7687</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/07/02/an-incomplete-book-but-still-a-book.aspx#comments</comments><description>&lt;P&gt;OK - I've put an incomplete version of the book online at the Push-A-Button website - &lt;A href="http://push-a-button.com/products/books/index.php"&gt;http://push-a-button.com/products/books/index.php&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You are welcome to download it and have a read. If you like it or find it valuable, PLEASE consider donating, since it takes quite a bit of time to write up a document like this.&lt;/P&gt;
&lt;P&gt;It's 150 pages long and goes into much more detail than the blog here. It covers most of the same topics, but in a slightly different way. I've only started on the "Building a Real Life Application" section.&lt;/P&gt;
&lt;P&gt;If you want to get rid of the watermark or would like the ability to print/comment etc, if you donate I'll make one available to you.&lt;/P&gt;
&lt;P&gt;If you have specific feedback about individual sections of the book (eg. examples that are incorrect, poorly-written or poorly explained sections or just places where it doesn't quite 'work' for you) please sign up to my forums at &lt;A href="http://community.push-a-button.com/"&gt;http://community.push-a-button.com&lt;/A&gt; and post on the new "Programming in Vista Media Center" forum.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=7687" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cihs_aaBQ1vXG2O7NpuGY_Nr8rY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cihs_aaBQ1vXG2O7NpuGY_Nr8rY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cihs_aaBQ1vXG2O7NpuGY_Nr8rY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cihs_aaBQ1vXG2O7NpuGY_Nr8rY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/XeTatTrhfX8" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/07/02/an-incomplete-book-but-still-a-book.aspx</feedburner:origLink></item><item><title>Book Format Options</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/wi4tJNm1o4A/book-format-options.aspx</link><pubDate>Fri, 30 May 2008 12:11:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:7167</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=7167</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/05/30/book-format-options.aspx#comments</comments><description>&lt;P&gt;OK - people seem a little interested in the idea of a book, and "Cheap PDF" seems to be popular. Personally, I'm thinking the same route because it allows be to embed hyperlinks into the document - and the book is best used when you have Visual Studio available to play with right then and there, anyway.&lt;/P&gt;
&lt;P&gt;So then people have a few options. I'll open a poll to allow people to vote on what they think would work best for them.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thedigitallifestyle.com/cs/forums/7168/ShowThread.aspx"&gt;http://thedigitallifestyle.com/cs/forums/7168/ShowThread.aspx&lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=7167" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KALyWGiFGnEIjrcgve2Uu-labYM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KALyWGiFGnEIjrcgve2Uu-labYM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KALyWGiFGnEIjrcgve2Uu-labYM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KALyWGiFGnEIjrcgve2Uu-labYM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/wi4tJNm1o4A" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/05/30/book-format-options.aspx</feedburner:origLink></item><item><title>Would people be interested in a book?</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/Ks-PdmTaOPk/would-people-be-interested-in-a-book.aspx</link><pubDate>Fri, 30 May 2008 00:38:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:7152</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>10</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=7152</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/05/30/would-people-be-interested-in-a-book.aspx#comments</comments><description>&lt;P&gt;I'm working on a Media Center development book - would people be interested in buying a book on how to develop applications in Media Center?&lt;/P&gt;
&lt;P&gt;If so, what would be more appealing? A large bound volume, or an inexpensive PDF copy?&lt;/P&gt;
&lt;P&gt;I'm sitting on 130 pages at the moment, and I've only just covered where the blog is up to now, so there's a LOT of depth and sample code in the book so far.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=7152" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lufPCASwc2mIlDwwT4pfg0MiT2o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lufPCASwc2mIlDwwT4pfg0MiT2o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lufPCASwc2mIlDwwT4pfg0MiT2o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lufPCASwc2mIlDwwT4pfg0MiT2o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/Ks-PdmTaOPk" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/05/30/would-people-be-interested-in-a-book.aspx</feedburner:origLink></item><item><title>Popup Menus &amp; Background Objects</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/H4o8kHgOKgM/popup-menus-background-objects.aspx</link><pubDate>Mon, 26 May 2008 22:59:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:7127</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=7127</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/05/27/popup-menus-background-objects.aspx#comments</comments><description>&lt;P&gt;Some people have had issues trying to make 'popup menus' in Media Center applications.&lt;/P&gt;
&lt;P&gt;Since I've been adding a similar function to EMUCenter to support some of the new features, I thought I'd cover how to do it. The answer is actually very straight-forward.&lt;/P&gt;
&lt;P&gt;The main problem with pop-up menus is the fact that they tend to pop-up &lt;STRONG&gt;over&lt;/STRONG&gt; your existing interface, and Media Center isn't particularly good at dealing with overlapping objects and managing focus. In fact, you should avoid overlapping objects in Media Center at all costs, since it can cause some slightly unusual effects, and different focus rules for different input devices (eg. if you have overlap, the remote control tends to focus on the &lt;STRONG&gt;smallest &lt;/STRONG&gt;or&lt;STRONG&gt; closest &lt;/STRONG&gt;item when you navigate, while the mouse tends to focus on the &lt;STRONG&gt;largest.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;So - you have to stop focus from falling onto any of the controls 'beneath' your popup. Many people try to do this by creating an invisible panel control that covers the entire screen, with the idea being that it is a single object that should 'catch' the focus. By setting the Navigation policy to 'ContainAll', you'd imagine that it would prevent anything else from getting focus.&lt;/P&gt;
&lt;P&gt;Unfortunately, it doesn't really work like that, although this solution MAY work for the mouse, it doesn't work for the keyboard/remote.&lt;/P&gt;
&lt;P&gt;The other technique people use is trying to use the &lt;STRONG&gt;Navigation&lt;/STRONG&gt; policy of your popup menu to prevent objects outside the menu from being selected. While this can work for your remote/keyboard, it won't prevent your mouse from changing the focus.&lt;/P&gt;
&lt;P&gt;So, what's the best solution?&lt;/P&gt;
&lt;P&gt;It's actually pretty simple. In all of&amp;nbsp; your objects that respond to mouse focus, you'll have a &lt;STRONG&gt;Default&lt;/STRONG&gt; rule that either turns '&lt;STRONG&gt;KeyInteractive&lt;/STRONG&gt;' on, or sets a property that turns it on for you, such as &lt;STRONG&gt;MakeTopMostOnFocus.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;All you have to do is make a shared variable - such as a BooleanChoice - that you use to store if a popup is visible, and then &lt;EM&gt;turn the KeyInteractive property on and off based on this variable&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;For example, I have a string called "PopupName" on the main class of my application. Whenever the string is empty, all of my main interface items have their KeyInteractive property set to true. But as soon as that text becomes something other than an empty string, all of my objects (other than in the&amp;nbsp;menu itself, of course!) become NON-interactive.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;&amp;lt;Condition Source="[MyApp.PopupName]" SourceValue=""&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target="[Input.KeyInteractive]" Value="true"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/Condition&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;Condition Source="[MyApp.PopupName]" SourceValue="" ConditionOp="NotEquals"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target="[Input.KeyInteractive]" Value="false"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/Condition&amp;gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=7127" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QrHZIaCXvIbo86QTXO8OiIudU6o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QrHZIaCXvIbo86QTXO8OiIudU6o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QrHZIaCXvIbo86QTXO8OiIudU6o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QrHZIaCXvIbo86QTXO8OiIudU6o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/H4o8kHgOKgM" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/05/27/popup-menus-background-objects.aspx</feedburner:origLink></item><item><title>A Geek Fantasy</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/vmTSU9JHhu0/a-geek-fantasy.aspx</link><pubDate>Fri, 02 May 2008 01:51:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:6593</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=6593</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/05/02/a-geek-fantasy.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Sorry, this isn't actually a development blog post - it's just me, geeking out at this - &lt;A href="http://www.nikkoamerica.com/nhe/dvd_projector_video.html"&gt;http://www.nikkoamerica.com/nhe/dvd_projector_video.html&lt;/A&gt;. My GOD, that's so damn geeky, and I want one BADLY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; To bad they'll never reach Australia.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=6593" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xSrXDzqIHJoytDUIS_FKNGp--Fw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xSrXDzqIHJoytDUIS_FKNGp--Fw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xSrXDzqIHJoytDUIS_FKNGp--Fw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xSrXDzqIHJoytDUIS_FKNGp--Fw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/vmTSU9JHhu0" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Wishlist/default.aspx">Wishlist</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/05/02/a-geek-fantasy.aspx</feedburner:origLink></item><item><title>Your Programs Look And Feel</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/b2SAsG-1760/your-programs-look-and-feel.aspx</link><pubDate>Wed, 26 Mar 2008 01:46:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:6020</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=6020</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/03/26/your-programs-look-and-feel.aspx#comments</comments><description>&lt;P&gt;Microsoft are of the opinion that users of Media Center applications do not want 3rd party apps to look like or work like Media Center itself. &lt;/P&gt;
&lt;P&gt;This is at odds with 99% of the feedback I've ever recieved as a Media Center developer, but I quote Charlie Owen from MS - &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The pool of customers we listen to and try to satisfy is much larger than folks realize. 'Customers want a unified experience' is not supported by the broad data I see everyday.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; - Chalie Owen, Microsoft (from the Media Center Sandbox)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Now, I'd like to ask a question simply for data-gathering purposes. Do you - as a Media Center user - want your applications to integrate completely with the Media Center experience, looking and working the same way, or would you prefer every application to have a unique look, feel and method of interaction, with a clear seperation of "Media Center Mainstream" and "3rd Party App"?&lt;/P&gt;
&lt;P&gt;Microsoft has offered their reasoning why they don't want to give developers access to components of the system,&amp;nbsp;and although I feel&amp;nbsp;it limits their developer base, I&amp;nbsp;don't feel too bad about that decision, because it does force users to really &lt;EM&gt;understand&lt;/EM&gt; the MCML system. However, the statement that users out there don't WAN'T to have a consistent interface seems unlikely given the real-world feedback I've recieved.&lt;/P&gt;
&lt;P&gt;So - I've posted a poll. Please, answer it yourself. And if you can, spread the word about the poll and encourage answers from other users of your Media Center PC - I want to get serious feedback from as many people as I can about this particular issue.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thedigitallifestyle.com/cs/forums/ShowThread.aspx?PostID=6021#6021"&gt;http://thedigitallifestyle.com/cs/forums/ShowThread.aspx?PostID=6021#6021&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Reasons Why There Is Not A Unified Interface:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blog.retrosight.com/WhyOurLookFeelIsntAvailableToApplications.aspx"&gt;http://blog.retrosight.com/WhyOurLookFeelIsntAvailableToApplications.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Arguments FOR a Unified Interface (My Personal Perspective, And Of Users I've Dealt With):&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I know that for every family with a Media Center PC, there's usually 1 or 2 tech-savvy people who have no trouble picking up the basics of navigation in moments. But there is also almost always another 1-2 people who are technophobes, and simply will not access something that is unfamilliar to them. I also know that for every program I have ever written in Media Center, the first thing pointed out in any review or user feedback is "Make it look more like Media Center".&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=6020" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iEbCgouLnHniW_VVvVGHifYpcfs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iEbCgouLnHniW_VVvVGHifYpcfs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iEbCgouLnHniW_VVvVGHifYpcfs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iEbCgouLnHniW_VVvVGHifYpcfs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/b2SAsG-1760" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Interface/default.aspx">Interface</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/03/26/your-programs-look-and-feel.aspx</feedburner:origLink></item><item><title>Designing Your Interface - For Beginners</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/yVHloU4RxNE/designing-your-inteface-for-beginners.aspx</link><pubDate>Mon, 17 Mar 2008 04:37:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:5878</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=5878</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/03/17/designing-your-inteface-for-beginners.aspx#comments</comments><description>&lt;P&gt;Ok - many people still have some trouble visualising their interfaces when it comes to writing their MCML. They don't know where to start, or what to do. I'm going to take a page from an MCML application and show you how to 'de-construct' it to figure out how it's made.&lt;/P&gt;
&lt;P&gt;The basic trick is to &lt;EM&gt;imagine you are drawing the page with a vector graphics program&lt;/EM&gt;. If you have Adobe Illustrator, Harvard Graphics, or even MS Word, you should be able to make some basic vector graphics. For those who don't have any of these programs, try the open-source project &lt;STRONG&gt;InkScape&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;In vector programs, you only have some fairly simple primative objects - boxes, circles, text &amp;amp; graphics - to work with, in a very similar way to MCML. And most of the adjustments you can do to these objects is also similar to MCML, the most important being scaling and rotation.&lt;/P&gt;
&lt;P&gt;So if you draw your interface in one of these vector programs, you almost naturally discover how to replicate them in the Media Center Markup Language.&lt;/P&gt;
&lt;P&gt;Let's take a look at a basic screen from EMUCenter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;A href="http://img257.imageshack.us/my.php?image=capture3mo5.jpg" target=_blank&gt;&lt;IMG alt="" src="http://img257.imageshack.us/img257/4998/capture3mo5.th.jpg" border=0&gt;&lt;/A&gt;&lt;BR&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 1 - Isolating The Elements&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The first thing to do is isolating each seperate element we see on the screen. If it's positioned independently - eg. it's doesn't seem to be physically part of another element on the screen - then we basically draw a 'box' around it. We will want to make a UI for each of these.&lt;/P&gt;
&lt;P&gt;By looking at our screen, we can come up with several seperate elements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Background Text (saying 'emucenter')&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Filter Bar (top left corner)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Position Bar (bottom right corner)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Selected Game Info (bottom center, underneath the selected game)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Games&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you were drawing these in a vector program, you'd build these items on different &lt;EM&gt;layers&lt;/EM&gt; or, to make them easier to move around and get their positioning right, you'd &lt;STRONG&gt;group&lt;/STRONG&gt; them. Everywhere you would put a group or a layer, you build a &lt;STRONG&gt;Panel&lt;/STRONG&gt; control, or even more likely a seperate &lt;STRONG&gt;UI&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;So each of the sections we isolated above would make perfect UI elements.&lt;/P&gt;
&lt;P&gt;Then you attack each UI as a completely seperate, indpendent creature. Remember at all times that there are only really three object types they could possibly be - Text, Graphic and ColorFill. Anything that isn't writing or a solid square of colour is almost certainly a Graphic object - it's as simple as that.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The Background Text&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; The background element is self-evident - we've already looked at how to make these earlier.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The Position Bar&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; The position bar LOOKS as if it's a single item, but with two numbers that change and a slash that stays where it is, you can actually build it out of three seperate &lt;STRONG&gt;Text&lt;/STRONG&gt; objects. You can but them together by putting them in a &lt;STRONG&gt;HorzontalLayout&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The Filter Bar&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; The filter bar is similar - single Text objects that appear in a &lt;STRONG&gt;HorizontalLayout&lt;/STRONG&gt;, this time with a bit of spacing between them. You'll of course have to put these elements in a Scroller though, to make it scroll, and you'll need to set the &lt;STRONG&gt;LockedPosition&lt;/STRONG&gt;, since the selection doesn't actually move - the selection stays still and the options move around it instead.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Selected Game Info&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Again, three Text objects. This time they are going DOWN the screen, so we need a &lt;STRONG&gt;VerticalLayout&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Games&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; No big surprise, it's like the filter bar - Graphic objects (one normal, one inverted and faded by a Clip object), repeated in a Scroller, with a &lt;STRONG&gt;HorizontalLayout&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, there's more work in making the selection work correctly, making your scrollers and repeaters happy etc. But when&amp;nbsp; you get down to it, it's just a handful of UI's, each with a few text objects or graphic objects. And if you had drawn it, you'd know exactly what you need to do to make the reflections work.&lt;/P&gt;
&lt;P&gt;So if you can't visualise it without help, follow this guide and draw your interface in Illustrator, InkScape or it's friends first, and the solution will be much clearer, and you'll have a nice prototype to work off.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=5878" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/s1Ph8sOnnBHe0-OUGuMFX_GHdB8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/s1Ph8sOnnBHe0-OUGuMFX_GHdB8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/s1Ph8sOnnBHe0-OUGuMFX_GHdB8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/s1Ph8sOnnBHe0-OUGuMFX_GHdB8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/yVHloU4RxNE" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/03/17/designing-your-inteface-for-beginners.aspx</feedburner:origLink></item><item><title>Changed or Condition, Default or Binding - Which to use?</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/kyuXzsCK9Oc/changed-or-condition-default-or-binding-which-to-use.aspx</link><pubDate>Sun, 16 Mar 2008 23:24:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:5877</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=5877</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/03/17/changed-or-condition-default-or-binding-which-to-use.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a bit of confusion out there about which rule to use in which situation when writing rules in your MCML application. I'll just quickly cover the scenarios here...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Default &lt;/STRONG&gt;vs &lt;STRONG&gt;Binding&lt;/STRONG&gt; Rules&lt;/P&gt;
&lt;P&gt;To be honest, you can actually use a Binding rule as a Default rule fairly seamlessly, but it's not really required and adds an (admittedly very small) amount of overhead you don't really need.&lt;/P&gt;
&lt;P&gt;The basic difference is that a &lt;STRONG&gt;Default&lt;/STRONG&gt; rule is evaluated only ONCE when your application loads. It is never again referenced or used. &lt;STRONG&gt;Binding&lt;/STRONG&gt; rules are re-evaluated every time the value of the Source &lt;STRONG&gt;changes&lt;/STRONG&gt;. Although pretty insignificant, this means a little bit of memory or a little more time used every time that the property changes. &lt;/P&gt;
&lt;P&gt;OK, it's a minor point - but worth bringing up. The second point is a bit more serious.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Changed&lt;/STRONG&gt; vs &lt;STRONG&gt;Condition&lt;/STRONG&gt; Rules&lt;/P&gt;
&lt;P&gt;Some people are likewise confused between the Changed and Condition rules in MCML. The difference in these is pretty simple, but important to know.&lt;/P&gt;
&lt;P&gt;A &lt;STRONG&gt;Condition&lt;/STRONG&gt; rule can be and often is constantly re-evaluated by Media Center as long as the condition is true. This is excellent for when you are changing the appearance of an object, because you can tell Media Center to make objects visible, brighter, change their colour or text etc. However, because the rules are continually re-evaluated and re-run, there are some things you should NOT do in the &lt;STRONG&gt;Condition&lt;/STRONG&gt; rule. You should avoid triggering any event, such as an animation or &lt;STRONG&gt;Invoking&lt;/STRONG&gt; a function, that should only happen ONCE.&lt;/P&gt;
&lt;P&gt;For this sort of one-shot event, such as mouse clicks,&amp;nbsp;a &lt;STRONG&gt;Command&lt;/STRONG&gt; object being invoked&amp;nbsp;or reactions to events from your C# code, you should use the &lt;STRONG&gt;Changed&lt;/STRONG&gt; rule.&lt;/P&gt;
&lt;P&gt;Changed rules are only run once, when FirePropertyChanged is called. This means that it doesn't matter how long the user chooses to hold the mouse button down or the event remains in it's new value, the rule is only run the one time.&lt;/P&gt;
&lt;P&gt;You can further specialise it by adding more conditions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's look at a quick example. In Yougle, I have a "Feedback" section that tells the user what is current going on. When I start a particular function, I set a string to "Starting Embedded Playback", to let the user know that Yougle is working on playing back their media. This triggers the following condition...&lt;/P&gt;
&lt;P&gt;&amp;lt;Condition Source="[Feedback.Text]" SourceValue="" ConditionOp="NotEquals"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target="[TextObject.Visible]" Value="true"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/Condition&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above rule means that for as long as the Feedback's "Text" property anything OTHER than an empty string, the text will be visible.&lt;/P&gt;
&lt;P&gt;But what if I want to do something a little more important? What if I wanted to Invoke a function at the same time, but only when the status actually changed to "Starting Embedded Playback"? Remember - this text value could&amp;nbsp;also be any of a hundred other values, so we need to deal with this condition in particular.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I put the code in a &lt;STRONG&gt;&amp;lt;Condition&amp;gt;&lt;/STRONG&gt;, I could find that my function is Invoked several times. To avoid this, it's much better to put it in a &amp;lt;Changed&amp;gt; rule...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;Changed Source="[Feedback.Text]"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Conditions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Equality Source="[Feedback.Text]" Value="Starting Embedded Playback"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Conditions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Invoke Target="[MyObject.MyFunction]"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/Condition&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So there you go - using ONE property, but both Changed and Condition rules, you can react to events both &lt;STRONG&gt;when&lt;/STRONG&gt;&amp;nbsp;the value changes and &lt;STRONG&gt;while&lt;/STRONG&gt; the value is set.&lt;/P&gt;
&lt;P&gt;And we've also seen how we can further narrow down rules so that we can deal with a change to a specific value.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=5877" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xvccj6Tny0lDORZ7RPOZLnfPg0w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xvccj6Tny0lDORZ7RPOZLnfPg0w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xvccj6Tny0lDORZ7RPOZLnfPg0w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xvccj6Tny0lDORZ7RPOZLnfPg0w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/kyuXzsCK9Oc" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/03/17/changed-or-condition-default-or-binding-which-to-use.aspx</feedburner:origLink></item><item><title>Writing A Yougle Source</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/2_7QozTPmBs/writing-a-yougle-source-part-1-the-basics.aspx</link><pubDate>Thu, 07 Feb 2008 21:25:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:4298</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=4298</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/02/08/writing-a-yougle-source-part-1-the-basics.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&amp;nbsp; OK, although this isn't about GENERAL Media Center development and is more of a self-serving plug, I'm going to go ahead anyway and show you how to write a plugin for Yougle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I get a lot of requests for particular video, audio and (to a lesser extent) picture sources. What many people don't know is that Yougle is extendible - 3rd party developers can write their own sources to add more content to Yougle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So I'm going to show you the basics of creating the Yougle source to allow you to browse the Media Center Show podcasts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Development of a Yougle source must be done on a Windows Vista installation that has Media Center included - you can use any .NET language, but our example with use C#, the language Yougle Vista itself was written in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; You also need to have Yougle itself installed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Finally, create a new Class Library in the .NET language of your choice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Now you need to tell Visual Studio that your program is going to be using some of the classes defined by the Yougle Vista application. You can do this by looking in the ClassWizard, finding the 'References' section, right clicking and choosing 'Add Reference...'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;The trickiest part of the whole process is coming up&lt;/STRONG&gt;.&amp;nbsp;For some reason that I'm sure makes a lot of sense but I don't understand myself, the "References" list in Visual Studio is NOT loaded from the set of assemblies you have in your Global Assembly Cache - they are instead loaded from a completely different location. There are a couple of methods you can use to resolve this particular issue, but the method found here - &lt;A href="http://www.devtopics.com/adding-assemblies-to-the-visual-studio-add-reference-dialog/"&gt;http://www.devtopics.com/adding-assemblies-to-the-visual-studio-add-reference-dialog/&lt;/A&gt;&amp;nbsp;- isn't bad. You can use this to point to the folder where you have installed Yougle Vista - or, if you can not find the Yougle Vista DLL, you can download it from &lt;A href="http://www.push-a-button.com.au/community/index.php?action=tpmod;dl=item47"&gt;http://www.push-a-button.com.au/community/index.php?action=tpmod;dl=item47&lt;/A&gt;&amp;nbsp;and put it wherever you like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; OK - now this is done, and we need to start actually writing our code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; It just so happens that there's an example project and example code on my website at &lt;A href="http://www.push-a-button.com.au/community/index.php?topic=92.0"&gt;http://www.push-a-button.com.au/community/index.php?topic=92.0&lt;/A&gt;&amp;nbsp;- this gives you the complete sample code for the Flickr picture source. So copy all of this code and paste it into your application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;A Yougle Source is basically just a single class - based on the &lt;STRONG&gt;YougleSource &lt;/STRONG&gt;class - that you customise to load data from your own provider. There are a couple of functions we need to override to do this properly...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;public class&lt;/STRONG&gt;&amp;nbsp;MediaCenterShowVid : &lt;STRONG&gt;YougleSource&lt;BR&gt;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; {&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;public&lt;/STRONG&gt; MediaCenterShowVid()&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Set up all of the details of this source - description, name, picture etc.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;public&lt;/STRONG&gt; &lt;STRONG&gt;override bool&lt;/STRONG&gt; Load()&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Load all of the basic category, filter &amp;amp; sort&amp;nbsp;information for the sliders at the top of the screen&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public override bool &lt;/STRONG&gt;GetMedia(int page)&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Get a list of media (pictures, videos, audio streams etc.)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public override string &lt;/STRONG&gt;Play(string URL)&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //If required, take the URL discovered in the GetMedia call and convert it into something that we can actually download&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; And that's it - override those&amp;nbsp;4 functions, and you're away!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So how do we do this in the case of the Media Center Show? Well it's actually pretty easy when you get right down to it. Let's do these in order...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;U&gt;The Constructor&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Nothing too shocking here, really - you use the &lt;STRONG&gt;Load&lt;/STRONG&gt; function to set all of the major information about your source, so that Yougle knows what to show in the list of sources.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;public&lt;/STRONG&gt; MediaCenterShowPodcast()&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Set up all of the details of this source - description, name, picture etc.&lt;BR&gt;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _Name = "The Media Center Show";&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //The name of the source&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _Description = "Watch Ian Dixon's Media Center Show";&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//The&amp;nbsp;description of the source&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _Type = YougleSourceType.audio;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//The type of media available (picture,video or audio)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _Rating = YougleSourceRating.children;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //The maximum audience rating&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ImageURL = "http://thedigitallifestyle.com/images/albumcoversmall.png";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //A URL for&amp;nbsp;an image to use&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;U&gt;The Load Function&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; This function is responsible for loading all of the information that appears in the 'pivot bar' at the top of the screen - your sort orders, filters, channels and categories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; There are TWO pivot bars in Yougle Vista. The top one is called the CATEGORY bar. Each category has one or more OPTIONS to choose from, which are shown on the lower pivot bar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; As an example, 'Sort' can be a category - with options being 'by popularity', 'by date', 'by views' etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Where there are multiple categories, they work and are reset in a left-to-right manner. For example, let's say the first&amp;nbsp;category was 'sort', the second was 'period' and the third was 'category'. In this case, you can effectively 'add' these three options together (eg. sort="By Popularity", period="Today" and Category="Animals") to create more complex queries - in this case, 'Show Me All Of The Animal Videos That Were Popular Today".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; However, when you change a category value, all of the categories to the RIGHT of that one are reset. For example, if you had the earlier example and changed "period" to "week", the Category would reset to "All".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Anyway, all of this isn't particularly relevant to us, since we will be getting all of our information from the Media Center Show RSS feeds - and there is only one real sorting option, which is "By Date".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;public override bool &lt;/STRONG&gt;Load()&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Load all of the basic category information for the top of the screen&lt;BR&gt;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//There is only really one sort order - By Date. Add it.&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; YougleCategorySet Cat = new YougleCategorySet();&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cat.Name = "sort";&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cat.Options.Add(new YougleOption("by date", ""));&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Categories.Add(Cat);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Why bother adding anything at all? Well, Media Center is a troublesome beast some times, and you MUST have at least ONE option in every list - so you have to have at least one category, and each category must have at least one option - or your source will crash.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;U&gt;&lt;STRONG&gt;The GetMedia Function&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; This function is the core of Yougle Vista - it gets the media we want to offer to the user. In this case, it will be offering the users the 40 most recent Media Center shows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Each media item is stored in a "YougleMovie" object (yes, I really should have gotten around to renaming this, but it was originally a video-only product), and each YougleMovie object has some basic attributes, such as name, thumbnail image, description and one or more URLs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Let's start the function...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;public override bool&lt;/STRONG&gt; GetMedia(int page)&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Movies.Clear();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //ALWAYS do this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Now, we are getting all of our information from an RSS feed from FeedBurner. ( &lt;A href="http://feeds.feedburner.com/TheDigitalLifestyleVideoShow"&gt;http://feeds.feedburner.com/TheDigitalLifestyleVideoShow&lt;/A&gt;&amp;nbsp;) - so the very first thing we need to do is actually download the thing...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("&lt;A href="http://feeds.feedburner.com/TheMediaCenterShowPodcast"&gt;http://feeds.feedburner.com/TheMediaCenterShowPodcast&lt;/A&gt;");&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HttpWebResponse Response = (HttpWebResponse)Request.GetResponse();&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextReader Rdr = new StreamReader(Response.GetResponseStream());&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String Content = Rdr.ReadToEnd();&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; This code downloads the current feed from Feedburner, and loads it into a String called 'Content'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; RSS feeds are simply XML documents, so we should be able to happily load this feed into a XMLDocument object...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XmlDocument Doc = new XmlDocument();&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Doc.LoadXml(Content);&lt;BR&gt;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlNodeList&amp;nbsp;Items = Doc.GetElementsByTagName("item");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (XmlNode&amp;nbsp;Vid in Items)&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; YougleMovie Movie = new YougleMovie();&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Movie.Name = Vid.Attributes["title"].Value;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Movie.Description = Vid.Attributes["pubDate"].Value;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Movie.Thumbnail = http://thedigitallifestyle.com/images/albumcoversmall.png";&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; OK - now we have a small issue. We aren't given a DIRECT link to the&amp;nbsp;video in it's own tag. Instead, it's embedded inside the Description tag. On the plus side though, it's the only ".mp3" file in the whole text.&amp;nbsp;So perhaps with&amp;nbsp;a regular expression, we can track it down. ( I use Expresso from Ultrapico, which is an excellent program for creating and debugging .NET style regular expressions, which are slightly different to the Unix/PERL style ones you may be familliar with - get it from&amp;nbsp;&lt;A href="http://www.ultrapico.com/Expresso.htm"&gt;http://www.ultrapico.com/Expresso.htm&lt;/A&gt;&amp;nbsp;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So the regex that finds the 'mp3' file in the description will be something like... &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;A href="http://thedigitallifestyle.com/audio/"&gt;http://thedigitallifestyle.com/audio/&lt;/A&gt;([^"]*?)"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Which means we can now use that regex to find the MP3 file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;undefined&lt;STRONG&gt;&lt;A href="http://thedigitallifestyle.com/audio/([%5E/%22]*?)\"&gt;http://thedigitallifestyle.com/audio/&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Match Mch = Rg.Match(Vid.Attributes["Description"].Value);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Mch.Success == true) Movie.URLs.Add(new YougleMovieURL(Mch.Groups[1].Value, "video/wmv", true));&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Movies.Add(Movie);&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Of course, it would be much more efficient to create the actual Regex OUTSIDE the 'while' loop, to stop it needing to be created again and again. I've added it there simply because we are doing this step-by-step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; And finally for the GetMedia function, we return a value. We can return either TRUE or FALSE, with 'True' meaning that there is more content waiting to be downloaded (note how the GetMedia function is passed a 'page' parameter? This is so you can download media in seperate 'pages', the same way you view them on a web page). Since we only have access to a single RSS feed and can't move through it, there won't be any more pages to come - so we return FALSE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;U&gt;The Play Function&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; The play function is basically there to help speed up the process of locating your media. Quite often, the direct link to the actual video file (the downloadable file, or the actual streaming address) isn't quite as straight forward as it could be. For example, YouTube don't actually publish the location of the .FLV files for their videos&amp;nbsp;- they need to be sourced using special techniques or 3rd party tools ( such as &lt;A href="http://www.keepvid.com/"&gt;http://www.keepvid.com&lt;/A&gt; ) to find the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; It would take WAY too long to track down all of these direct links as part of the LoadMedia function, so the Play function is called immediately before Yougle is ready to play or download your video.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If we were writing the Media Center Show&amp;nbsp;&lt;STRONG&gt;video&lt;/STRONG&gt; source, we could end up having a more difficult job to do here - because we&amp;nbsp;may have to get a link to the web page on either YouTube or MSN Soapbox for the episode. To translate that into a actual URL to either the video file (avi, flv, wmv or asx) would take a little more work. (Luckily, Ian always offers a Direct Download option too, so it should be easy to write a video downloader!)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; In this case, we have a situation where we have the&amp;nbsp;actual MP3 file&amp;nbsp;for Media Player to use, so this is really easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;public override string &lt;/STRONG&gt;Play(string URL)&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Rebuild the original URL...&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String UR = "&lt;A href="http://thedigitallifestyle.com/audio/([%5E/%22]*?)\"&gt;&lt;STRONG&gt;http://thedigitallifestyle.com/audio/&lt;/STRONG&gt;&lt;/A&gt;" + URL;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //'UR' now contains the actual address to the actual MP3 file, which Media Center will play...&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return UR;&lt;BR&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; We could have just stored&amp;nbsp;the full URL in our YougleMovie object and simply not overridden this member at all, but I wanted to show you how it works, for possible future projects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;And we are pretty much done! &lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you have a site you want to work with, but you're having trouble getting direct links to the video or audio&amp;nbsp;files (pictures are usually easy), you'll find that there are&amp;nbsp;a number of websites that have the handy ability to translate web page URL's into video URL's...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;A href="http://max.subfighter.com/flv/downloader.php"&gt;http://max.subfighter.com/flv/downloader.php&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;A href="http://www.keepvid.com/"&gt;http://www.keepvid.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=4298" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/z8hSMU-8rp7HRr4Hz78fm8VnnFI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/z8hSMU-8rp7HRr4Hz78fm8VnnFI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/z8hSMU-8rp7HRr4Hz78fm8VnnFI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/z8hSMU-8rp7HRr4Hz78fm8VnnFI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/2_7QozTPmBs" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Media+Center/default.aspx">Media Center</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Yougle/default.aspx">Yougle</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/02/08/writing-a-yougle-source-part-1-the-basics.aspx</feedburner:origLink></item><item><title>Going Around in Circles</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/YDNlzhHjVjA/going-around-in-circles.aspx</link><pubDate>Wed, 23 Jan 2008 01:26:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3947</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3947</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/01/23/going-around-in-circles.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&amp;nbsp; Here's an interesting little tidbit, thanks to Charlie Owen&amp;nbsp;from&amp;nbsp;Microsoft and the Media Center Sandbox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; If you are using a Repeater, you have the option of allowing it to either Wrap or Repeat when you get to the end of it. This is great for long lists, since you can simply jump back to the start or swing over the end or back to the start when you need to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; However, it causes some problems if you are using &lt;STRONG&gt;RepeatedItemIndex&lt;/STRONG&gt;. The &lt;STRONG&gt;Value&lt;/STRONG&gt; of the&amp;nbsp;index does NOT loop around. So if you are at the first item (index 0) in a 20 item list, the item before it does NOT have an index of '20', as you'd expect if it wrapped around - it actually has an index of -1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; If you are trying to update the ChosenIndex property of a Choice object with this value, you just crashed your application. Congrats :)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; BUT&amp;nbsp;- RepeatedItemIndex has more than just 'Value', it also has a second property called &lt;STRONG&gt;SourceValue&lt;/STRONG&gt;. THIS is the one you want to use, because the SourceValue is the actual index into the array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So if you discover this problem, we now have a solution! Thanks to Charlie, for his help with this thread - &lt;A href="http://discuss.mediacentersandbox.com/forums/thread/6183.aspx"&gt;http://discuss.mediacentersandbox.com/forums/thread/6183.aspx&lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3947" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/N1uDaQO5n_YyXwaG5b8WF0DbTSQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N1uDaQO5n_YyXwaG5b8WF0DbTSQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/N1uDaQO5n_YyXwaG5b8WF0DbTSQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N1uDaQO5n_YyXwaG5b8WF0DbTSQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/YDNlzhHjVjA" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/01/23/going-around-in-circles.aspx</feedburner:origLink></item><item><title>Question Answered: Menu's and Sub-Menus</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/GbXNdTukC58/question-answered-menu-s-and-sub-menus.aspx</link><pubDate>Sat, 12 Jan 2008 05:13:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3837</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3837</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/01/12/question-answered-menu-s-and-sub-menus.aspx#comments</comments><description>&lt;P&gt;To go with the last post topic, Cowboy2007 asked me a question about how to make sub-menu's in MCML. I've discussed the basics of this in the following post, for those who are interested.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thedigitallifestyle.com/cs/forums/thread/3835.aspx"&gt;http://thedigitallifestyle.com/cs/forums/thread/3835.aspx&lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3837" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QrHrRDBzh-7QKwDWEJxPRumou54/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QrHrRDBzh-7QKwDWEJxPRumou54/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QrHrRDBzh-7QKwDWEJxPRumou54/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QrHrRDBzh-7QKwDWEJxPRumou54/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/GbXNdTukC58" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2008/01/12/question-answered-menu-s-and-sub-menus.aspx</feedburner:origLink></item><item><title>Control Interaction - Menu's and Sub-Menus, using Invoke</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/zro3BiLtCFs/control-interaction-menu-s-and-sub-menus-using-invoke.aspx</link><pubDate>Tue, 18 Dec 2007 22:14:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3684</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3684</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/12/19/control-interaction-menu-s-and-sub-menus-using-invoke.aspx#comments</comments><description>&lt;P&gt;Although this really isn't really very difficult from what's been explained before, some people have trouble with getting their controls to interact - to change one control based on another.&lt;/P&gt;
&lt;P&gt;So I thought I'd spend a little time covering the basics, so that people who are having trouble can get a walk-through of how to do it.&lt;/P&gt;
&lt;P&gt;The most common problem is in making a list of items appear based on the state of &lt;EM&gt;another&lt;/EM&gt; list of items. A simple example of this is the menu in a program (press 'ALT' if you are using IE7 and you'll see what I'm talking about).&lt;/P&gt;
&lt;P&gt;In this case, we have two menus - the contents of the sub-menu depends on what is selected in the main-menu.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, in previous blog posts we have already seen how to load an on-screen list using a Repeater in MCML and a Choice in our C# object. So all we need to do now is extend it slightly to involve TWO repeaters, and TWO Choice objects, then link them together.&lt;/P&gt;
&lt;P&gt;So let's say we have to Choice objects, once called &lt;STRONG&gt;MainMenu&lt;/STRONG&gt; and the other called &lt;STRONG&gt;SubMenu&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;To display these on the screen, we need to create the UI's for the Repeater/Scroller combination (with the &lt;STRONG&gt;ScrollingData&lt;/STRONG&gt; and &lt;STRONG&gt;ScrollingHandler&lt;/STRONG&gt; of course, so we can handle the scrolling correctly - see the earlier blog posts if you don't quite follow).&lt;/P&gt;
&lt;P&gt;So we have our &lt;STRONG&gt;MainMenuUI and SubMenuUI, &lt;/STRONG&gt;which are the UI's containing our scroller and repeater. Now we build two UI's for the objects &lt;EM&gt;within&lt;/EM&gt; the scrollers - let's call them &lt;STRONG&gt;MainMenuItem &lt;/STRONG&gt;and &lt;STRONG&gt;SubMenuItem&lt;/STRONG&gt;. &lt;/P&gt;
&lt;P&gt;We give these Item UI's a property called Label&lt;/P&gt;
&lt;P&gt;&amp;lt;Properties&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;cor:string name="Label" cor:string="$Required"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/Properties&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;So, we have the following layout...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Base Item&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; MainMenuUI&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MainMenuItems...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SubMenuUI&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubMenuItems&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And finally, we load both items from our C# code - filling the ArrayListDataSets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But - what about making them work WITH eachother? Well, that is done - like ALL communication between UI elements in MCML - via shared properties.&lt;/P&gt;
&lt;P&gt;Now there are a variety of ways to do the next part of our task. I'm going to show you a simple method that will work both with and without a Choice object being used to load the data - this way, if you ever need to replicate this situation with a FIXED list of items, you'll still know how it's done. But just to cover the options, you could...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; * Make your own subclass of Choice and use it instead of normal Choice objects for the content of your main menu. By overriding the &lt;STRONG&gt;OnChosenChanged&lt;/STRONG&gt;&amp;nbsp;member of the Choice class, your code will be automatically called whenever the &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt; of the Choice object is changed. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; * Make a &lt;STRONG&gt;Command&lt;/STRONG&gt; object that is Invoked when a menu item is selected. By setting the description of the Command object to the Label of the MainMenuItem, you can then communicate not only that the selection has changed, but what the new selected item actually IS. Note that to make this work, the Command object must be shared between all of the UI components - it would be a property of the &lt;STRONG&gt;Base Item&lt;/STRONG&gt;, and passed as properties through to all other UI elements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; * Invoke a function on your main class (which is what I'll be showing you).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, we will be doing the last - and probably the simplest - of the techniques. The other methods also have their uses - the first one is completely seamless when done correctly and requires virtually no code on the MCML side, while the 2nd one is perfect if your C# code is not actually involved in the loading of more information (eg. if you are switching between fixed lists by changing the &lt;STRONG&gt;Visible&lt;/STRONG&gt; property on sub-menus) because it's entirely contained in MCML, with no code on the C# side.&lt;/P&gt;
&lt;P&gt;This technique requires both C# and MCML code, but is a little more intuitive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's say our main class (the ModelItem class we do most of our C#-&amp;gt;MCML interaction with) is called &lt;STRONG&gt;MainClass&lt;/STRONG&gt;. What we can do is add a new member function, called &lt;STRONG&gt;NewMenuSelected.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;public void NewMenuSelected(String &lt;/STRONG&gt;MenuName&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This function takes a single parameter - the name of the menu that is currently selected. It just so happens that our UI already has a property called Label, which is the name of the menu. So all that is left is to get our MainClass object to the SubMenuUI. This means that both the SubMenuUI and SubItem elements need a property...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;Properties&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;a:MainClass name="MyClass" a:MainClass="$Required"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/Properties&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So now, when our &lt;STRONG&gt;MainMenuItem &lt;/STRONG&gt;objects get the focus, we want it to call our function....&lt;/P&gt;
&lt;P&gt;&amp;lt;Rules&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Condition Source="[Input.KeyFocus]" SourceValue="true"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Invoke Target="[&lt;STRONG&gt;MyClass.NewMenuSelected&lt;/STRONG&gt;]" ManuName="[Label]"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Actions&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Condition&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/Rules&amp;gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This means that when our MainMenuItem gets the focus (meaning that it is the active menu we want to see) then we call our C# or VB object and load the new contents of our SubMenu.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;public void NewMenuSelected(String &lt;/STRONG&gt;MenuName&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;_SubMenu.Clear();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; switch (MenuName)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case "File":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _SubMenu.Options.Add("Open");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _SubMenu.Options.Add("Save");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _SubMenu.Options.Add("Save As");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case "Edit":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _SubMenu.Options.Add("Copy");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _SubMenu.Options.Add("Cut");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _SubMenu.Options.Add("Paste");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; FirePropertyChanged("SubMenu");&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So hopefully you've seen how these objects can be combined to control the contents of one repeater with another. &lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3684" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/T4aMq2WDSmPY-HiaCwJDrs0zcxY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T4aMq2WDSmPY-HiaCwJDrs0zcxY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/T4aMq2WDSmPY-HiaCwJDrs0zcxY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T4aMq2WDSmPY-HiaCwJDrs0zcxY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/zro3BiLtCFs" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Media+Center/default.aspx">Media Center</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/12/19/control-interaction-menu-s-and-sub-menus-using-invoke.aspx</feedburner:origLink></item><item><title>Multithreading in MCML</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/8EkBtb186IM/multithreading-in-mcml.aspx</link><pubDate>Sun, 09 Dec 2007 23:32:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3647</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>4</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3647</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/12/10/multithreading-in-mcml.aspx#comments</comments><description>&lt;P&gt;There are times when the response from a click is going to take a little while - fetching information from a web page, downloading a file, queuing a video...some of these things take time, and the user doesn't like to have their Media Center 'lock up' while they are waiting for it.&lt;/P&gt;
&lt;P&gt;When this happens, it's time to bring out the good old Thread class once again, and start playing.&lt;/P&gt;
&lt;P&gt;There are a couple of things you should be aware of though before you write your threaded application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have some experience with Windows Forms applications (and I hope you do - it will make your Media Center development life much easier), you will know that it is impossible to change the text or the appearance of a control from any thread &lt;EM&gt;other than the thread the window was opened in (&lt;/EM&gt;eg. the Application Thread).&lt;/P&gt;
&lt;P&gt;The same rule applies to Media Center applications and the &lt;STRONG&gt;FirePropertyChanged&lt;/STRONG&gt; function of ModelItem. If you are going to call FirePropertyChanged, it must be from the &lt;EM&gt;application thread&lt;/EM&gt;, otherwise it will fail.&lt;/P&gt;
&lt;P&gt;Note that if you call FirePropertyChanged from the wrong thread, you probably won't get an exception like you do with Windows Forms - the notification will be 'lost' and you may start getting erratic behaviour out of your application.&lt;/P&gt;
&lt;P&gt;So how do you manage to change a property value then? Well, you create a member function that takes&amp;nbsp;a single parameter of type 'object' (even if you don't USE the parameter, create it) and then call...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Application.DeferredInvoke(&lt;/STRONG&gt;&amp;lt;function name&amp;gt;,&amp;lt;parameter&amp;gt;&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 'Application' object is a global one, and the DeferredInvoke function tells Media Center and the .NET system to run the &amp;lt;&lt;EM&gt;function name&amp;gt; &lt;/EM&gt;function in the APPLICATION's thread, next time that thread is available for a little extra work.&lt;/P&gt;
&lt;P&gt;I personally like to make my work even easier, by using the following code in any property that I expect to be accessed from a thread other than the main application thread...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;In The Object That Has Properties....&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;internal void FPC(object Val)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String Value = (String)Val;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Application.IsApplicationThread() == true)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FirePropertyChanged(Value);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Application.DeferredInvoke(FPC,Value);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The Actual Property Itself...&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;string _MyStringValue;&lt;/P&gt;
&lt;P&gt;public string MyStringValue&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get { return _MyStringValue; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _MyStringValue = value;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FPC("MyStringValue");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because the&amp;nbsp;FPC (which is short for &lt;STRONG&gt;FirePropertyChanged&lt;/STRONG&gt;)&amp;nbsp;actually conforms to the format needed to pass to the DeferredInvoke function, it's actually recursive. If you try to set the &lt;STRONG&gt;MyStringValue&lt;/STRONG&gt; property, FPC is called. &lt;/P&gt;
&lt;P&gt;If FPC detects that it has been called from the application thread (by using the IsApplicationThread() command), it simply calls FirePropertyChanged. If it finds that it &lt;EM&gt;isn't&lt;/EM&gt; in the application's thread, it calls itself again using &lt;STRONG&gt;DeferredInvoke&lt;/STRONG&gt;. The 2nd time it runs, it WILL be in the right thread.&lt;/P&gt;
&lt;P&gt;This greatly simplifies your programming, because you simply have to make sure that you ALWAYS use the publically exposed property name when you are accessing MyStringValue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, while this protects you when playing with your own properties that are based on simple type (eg. Int32, String, Bool etc.) it won't help with any type that is already based on ModelItem.&lt;/P&gt;
&lt;P&gt;These types - like &lt;STRONG&gt;IntRangedValue, Choice, EditableText, ArrayListDataSet&lt;/STRONG&gt; etc. already use FirePropertyChanged internally. So you must ensure that you only actually interact with these classes in the correct Application thread.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3647" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/S7NFG4MSC9zpfNkI9eeifbCuVRo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S7NFG4MSC9zpfNkI9eeifbCuVRo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/S7NFG4MSC9zpfNkI9eeifbCuVRo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S7NFG4MSC9zpfNkI9eeifbCuVRo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/8EkBtb186IM" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Media+Center/default.aspx">Media Center</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Multithreading/default.aspx">Multithreading</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/12/10/multithreading-in-mcml.aspx</feedburner:origLink></item><item><title>New Website for Addins &amp; Utilities</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/iTHgu7RDrIY/new-website-for-addins-utilities.aspx</link><pubDate>Mon, 19 Nov 2007 03:34:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3581</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3581</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/11/19/new-website-for-addins-utilities.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&amp;nbsp; A new website has come to my attention for Windows Media Center addins (and useful tools for a Media Center) - &lt;A href="http://htpcresource.com/"&gt;http://htpcresource.com/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; This site may have existed for a while without me noticing, so this may not be big news for you. But it's got a growing collection of addins that may be of interest to you - you may want to check it out!&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3581" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fWZilKhHcggLw8aXdHQaOOeXAbA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fWZilKhHcggLw8aXdHQaOOeXAbA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fWZilKhHcggLw8aXdHQaOOeXAbA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fWZilKhHcggLw8aXdHQaOOeXAbA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/iTHgu7RDrIY" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Media+Center/default.aspx">Media Center</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Addins/default.aspx">Addins</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/11/19/new-website-for-addins-utilities.aspx</feedburner:origLink></item><item><title>Award Nomination</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/Qrrh8bme5jE/award-nomination.aspx</link><pubDate>Mon, 29 Oct 2007 22:33:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3481</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3481</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/10/30/award-nomination.aspx#comments</comments><description>&lt;P&gt;Thanks to whoever nominated this blog for the Media Center Show Awards this year.&lt;/P&gt;
&lt;P&gt;Make sure you nominate any Media Center applications you've been using or liked - and of course, don't forget to VOTE once the list is final!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thedigitallifestyle.com/cs/blogs/ian/archive/2007/10/19/the-media-center-show-award-nominations-on-listas.aspx"&gt;http://thedigitallifestyle.com/cs/blogs/ian/archive/2007/10/19/the-media-center-show-award-nominations-on-listas.aspx&lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3481" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nD57WfDUg3vj9go_TNkauDP0NJk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nD57WfDUg3vj9go_TNkauDP0NJk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nD57WfDUg3vj9go_TNkauDP0NJk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nD57WfDUg3vj9go_TNkauDP0NJk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/Qrrh8bme5jE" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Thanks/default.aspx">Thanks</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/10/30/award-nomination.aspx</feedburner:origLink></item><item><title>EMUCenter 0.5.0</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/3mqVMcu8mEI/emucenter-0-5-0.aspx</link><pubDate>Sun, 28 Oct 2007 23:44:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3476</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3476</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/10/29/emucenter-0-5-0.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&amp;nbsp; Oh, I've finally released the new version of EMUCenter, which has a few new bells and whistles. If people are interested, you can download it from my new community site at &lt;A href="http://community.push-a-button.com.au/"&gt;http://community.push-a-button.com.au&lt;/A&gt; (please register before you can download the programs).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; EMUCenter is how I discovered the trick I covered in my last post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;There's also an testing version of the new version of Yougle available. It now supports pictures and has fixed a number of sources that had 'broken' due to site changes (or in Soapboxes case, the complete elimination of their site!).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EMUCenter Screenshots - taken by &lt;STRONG&gt;tom_son&lt;/STRONG&gt; from TheGreenButton and the Push-A-Button forums.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://img91.imageshack.us/my.php?image=dcct0.jpg" target=_blank&gt;&lt;IMG alt="" src="http://img91.imageshack.us/img91/6175/dcct0.th.jpg" border=0&gt;&lt;/A&gt; &lt;A href="http://img139.imageshack.us/my.php?image=ehshell2007102222181269hu2.jpg" target=_blank&gt;&lt;IMG alt="" src="http://img139.imageshack.us/img139/56/ehshell2007102222181269hu2.th.jpg" border=0&gt;&lt;/A&gt; &lt;A href="http://img207.imageshack.us/my.php?image=sneseg2.jpg" target=_blank&gt;&lt;IMG alt="" src="http://img207.imageshack.us/img207/496/sneseg2.th.jpg" border=0&gt;&lt;/A&gt;&lt;BR&gt;&lt;IMG alt="" src="http://img49.imageshack.us/img49/1176/capture4rd1.th.jpg" border=0&gt;&amp;nbsp;&lt;A href="http://img267.imageshack.us/my.php?image=capture5gf0.jpg" target=_blank&gt;&lt;IMG alt="" src="http://img267.imageshack.us/img267/2297/capture5gf0.th.jpg" border=0&gt;&lt;/A&gt;&amp;nbsp;&lt;A href="http://img265.imageshack.us/my.php?image=capturegm7.jpg" target=_blank&gt;&lt;IMG alt="" src="http://img265.imageshack.us/img265/8523/capturegm7.th.jpg" border=0&gt;&lt;/A&gt;&lt;BR&gt;&lt;A href="http://img61.imageshack.us/my.php?image=capture2ld2.jpg" target=_blank&gt;&lt;IMG alt="" src="http://img61.imageshack.us/img61/6150/capture2ld2.th.jpg" border=0&gt;&lt;/A&gt;&amp;nbsp;&lt;IMG alt="" src="http://img257.imageshack.us/img257/4998/capture3mo5.th.jpg" border=0&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3476" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KslCX8tn9nqudY8_Z0v5bCYlF8s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KslCX8tn9nqudY8_Z0v5bCYlF8s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KslCX8tn9nqudY8_Z0v5bCYlF8s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KslCX8tn9nqudY8_Z0v5bCYlF8s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/3mqVMcu8mEI" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Releases/default.aspx">Releases</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/10/29/emucenter-0-5-0.aspx</feedburner:origLink></item><item><title>Working With Large Scrollers</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/goyf48nDNXQ/working-with-large-scrollers.aspx</link><pubDate>Sun, 28 Oct 2007 11:01:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3475</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3475</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/10/28/working-with-large-scrollers.aspx#comments</comments><description>&lt;P&gt;This is a reasonably advanced topic, but since I've only just discovered the solution for it, I decided I may as well post it here so people who need the solution can use it.&lt;/P&gt;
&lt;P&gt;Large scrollers can sometimes be a problem when you need to do large 'jumps' within them. The best example of this is the 'type-to-search' functionality that you find in the Music menu of Media Center. When you start to type the name of the album, artist etc. with either your keyboard or remote control, you will find that the selection jumps straight to the nearest matching item.&lt;/P&gt;
&lt;P&gt;To replicate this in your own application can be troublesome.&lt;/P&gt;
&lt;P&gt;Normally, Media Center only has two functions to use to control user navigation. The first is &lt;STRONG&gt;Input.NavigateInto&lt;/STRONG&gt;. As we have seen before, every object has an 'Input' class associated with it. 'NavigateInto' requests that the current selection be changed to the object that you are &lt;STRONG&gt;Invoking&lt;/STRONG&gt; the command on.&lt;/P&gt;
&lt;P&gt;For example, if you had a button, putting the following command inside the UI for the button would result on it getting focus.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Invoke Target="[Input.NavigateInto]"/&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For collections though, this isn't all that useful. If you wanted to select a particular item in a scroller, you'd need to put in some complex rules inside the item that check not only that you WANT the focus to change, but also compare the index of the item against the index that is being searched for. It's possible - but it's slightly ugly.&lt;/P&gt;
&lt;P&gt;There's an easier function though. The Repeater item has a special function called &lt;STRONG&gt;NavigateIntoIndex &lt;/STRONG&gt;(see &lt;A href="http://msdn2.microsoft.com/en-us/library/bb189530.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb189530.aspx&lt;/A&gt;&amp;nbsp;). This is a very similar function to NavigateInto, but this time allows you to pass an index number. The repeater will then set the focus to the appropriate index element.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; Be careful when setting up complex events with these particular functions. Unlike a Windows session, when navigation events like clicks and focus changes are all queued up, Media Center does not queue navigation events. So if you try to fire off two or more &lt;STRONG&gt;NavigateInto&lt;/STRONG&gt; or &lt;STRONG&gt;NavigateIntoIndex&lt;/STRONG&gt; calls at once, one or more of them may be 'lost'.&lt;/P&gt;
&lt;P&gt;To work around this problem, use Timers to offset the calls to NavigateInto. For example, make the first one happen immediately and then make the others happen at 1/10th of a second intervals - or whatever works well for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's one major drawback with &lt;STRONG&gt;NavigateIntoIndex&lt;/STRONG&gt; and &lt;STRONG&gt;NavigateInto&lt;/STRONG&gt; though. Scrollers and repeaters work together to optimise the objects on screen. Part of this optimisation is only creating the actual repeated item when it becomes &lt;EM&gt;nessicary to create it&lt;/EM&gt;. So for example, if you have 100 items in your list but never scroll past the 10th item, the 100th item will &lt;EM&gt;never actually be created as an MCML object&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;So let's say you were in your own version of the Music section, you were exploring 'Ace of Base' and decided that you wanted to look for 'ZZ Top'. If you had 100 different artists, but only 12 were on the screen, calling &lt;STRONG&gt;NavigateIntoIndex&lt;EM&gt; &lt;/EM&gt;&lt;/STRONG&gt;with a parameter of '100' simply wouldn't work, because as yet, the 100th index does not actually exist.&lt;/P&gt;
&lt;P&gt;You can tweak the repeaters 'Prefetch' attribute - which chooses how many item the repeater 'pre-loads', but then you are enforcing a strict maximum possible length of your search, which not only means you are just delaying the problem, but pre-loading hundreds or even thousands of entries isn't just time consuming, it can crash your Media Center application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what's the trick? Well, it's not too difficult, it's just got some kinda sketchy documentation.&lt;/P&gt;
&lt;P&gt;Each scroller has a &lt;STRONG&gt;ScrollingData&lt;/STRONG&gt; attached. If you check out the documentation - &lt;A href="http://msdn2.microsoft.com/en-us/library/bb189586.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb189586.aspx&lt;/A&gt;&amp;nbsp;-&amp;nbsp;you'll find that it has a 'scroll' method. The documentation says that it takes a parameter that "is the amount to scroll". This is a little misleading. Does it mean in pixels? Pages? Centimeters? &lt;/P&gt;
&lt;P&gt;Well, if you have &lt;EM&gt;focusable&lt;/EM&gt; items in your scoller, the measurement is actually in &lt;STRONG&gt;focusable items&lt;/STRONG&gt;. So by calling the &lt;STRONG&gt;Scroll&lt;/STRONG&gt; method on the ScrollingData object with a parameter of 5, you will scroll forward five elements.&lt;/P&gt;
&lt;P&gt;Because you are now moving the SCROLLER rather than trying to move the focus on the repeated item itself, the repeater now has the opportunity to create the MCML objects, which allow it to focus on them properly.&lt;/P&gt;
&lt;P&gt;The only catch is that unlike &lt;STRONG&gt;NavigateIntoIndex&lt;/STRONG&gt;, &lt;STRONG&gt;Scoll&lt;/STRONG&gt; is a &lt;EM&gt;relative&lt;/EM&gt; movement. So if you are on the 1st item, scrolling with a parameter of&amp;nbsp;4 will take you to the 5th item. If you are on the 6th position, a value of 4 will take you to the 10th item.&lt;/P&gt;
&lt;P&gt;So if your repeater is based on a Choice object, remember to factor in the &lt;STRONG&gt;Choice.ChosenIndex&lt;/STRONG&gt; as part of your calculation for the amount you need to scroll by.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3475" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NztU5FW786aXlDsdHVsmcvRrroc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NztU5FW786aXlDsdHVsmcvRrroc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NztU5FW786aXlDsdHVsmcvRrroc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NztU5FW786aXlDsdHVsmcvRrroc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/goyf48nDNXQ" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/10/28/working-with-large-scrollers.aspx</feedburner:origLink></item><item><title>Playing with Graphics</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/FXdVeBSmSwQ/playing-with-graphics.aspx</link><pubDate>Sun, 28 Oct 2007 01:03:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3470</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3470</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/10/28/playing-with-graphics.aspx#comments</comments><description>&lt;P&gt;Yes, it's been ages...and yes, it's still not another addition to the TriviaCenter application. I do promise I'll get back to it some day, but it's a case of "Too much to do, too little time to do it in!"&lt;/P&gt;
&lt;P&gt;Anyway, I just thought I'd throw up a couple of posts for things that have been troublesome for me over the last few stages of working on the new release of EMUCenter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The one visual element I've never really explored in the blog is the &amp;lt;Graphic&amp;gt; element. We are going to cover it in TriviaCenter, but I thought I'd cover some of the basics here, just in case someone needed them.&lt;/P&gt;
&lt;P&gt;Like the &amp;lt;Text&amp;gt; element, the &amp;lt;Graphic&amp;gt; element has a 'Content' attribute. This attribute is an &lt;STRONG&gt;Image&lt;/STRONG&gt; object, which is a class that is part of the Media Center UI class library.&lt;/P&gt;
&lt;P&gt;However, Media Center is pretty good about converting the Image class from various other classes. If you point it towards an image resource (such as a PNG file on the hard drive or in your resource file), then it will load it for you from that resource. &lt;/P&gt;
&lt;P&gt;For example...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Graphic&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Flare&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;resx://MyAssembly/MyProject.Resources/Flare&lt;/FONT&gt;&lt;FONT size=2&gt;"/&amp;gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;This creates an image, loaded from the 'Flare' PNG file located in the resources of our Media Center project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To load an image from a dynamic source, you can simply use a string value and convert&amp;nbsp;it to an image.&lt;/P&gt;
&lt;P&gt;For example, if you had a C# class with a property called "MyImage", you could do the following...&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&lt;/FONT&gt;&amp;lt;&lt;FONT color=#a31515 size=2&gt;Graphic&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Flare&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[MyClassInstance.MyImage!Image]&lt;/FONT&gt;&lt;FONT size=2&gt;"/&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The exclaimation mark is how you tell Media Center to treat the String returned by MyClassInstance.MyImage to an Image object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may end up wanting to rotate your image. One thing to remember here is that your rotation will occur AFTER you have physically placed the object with your layoutmanager - so for example, if you are using FormLayout, you have to position the graphic itself - and most importantly it's &lt;STRONG&gt;CenterPointPercent&lt;/STRONG&gt; - in the correct location so that your rotation makes sure it ends up where it's &lt;EM&gt;supposed&lt;/EM&gt; to be.&lt;/P&gt;
&lt;P&gt;If you have trouble, rememeber to remove the rotation, reposition and try again. It can be very confusing to play with your Layout when the object is already rotated.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3470" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZFSJ2VY5CEHXlW5bKjL8KWWhrT4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZFSJ2VY5CEHXlW5bKjL8KWWhrT4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZFSJ2VY5CEHXlW5bKjL8KWWhrT4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZFSJ2VY5CEHXlW5bKjL8KWWhrT4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/FXdVeBSmSwQ" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/10/28/playing-with-graphics.aspx</feedburner:origLink></item><item><title>Addinistrator</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/dv8IYAP5AtM/addinistrator.aspx</link><pubDate>Mon, 17 Sep 2007 23:08:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3309</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3309</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/09/18/addinistrator.aspx#comments</comments><description>&lt;P&gt;I've started a new Open Source project, in the hope that other people are interested in contributing to it. &lt;/P&gt;
&lt;P&gt;Installing Media Center addins is a bit of an annoyance. You've got this really pretty Media Center interface, but for people who are trying to use it simply as a home-theatre experience, installing an addin means getting out the keyboard and mouse. Even worse, once you've got the thing installed, if there's an update or a patch for your addins, you've got to leave the Media Center experience to find, download and install them - and User Account Control will be jumping up, which means you can't automate the process from the addin itself.&lt;/P&gt;
&lt;P&gt;This is where Addinistrator comes in. It's goal is to perform a number of functions that weren't addressed by the SDK because of it's focus. The SDK is great when it comes to creating your app, but Media Center isn't all that friendly when it comes to &lt;EM&gt;deploying&lt;/EM&gt; and &lt;EM&gt;maintaining&lt;/EM&gt; the app (although Charlie Owen and Aaron Stebner from Microsoft are making excellent improvements to the Media Center SDK applications to make installations much simpler).&lt;/P&gt;
&lt;P&gt;Addinistrator will also allow you run-time access to your own Start menu strip (if you have one), meaning that you can re-order and even create new entries on-the-fly to suit your users needs.&lt;/P&gt;
&lt;P&gt;Future features may include Start&amp;nbsp;Strip management, a More Programs strip and, most importantly - the ability to browse for and install Media Center applications without the need to leave the Media Center experience.&lt;/P&gt;
&lt;P&gt;If you want to contribute, please feel free to visit &lt;A href="http://www.codeplex.com/addinistrator"&gt;http://www.codeplex.com/addinistrator&lt;/A&gt;&lt;A href="http://www.codeplex.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3309" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/x45sSohJtsbHa6eHvVwGTqIo19I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x45sSohJtsbHa6eHvVwGTqIo19I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/x45sSohJtsbHa6eHvVwGTqIo19I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x45sSohJtsbHa6eHvVwGTqIo19I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/dv8IYAP5AtM" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Media+Center/default.aspx">Media Center</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Open+Source/default.aspx">Open Source</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/09/18/addinistrator.aspx</feedburner:origLink></item><item><title>What I've Been Doing</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/KDQE9Etbgvk/what-i-ve-been-doing.aspx</link><pubDate>Wed, 29 Aug 2007 13:06:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3227</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3227</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/08/30/what-i-ve-been-doing.aspx#comments</comments><description>&lt;P&gt;If you're wondering what on earth I've been doing lately, I've been fiddling with some of my own projects lately.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://www.push-a-button.com.au/downloads/BlindTimerSetup.msi"&gt;http://www.push-a-button.com.au/downloads/BlindTimerSetup.msi&lt;/A&gt; - a 32 bit version of a simple poker&amp;nbsp;game timer. It tells you the current blinds the current&amp;nbsp;ante&amp;nbsp;and how long until they next go up, with text-to-speech announcements of blind increases and warnings when they are getting near.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://www.push-a-button.com.au/products/mce/vista/youglevista/"&gt;http://www.push-a-button.com.au/products/mce/vista/youglevista/&lt;/A&gt;&amp;nbsp;is the latest verison of Yougle (Yougle Vista) that has recently replaced the older Yougle 2 I linked people to on this website.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;Yougle Vista currently is still in alpha - it has a number of flaws - but I thought people may want to play with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;KNOWN BUGS&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;1) &lt;/STRONG&gt;Buffering for Flash Video files (such as YouTube, DailyMotion and Google Video feeds) is extremely slow - it can take quite some time for playback to start. If in doubt, press '#' to download the video rather than trying to stream it directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;2) &lt;/STRONG&gt;The X64 version of Yougle Vista can NOT play Flash Video files, so you will be unable to play videos from YouTube, DailyMotion and Google Video. This is because there is currently no FLV video splitter for 64 bit Windows, and although you are given a 32 bit copy of Windows Media &lt;STRONG&gt;Player&lt;/STRONG&gt; (meaning it can use 32 bit video codecs) you only get a &lt;STRONG&gt;64&lt;/STRONG&gt; bit version of Windows Media &lt;STRONG&gt;Center.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;This may be resolved in the not-to-distant future, but right now it's going to cause problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;3)&lt;/STRONG&gt; Pressing the 'Back' to go from your video source (such as YouTube) to the Source Selection screen can cause Yougle to go slightly haywire and drop back to the Media Center start menu. I am aware of what causes this problem, but fixing it is causing me all kinds of pain. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; [ for any interested developer, it is because of the fact that &lt;STRONG&gt;Choice&lt;/STRONG&gt; objects raise an exception if you try to choose something outside the valid range. When I remove all of the sort entries from the&amp;nbsp;list, but the user had selected anything other than the first one, the exception occurs without me having any ability to catch it, which throws the app back to the Start Menu. The resolution requires me to call two Invokes, one to force the focus of the sub-sort menu to go back to the first item, then a second one to bring focus BACK to the parent sort menu ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Common Questions:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q)&amp;nbsp;Will it work on my 360?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A) To a limited degree. The MSN Soapbox source may very well work for you, but most others will not. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q) Can you make it work BETTER on the 360?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;A) I don't know. Perhaps &lt;STRONG&gt;Transcode360&lt;/STRONG&gt; will work...but since I don't yet have enough donations to purchase a 360 or any other Extender device, I simply don't know because I can't test this sort of thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q) Can you add &amp;lt;insert provider her&amp;gt; to Yougle Vista?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A) Probably not (unless it's a REALLY good idea)...but YOU can.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When Yougle Vista goes from Alpha to Beta, I will release the SDK that allows you to quickly and easily write your own Yougle Vista sources in Visual C# Express or Visual Studio. The SDK will include complete samples of working sources, such as DivX Stage 6 and YouTube - you will be able to base your solutions on these samples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;A title="Yougle Vista Production Video" href="http://soapbox.msn.com/video.aspx?vid=8b5b69d2-a71b-4b6e-9e43-03b0a175c0f9" target=_new&gt;&lt;IMG height=84 alt="Yougle Vista Production Video" src="http://a630.g.akamai.net/f/630/23830/v0001/msnuuv1.download.akamai.com/23830/thumbs/prod/fd/48/61/f00df34b-34b4-44a9-b2eb-e8e8e86148fd.jpg" width=112 border=0&gt;&lt;BR&gt;Yougle Vista Production Video&lt;/A&gt; &lt;BR&gt;&lt;A title="Yougle Vista Production Video" href="http://soapbox.msn.com/video.aspx?vid=8b5b69d2-a71b-4b6e-9e43-03b0a175c0f9" target=_new&gt;Video: Yougle Vista Production Video&lt;/A&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3227" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XPtSSrOIM3qopVq8-mCl9clVCNE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XPtSSrOIM3qopVq8-mCl9clVCNE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XPtSSrOIM3qopVq8-mCl9clVCNE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XPtSSrOIM3qopVq8-mCl9clVCNE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/KDQE9Etbgvk" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Releases/default.aspx">Releases</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/08/30/what-i-ve-been-doing.aspx</feedburner:origLink></item><item><title>Scope in MCML</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/NopztCkrpkg/scope-in-mcml.aspx</link><pubDate>Wed, 01 Aug 2007 23:07:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3137</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3137</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/08/02/scope-in-mcml.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another sandbox-related discussion (a new user, Jeff, is having some trouble wrapping his head around the MCML concept, so I thought I'd post the assistance I'm giving him).&lt;/P&gt;
&lt;P&gt;This is about scope in MCML. I know I've covered this in the past, but this will&amp;nbsp;just expand on my previous points.&lt;/P&gt;
&lt;P&gt;Basically, this is all about the question of&amp;nbsp;"&lt;STRONG&gt;I've got this nice little button UI - how do I change the text on it from another UI, or from C#?"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first thing you&amp;nbsp;need to understand is that each UI is a closed control - you can NOT access the various parts of one UI from another one. So although your button may contain a graphic, a text control and a bunch of other parts, &lt;EM&gt;only the button&lt;/EM&gt; is actually going to be able to&amp;nbsp;make changes to those components - nothing else can.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Every object can only contain rules that effect ITSELF or it's IMMEDIATE CHILDREN. It can't even access it's own grand-childen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; And if you don't quite follow the 'children' concept, it quite simple - if a UI &lt;EM&gt;contains&lt;/EM&gt; another UI, that can be considered it's &lt;STRONG&gt;child&lt;/STRONG&gt;. So - for example - your main UI contains your various panels that you are showing or hiding. Those panels contain buttons - those buttons would be the &lt;EM&gt;child&lt;/EM&gt; of the panel, and the &lt;EM&gt;grandchild&lt;/EM&gt; of the base UI.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Base&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Menu&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Button1, Button2, Button3 etc.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Panel 1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Button1, Button2, Button3&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Panel 2&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Button1, Button2, Button3&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Each of these is a seperate UI, where &lt;STRONG&gt;Base&lt;/STRONG&gt; is the first UI in the file, &lt;STRONG&gt;Menu&lt;/STRONG&gt; is a main menu and &lt;STRONG&gt;Panel 1 &lt;/STRONG&gt;and &lt;STRONG&gt;Panel 2&lt;/STRONG&gt; are panels containing buttons.&lt;/P&gt;
&lt;P&gt;So, to cover this...&lt;/P&gt;
&lt;P&gt;If you wanted to change the text inside your buttons, you could only do this with a &lt;STRONG&gt;&amp;lt;Set&amp;gt;&lt;/STRONG&gt; tag &lt;EM&gt;inside the button itself&lt;/EM&gt;. No other UI can access the internal parts (eg. text objects, graphics etc.) of your buttons.&lt;/P&gt;
&lt;P&gt;If you wanted to set a property that&amp;nbsp;changes a property in&amp;nbsp;the FIRST element in a UI (which is almost always a panel or clip object) then you can do it from the PARENT. For example, Panel2 can change the Visible,&amp;nbsp;Alpha, Scale, Position and other properties of each one of it's buttons.&lt;/P&gt;
&lt;P&gt;If you want to do &lt;EM&gt;anything else, &lt;/EM&gt;you will need to use a property value, such as a &lt;STRONG&gt;Choice&lt;/STRONG&gt;, &lt;STRONG&gt;Command,&amp;nbsp;cor:String, RangedValue&lt;/STRONG&gt;&amp;nbsp;or any other shared property, and you'll need to have rules &lt;EM&gt;inside the button UI&lt;/EM&gt;&amp;nbsp;to deal with the property changing.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3137" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RJYO7sgkE9h8w1Y_fsMisaF_n48/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RJYO7sgkE9h8w1Y_fsMisaF_n48/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RJYO7sgkE9h8w1Y_fsMisaF_n48/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RJYO7sgkE9h8w1Y_fsMisaF_n48/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/NopztCkrpkg" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/08/02/scope-in-mcml.aspx</feedburner:origLink></item><item><title>Classier than using Strings</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/ki9gmeaWIF4/classier-than-using-strings.aspx</link><pubDate>Mon, 30 Jul 2007 07:58:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3118</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3118</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/07/30/classier-than-using-strings.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Oh, another thing that came up in the forums that may work for you if you are playing with Media Center development. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; If you back track a bit to our main menu, or to the list of answers in TriviaCenter, you will find that we load our list by filling an &lt;STRONG&gt;ArrayListDataSet&lt;/STRONG&gt; with Strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; But don't feel limited by that - it's commonly used in all of the examples, but it's worth remembering that you can put &lt;EM&gt;any&lt;/EM&gt; class in the ArrayListDataSet - not just String.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Let's say that we wanted to add a picture to the front of every answer&amp;nbsp;- either something to illustrate our answer, or maybe just an 'A', 'B', 'C', or 'D'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Now we need a different picture for each element. We COULD try and do something that is just way too complicated, like looking up our images in a different data set - but this would be very time consuming and ugly. There's a much easier way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Instead of loading our ArrayListDataSet with strings like we've been doing, we create our own new class (based on ModelItem, because it's going to have it's own properties and we want Media Center to be able to see any changes we make) and fill the dataset with THESE items instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; public class MyCategory : ModelItem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public _Name;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public _Image;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&amp;nbsp;Name { get { return _Name; } }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Image { get { return _Image; } }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Of course, we can also add constructors to make our life a little easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So when we add them to the ArrayListDataSet....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MySet.Add(new MyCategory("General","file:c:\program files\random stuff\general.png"));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MySet.Add(new MyCategory("Entertainment","file:c:\program files\random stuff\entertainment.png"));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; And there's only one other thing we need to change in your MCML code. We can choose to either pass the WHOLE item to our button's UI, or we can set the Image and the Label individually using properties.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; The properties would change from...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Label="[RepeatedItem!cor:String]" &lt;/STRONG&gt;- which took our string and used it as our label, we now use...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Label="[RepeatedItem!me:MyClass.Name]" &lt;/STRONG&gt;- to get the name of the category and&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Label="[RepeatedItem!me:MyClass.Image]" &lt;/STRONG&gt;- to get the filename of the picture.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3118" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/G3u01bulQ785a41Xn0F81qjQ6rg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G3u01bulQ785a41Xn0F81qjQ6rg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/G3u01bulQ785a41Xn0F81qjQ6rg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G3u01bulQ785a41Xn0F81qjQ6rg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/ki9gmeaWIF4" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/07/30/classier-than-using-strings.aspx</feedburner:origLink></item><item><title>Which Class Do I Use?</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/CWVTABf-Gug/which-class-do-i-use.aspx</link><pubDate>Mon, 30 Jul 2007 07:41:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:3117</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=3117</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/07/30/which-class-do-i-use.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I've been helping someone out on the Media Center Sandbox, and I thought one of his questions were fairly relevant to someone who is starting to play with MCML development and their own classes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; He was basically asking 'should the properties I use in my .NET program be the Media Center classes (like Choice, ArrayListDataSet etc.) or standard .NET components, such as List?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Some of these topics are covered in earlier posts, but this is just a summary for those who may be a little confused.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; If you have a property that is going to return something complex - for example, another object that itself has properties -&amp;nbsp;you should always use a Media Center type (if there is a suitable one) or build your own class based on ModelItem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you are just trying to send a string or an integer, use the String and Integer types - these will be fine.&lt;/P&gt;
&lt;P&gt;If you are choosing an element from a list, always use Choice one of the Ranged items. If you have a list of options, always use ArrayListDataSet, or a class of your own that is based on ModelItem.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;But this rule only applies to the properties you expose to Media Center&lt;/EM&gt;. You don't use them for internal values, since most of the ModelItem based classes are not thread safe and will cause exceptions should you use them outside the parent thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reson for this is kinda complicated (see my&amp;nbsp;previous posts&amp;nbsp;for some information on how ModelItem works), but basically, 'ModelItem' allows you to notify Media Center that a property has changed, meaning all of your UI rules will be checked. Without basing your class on ModelItem and calling &lt;STRONG&gt;FirePropertyChanged&lt;/STRONG&gt; where appropriate, changing a property in any complex object will mean that Media Center will simply miss it - your UI will never update properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So the basic rule is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Simple Properties and Internal Variables: Standard .NET Classes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Complex Properties: Media Center Classes&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=3117" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/l1rk54fEMsyn7fgyWPDQP16-s8s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l1rk54fEMsyn7fgyWPDQP16-s8s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/l1rk54fEMsyn7fgyWPDQP16-s8s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l1rk54fEMsyn7fgyWPDQP16-s8s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/CWVTABf-Gug" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/07/30/which-class-do-i-use.aspx</feedburner:origLink></item><item><title>No Post This Week - Computer is Dying</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/9G_i_qPOiy4/no-post-this-week-computer-is-dying.aspx</link><pubDate>Sun, 01 Jul 2007 22:26:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2993</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2993</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/07/02/no-post-this-week-computer-is-dying.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&amp;nbsp; Sorry, no new stage of TriviaCenter development this week. I'm starting to think that my new place was built ontop of an Aboriginal burial ground...or at the very least a large magnetic plate. My development machine has been fairly badly crippled by a hardware failure - my on-board USB has died on me and the computer has now slowed down to an absolute crawl whenever any I/O is happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So there's an upgrade/replacement motherboard in my not-to-distant future, but after a couple of expensive weeks, I'm going to have to wait until I get the cash together. Next week is the housewarming party, so I'm not entirely sure I'll get an update out then either, particularly with new Yougle changes happening, since it's died recently too due to YouTube site changes.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; [EDIT: The problem is mostly fixed now. While the USB on my motherboard is still burnt out, I discovered the reason for the radical slowdown. One of my RAM modules was disconnected when I installed the USB card...which meant that my Vista was running with 512MB of memory. And I agree with the minimum specs on this one - Vista is completely unusable for development work with anything under 1GB]&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Oh, and I've got some advice to software developers who are thinking of going the 'donation supported' route. If it's going to cost&amp;nbsp;you money to distribute&amp;nbsp;your software, DON'T DO IT.&amp;nbsp;I've had over 10,000 downloads of the original Yougle with three donations, and 500 downloads of EMUCenter with none. The additional server costs alone have been over $200...so it looks like future products of mine may be coming with additional features that you can only unlock with a registration key.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2993" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mJcL-1dILO5NwRpiR4UHqT8xyHM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mJcL-1dILO5NwRpiR4UHqT8xyHM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mJcL-1dILO5NwRpiR4UHqT8xyHM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mJcL-1dILO5NwRpiR4UHqT8xyHM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/9G_i_qPOiy4" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/07/02/no-post-this-week-computer-is-dying.aspx</feedburner:origLink></item><item><title>Forum Now Open for Business</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/yIplXwbpFdo/forum-now-open-for-business.aspx</link><pubDate>Thu, 28 Jun 2007 08:35:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2977</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2977</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/28/forum-now-open-for-business.aspx#comments</comments><description>&lt;P&gt;Ian Dixon has kindly donated the developer forum to let us all discuss the topics I'm covering on this blog. So if you have any questions, want to discuss possible features for TriviaCenter or even post code and suggestions, please feel free to jump in.&lt;/P&gt;
&lt;P&gt;And if you want a little bit of a chat about Media Center development in general, feel free to vent your frustrations or express your joy here. And of course any expressions of your new-found love for me will also be accepted ;)&lt;/P&gt;
&lt;P&gt;Please read the 'Welcome Aboard' post though - this is not intended to be a replacement for the Media Center Sandbox forums. If you are going to ask a development question, please try to ask those that are based on the MCMLookalike libraries, TriviaCenter&amp;nbsp;or my other posts here - if it's about something else, you'll get a much faster reply from the sandbox.&lt;/P&gt;
&lt;P&gt;Feel like joining in? &lt;A class="" href="http://thedigitallifestyle.com/cs/forums/39/ShowForum.aspx"&gt;follow this link&lt;/A&gt; to the forums!&lt;/P&gt;
&lt;P&gt;[Update: Link fixed]&lt;/P&gt;&lt;p&gt;&lt;img src="http://thedigitallifestyle.com/cs/ink/199.ashx?633186193227062136" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2977" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/--0ewEhLQtFKgR1ZyX72PZ4E1Wc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/--0ewEhLQtFKgR1ZyX72PZ4E1Wc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/--0ewEhLQtFKgR1ZyX72PZ4E1Wc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/--0ewEhLQtFKgR1ZyX72PZ4E1Wc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/yIplXwbpFdo" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Forum/default.aspx">Forum</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/28/forum-now-open-for-business.aspx</feedburner:origLink></item><item><title>Stage 11: Responding To Answers (Timers and Commands)</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/GxwS5dud57s/stage-11-responding-to-answers-timers-and-commands.aspx</link><pubDate>Sat, 23 Jun 2007 06:46:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2943</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2943</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/23/stage-11-responding-to-answers-timers-and-commands.aspx#comments</comments><description>&lt;P&gt;OK, we can now answer trivia questions and keep a score...but you've got to keep watching that darn bottom corner to see if you got it right or not!&lt;/P&gt;
&lt;P&gt;So how about we add a little more feedback to the questions by having it obvious if you were right or wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;To do that, we are going to need another UI component. Let's start by making one for the 'Correct' response.&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;UI&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;AnswerResponse&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&amp;lt;&lt;FONT color=#a31515 size=2&gt;UI/&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In this case, we are going to make a large piece of text (saying 'Correct!') appear on the screen where our list of answers are. It will fade in and move 'towards' us, then fade back out.&lt;/P&gt;
&lt;P&gt;So we build our content...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;MainPanel&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Alpha&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Visible&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Children&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Text&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Color&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"Green&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Correct!&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Font&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Arial,50,Bold&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Children&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;Basics done. Now, since we want to&amp;nbsp;make this appear to 'zoom in', we will need an animation that scales the object from the &lt;EM&gt;middle. &lt;/EM&gt;We can do this by setting it's &lt;STRONG&gt;CenterPointPercent&lt;/STRONG&gt; property.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;MainPanel&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Alpha&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Visible&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;CenterPointPercent&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0.5,0.5,0.5&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;Since we also only want this text to appear occasionally (rather than all the time) I've set the &lt;STRONG&gt;Visible&lt;/STRONG&gt; property to false.&lt;/P&gt;
&lt;P&gt;I've probably already explained this, but just to make sure you know...if an object is not &lt;STRONG&gt;Visible, &lt;/STRONG&gt;then&lt;STRONG&gt; &lt;/STRONG&gt;it does not interact with the keyboard and mouse. If an object has it's alpha set to 0, you won't be able to SEE it, but it can still block mouse events. So we want to make this object &lt;EM&gt;completely&lt;/EM&gt; dissapear. In this case, we use &lt;STRONG&gt;Visible&lt;/STRONG&gt; rather than &lt;STRONG&gt;Alpha&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Now, when a item changes from &lt;STRONG&gt;Visible="false"&lt;/STRONG&gt; to &lt;STRONG&gt;Visible="true"&lt;/STRONG&gt;, the 'Show' animation is run. So let's create an animation for our panel that will fade the object in, enlarge it, then fade it out again.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;MainPanel&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Alpha&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Visible&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;CenterPointPercent&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0.5,0.5,0.5&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Animations&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Animation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Type&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Show&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Keyframes&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;AlphaKeyframe&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Time&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;RelativeTo&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Absolute&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;ScaleKeyframe&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Time&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;RelativeTo&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Absolute&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1,1,1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;AlphaKeyframe&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Time&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0.3&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;RelativeTo&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Absolute&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;AlphaKeyframe&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Time&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;2&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;RelativeTo&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Absolute&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;AlphaKeyframe&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Time&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;2.3&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;RelativeTo&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Absolute&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;ScaleKeyframe&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Time&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;2.3&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;RelativeTo&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Absolute&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1.2,1.2,1.2&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Keyframes&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Animation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Animations&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;The entire animation will run (as you can see from the above 'Time' settings) 2.3 seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cute. But how do we trigger the thing to appear?&lt;/P&gt;
&lt;P&gt;Well, there are a number of ways to do this. You could create a string that had three states - for example, "Right", "Wrong" and "Waiting", you could use a Choice object, you could do all kinds of things that are messy and complicated. But MCML has a special object designed to handle these kinds of 'event driven' situations.&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;Command&lt;/STRONG&gt; object can be used to make MCML objects do what you need them to do in response to an event. In this case, we are going to enter our C# code and create two &lt;STRONG&gt;Command&lt;/STRONG&gt; objects - one for a correct answer and one for an incorrect answer.&lt;/P&gt;&lt;FONT color=#2b91af size=2&gt;
&lt;P&gt;Command&lt;/FONT&gt;&lt;FONT size=2&gt; _WasRight;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Command&lt;/FONT&gt;&lt;FONT size=2&gt; _WasWrong;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Command&lt;/FONT&gt;&lt;FONT size=2&gt; WasRight&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp; get &lt;/FONT&gt;&lt;FONT size=2&gt;{ &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; _WasRight; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Command&lt;/FONT&gt;&lt;FONT size=2&gt; WasWrong&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp; get &lt;/FONT&gt;&lt;FONT size=2&gt;{ &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; _WasWrong; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;With 'Command' objects, we don't need to bother about 'FirePropertyChanged' or any of that business. To make things happen from our C# code, we need to &lt;EM&gt;Invoke&lt;/EM&gt; them. This is very easy...they have a member function called &lt;STRONG&gt;Invoke&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;So when we validate our answer in C#, we do the following...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (Right)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _WasRight.Invoke();&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;else&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _WasWrong.Invoke();&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;P&gt;There you go - if the answer was correct, we &lt;STRONG&gt;Invoke&lt;/STRONG&gt; the 'WasRight' and if was wrong, we &lt;STRONG&gt;Invoke&lt;/STRONG&gt; the 'WasWrong' commands.&lt;/P&gt;
&lt;P&gt;Now we need to react to them. Command objects work in a very similar way to the &lt;STRONG&gt;ClickHandler&lt;/STRONG&gt; object. You use a &lt;STRONG&gt;Changed&lt;/STRONG&gt; rule to see if anything has happened. Let's see how we do this to handle when the user has answered the question right...&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Changed&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.WasRight.Invoked]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[MainPanel.Visible]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Changed&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;So&amp;nbsp;when the 'Invoked' property of the WasRight command changes (which basically means 'when somebody calls &lt;STRONG&gt;Invoke&lt;/STRONG&gt;'), it should immediately set the &lt;EM&gt;MainPanel&lt;/EM&gt; object (the panel that contains our text object) to be visible.&lt;/P&gt;
&lt;P&gt;This will trigger the Show animation, which will give us a lovely fade in and fade out!&lt;/P&gt;
&lt;P&gt;But hold on!&lt;/P&gt;
&lt;P&gt;We &lt;EM&gt;fade&lt;/EM&gt; the object out, but we never make it &lt;EM&gt;invisible&lt;/EM&gt; again. As I said earlier, an object that with an Alpha of 0 can still block mouse clicks and interaction, so we need to make sure that we set the &lt;STRONG&gt;Visible&lt;/STRONG&gt; attribute back to &lt;EM&gt;false&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;Windows Media Center doesn't have a method of detecting the end of an animation. So how do we get around this, and make our object invisible again?&lt;/P&gt;
&lt;P&gt;This is where &lt;EM&gt;timers&lt;/EM&gt; come in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Timer objects are similar to commands and are easy to use methods of timing events in your MCML markup. In this case, we have an animation that is &lt;STRONG&gt;2.3&lt;/STRONG&gt; seconds long. So what we need is a timer that will tell us when 2.3 seconds have elapsed!&lt;/P&gt;
&lt;P&gt;We create our timer object in the Locals section...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Locals&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Timer&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VisibleTimer&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Interval&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;2300&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Locals&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;And as you can see, we give it a name and an 'interval' (which is the time we want to measure, in milliseconds). You can start and stop timers by using the &lt;STRONG&gt;Enabled &lt;/STRONG&gt;property. If we wanted our timer to turn on immediately after the page opens, we could set this property now - but it defaults to "false", which is what we want.&lt;/P&gt;
&lt;P&gt;So now, we need to turn the timer on. We want to do that when the animation starts...and the animation is triggered by setting the &lt;STRONG&gt;Visible&lt;/STRONG&gt; property on the panel to &lt;EM&gt;true&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;Find the code where we made the panel visible, and add a line to switch the timer's &lt;STRONG&gt;Enabled&lt;/STRONG&gt; property to &lt;EM&gt;true&lt;/EM&gt;. This will turn the timer on.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[MainPanel.Visible]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[VisibleTimer.Enabled]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; =&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;To catch when the 2.3 seconds have elapsed, you check for the &lt;STRONG&gt;Tick&lt;/STRONG&gt; property in the exact same way we checked the &lt;STRONG&gt;Invoked&lt;/STRONG&gt; property in a &lt;STRONG&gt;Command&lt;/STRONG&gt; object.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Changed&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[VisibleTimer.Tick]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[MainPanel.Visible]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[VisibleTimer.Enabled]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;false&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Changed&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;Almost an exact opposite of the &lt;STRONG&gt;Invoked&lt;/STRONG&gt; function, this one makes the panel invisible again and turns the timer off (although since this is a one-time timer, we don't REALLY need to do that).&lt;/P&gt;
&lt;P&gt;Excellent. Let's add it to our main UI and see how it looks.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;me:AnswerResponse&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;game&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FormLayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Top&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.45&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Bottom&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.55&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Horizontal&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;me:AnswerResponse&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;That code will create the AnswerResponse object (passing our&amp;nbsp;'TriviaCenter' object so it can check for the &lt;STRONG&gt;WasRight&lt;/STRONG&gt; command to be invoked).&lt;/P&gt;
&lt;P&gt;So now we need one for 'Wrong'. And it's going to be &lt;EM&gt;almost&lt;/EM&gt; identical. Hmm...do we&amp;nbsp;really need to do all that work again, or copy and paste the darn thing and have to do TWO changes should we ever add new features or fix bugs?&lt;/P&gt;
&lt;P&gt;Well...why&amp;nbsp;make this AnswerResponse object a little more universal?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ask yourself&amp;nbsp;what the major differences are probably going to be between the 'Right' and 'Wrong' events.&amp;nbsp;For getting it basically working, all we really need is to change the writing, and maybe change the colour.&lt;/P&gt;
&lt;P&gt;So we dive into our AnswerResponse object, and make &lt;EM&gt;properties&lt;/EM&gt; for these differences.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Properties&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;cor:String&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Label&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;cor:String&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;$Required&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Color&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Colour&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Color&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Green&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Command&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ShowWhen&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Command&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;$Required&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Properties&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&amp;nbsp;This gives us the text label, the colour and the Command object we need to react to. We simply chop and change the values in our content and in our rules sections, and we have something nice and re-usable!&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;me:AnswerResponse&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Label&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Correct!&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Colour&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Green&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ShowWhen&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.WasRight]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FormLayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Top&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.45&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Bottom&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.55&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Horizontal&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;me:AnswerResponse&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;me:AnswerResponse&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Label&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Wrong!&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Colour&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Red&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ShowWhen&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.WasWrong]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FormLayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Top&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.45&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Bottom&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.55&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Horizontal&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;me:AnswerResponse&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;The right and wrong answer animations...done with style. &lt;/P&gt;
&lt;P&gt;Remember to leave comments if you found this helpful...it's not like I do this for the money! Although my MSDN subscription is coming up soon, and if you happened to have a spare $900AUD...&amp;nbsp;&amp;nbsp; :)&lt;/P&gt;
&lt;P&gt;Next time, let's add some graphics and sound to this visually dull affair...and maybe we can spice up the questions too.&lt;/P&gt;
&lt;P&gt;Sample code can be found &lt;A class="" title=here href="http://www.push-a-button.com.au/downloads/triviacenter/stage11.zip" target=_blank&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2943" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/L7b13VBq8TzEO0ECs1xzIqLdbZU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L7b13VBq8TzEO0ECs1xzIqLdbZU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/L7b13VBq8TzEO0ECs1xzIqLdbZU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L7b13VBq8TzEO0ECs1xzIqLdbZU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/GxwS5dud57s" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/23/stage-11-responding-to-answers-timers-and-commands.aspx</feedburner:origLink></item><item><title>WiX way do I go?</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/DNNsD35xCfE/wix-way-do-i-go.aspx</link><pubDate>Sat, 23 Jun 2007 02:15:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2939</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2939</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/23/wix-way-do-i-go.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Charlie from Microsoft has made a post commenting on my last blog entry - writing an installer with the standard Setup Project in Visual Studio on&amp;nbsp;the sandbox blog (&lt;A href="http://blog.mediacentersandbox.com/UseTheRegistrationAPIWiX.aspx"&gt;http://blog.mediacentersandbox.com/UseTheRegistrationAPIWiX.aspx&lt;/A&gt;)&amp;nbsp;- oh, and thanks &lt;A class=headermaintitle id=ctl00___ctl00___bth___BlogTitle href="http://blogs.msdn.com/astebner/default.aspx"&gt;Aaron Stebner&amp;nbsp;&lt;/A&gt;for point this out on &lt;EM&gt;his&lt;/EM&gt; blog at &amp;nbsp;&lt;A href="http://blogs.msdn.com/astebner/archive/2007/06/20/3439251.aspx"&gt;http://blogs.msdn.com/astebner/archive/2007/06/20/3439251.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I more than half-expected a response like this, and I admit that I probably didn't emphasise the point enough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;EM&gt;I have provided this method of installing as an example, but it is not the recomended way of producing installers for Media Center applications&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I chose this method for three reasons...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;A. &lt;/STRONG&gt;It shows the user what REALLY happens when you call &lt;STRONG&gt;RegisterMCEApp.exe&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;B.&lt;/STRONG&gt; It allows me to give the users a working installer program &lt;EM&gt;without&lt;/EM&gt; having to install another application to get the sample code to run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;C&lt;/STRONG&gt;. While WiX is the FAR more flexible, powerful and useful tool, I'm not all that familliar with it yet (although I have played around with ORCA enough with my previous installers to understand that it's&amp;nbsp;primarily an XML interface to the installer database), so I'm not going to give all that much advice on a topic I &lt;STRONG&gt;REALLY&lt;/STRONG&gt; don't understand. I'll stick to a topic that&amp;nbsp;I know a little - but only slightly more - about.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;D. &lt;/STRONG&gt;At least partly, because I &lt;EM&gt;knew&lt;/EM&gt; it would provoke a response, and I was trying to highlight the fact that I believe that if a feature is going to provoke a response like "Please don't use this method", perhaps it shouldn't even appear in the SDK - or it should appear with very large warning labels (again, I haven't checked the latest SDK...maybe they HAVE put those warnings in!)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Anyway, if you ARE interested in using WiX (which you should if you plan on formally releasing your code), I'll take you on a quick walkthrough of making the XML file you'll need. If you followed the basics of the last stage, you'll find this one a breeze.&lt;/P&gt;&lt;STRONG&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;application&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;title&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TriviaCenter&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;id&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;{D0515079-4F80-4970-93D5-02F5CF736444}&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;entrypoint&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;id&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;{396E0EB3-BC22-4cb2-A6CB-954B5F7CF444}&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;addin &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;= &lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TriviaCenter.BaseAddin,TriviaCenter,Culture=Neutral,Version=0.0.1000.0,PublicKeyToken=aadbb711d5721433&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;"&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;title &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;= &lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TriviaCenter&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;"&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;description &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;= &lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;A Trivia Game for your Media Center&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;"&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ImageUrl &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;= &lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;.\AppIcon.png&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;category&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;category&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;More Programs&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;category&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;category&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Services\Games&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;entrypoint&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;application&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;
&lt;P&gt;&amp;nbsp; This is much clearer than the registry format, to be honest, and much more simple. Your &lt;STRONG&gt;application&lt;/STRONG&gt; tag defines a new Media Center app. You simply give your app a name, and a GUID (Globally Unique IDentifier). You make GUID's with the GUIDGEN tool that is part of Visual Studio - go to 'Tools' and selecte 'Create GUID'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Then you define an 'Entry Point', which is basically&amp;nbsp;the 'button' that you will use to start your addin. For this, you will need a title, description, another GUID (NOT the one you used in the 'Application' object!) and the complete path to your .NET class. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; For an example of building this full path to your class, please see the Stage 10 documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally, you choose your &lt;EM&gt;categories&lt;/EM&gt;. This specifies &lt;EM&gt;where&lt;/EM&gt; you want the 'entry point' button to appear. In this case, we have chosen both the 'More Programs' list and the 'Games' list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; There you have it, a basic XML file that you can use to register your application with Media Center. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; You can even make a post-build command to register your application - but since you really only ever need to register and unregister &lt;EM&gt;once&lt;/EM&gt;, I've actually turned 'Register MCML Application' into an entry in my Tools menu. Check the screenshot below.&lt;/P&gt;
&lt;P&gt;&lt;IMG hspace=10 src="http://thedigitallifestyle.com/cs/photos/developer/images/2940/original.aspx" border=1&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Oh, there is one other advantage of using this method during development. If you use &lt;STRONG&gt;RegisterMCEApp &lt;/STRONG&gt;and an XML file, Media Center is notified of the change to it's programs list and the list updates &lt;EM&gt;without you having to restart Media Center&lt;/EM&gt;. This is VERY handy when debugging, because you can get very sick of the Media Center start window.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2939" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/257Z7JJFSzMDvXJo-mzWnUy8tlA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/257Z7JJFSzMDvXJo-mzWnUy8tlA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/257Z7JJFSzMDvXJo-mzWnUy8tlA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/257Z7JJFSzMDvXJo-mzWnUy8tlA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/DNNsD35xCfE" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Installing/default.aspx">Installing</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Reply/default.aspx">Reply</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/23/wix-way-do-i-go.aspx</feedburner:origLink></item><item><title>Stage 10 - Installing It</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/qmu0o4bjzfU/stage-10-installing-it.aspx</link><pubDate>Sun, 17 Jun 2007 06:51:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2915</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2915</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/17/stage-10-installing-it.aspx#comments</comments><description>&lt;P&gt;OK, now there are interesting problems when installing an application for Media Center, because there are two different ways of registering your application.&lt;/P&gt;
&lt;P&gt;To appear in Media Center, several entries need to be made to the Windows Registry.&lt;/P&gt;
&lt;P&gt;In the first release of the Windows Media Center SDK (and in previous versions, such as Windows XP Media Center Edition) Microsoft suggested that you could either create entries into the registry yourself, located under the registry key..&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Local Machine\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Personally, I like this technique. But there are two drawbacks.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;1.&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/EM&gt;Charlie, the Microsoft product director for Media Center extensibility (IE. the Media Center SDK) has informed me that MS won't guarantee that the method of registering plugins will remain the same. Of course, I then asked 'OK - then why do you TELL us to register them that way?' and there wasn't much of a response. I'm yet to see if this is still true in the newer version of the Media Center SDK.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;2&lt;/EM&gt;. If you run a 32 bit installation on a 64 bit version of Windows, your registry entries are placed in an &lt;EM&gt;entirely different tree&lt;/EM&gt;. So the 64 bit version of Media Center can't actually see the keys you've created.. This means you MUST produce both a 64 and 32 bit version of your installer.&lt;/P&gt;
&lt;P&gt;Microsoft themselves suggest you use &lt;STRONG&gt;WiX&lt;/STRONG&gt;, which is an open source product of theirs that allows you to create installers - but since it's a complicated platform and I want to be able to take you through the basics without needing any additional software, I'm going to take you through the easy, but perhaps not officially supported method of adding registry keys directly.&lt;/P&gt;
&lt;P&gt;SO - let's take a look at our installer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first thing we need to do is add our program to the &lt;EM&gt;Global Assembly Cache&lt;/EM&gt;. The GAC is a lot like copying a DLL file into the Windows/System directory - it creates a single assembly that you can share among your various applications. It allows Media Center to find your C# classes and code.&lt;/P&gt;
&lt;P&gt;This has already been done in the copy of the installer from our last version of TriviaCenter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next up, we need to set up our registry entries.&lt;/P&gt;
&lt;P&gt;A Media Center application needs at least two GUID's (Globally Unique IDentifiers). The first one is the GUID for the application as a whole&amp;nbsp;(for instance, TriviaCenter) while the second is for an &lt;EM&gt;entry point&lt;/EM&gt; into the application.&lt;/P&gt;
&lt;P&gt;An entry point is basically a visible button that a user can press to access your program. A single application can have a number of entry points. For example, MoreWithMyMusic (a program of mine) has a single Application GUID, but it has TWO buttons that appear in the More Programs list - one to normalise all of your music, with a second one to search for Ultrastar songs.&lt;/P&gt;
&lt;P&gt;TriviaCenter is very simple. We only need one entry point. So use GUIDGEN (you can often find this tool in the 'Tools' menu of Visual Studio) to build ourselves a new Application and Entry Point GUID.&lt;/P&gt;
&lt;P&gt;In our example, I picked &lt;STRONG&gt;{D0515079-4F80-4970-93D5-02F5CF736444} &lt;/STRONG&gt;for the app, and &lt;STRONG&gt;{396E0EB3-BC22-4cb2-A6CB-954B5F7CF444} &lt;/STRONG&gt;for the entry point.&lt;/P&gt;
&lt;P&gt;So at the end of the day, our registry should look like this...&lt;/P&gt;&lt;STRONG&gt;...\Windows\CurrentVersion\Media Center\Extensibility&lt;/STRONG&gt; 
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Applications&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {Our Application GUID}&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title (String)&amp;nbsp;&amp;nbsp;&amp;nbsp; "TriviaCenter"&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Entry Points&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {Our Entry Point GUID}&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;Title (String)&amp;nbsp;&amp;nbsp;&amp;nbsp; "TriviaCenter"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Description (String)&amp;nbsp;&amp;nbsp;&amp;nbsp; "Sample Code by Steven Harding"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppID (String)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;EM&gt;Our Application GUID"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timestamp (Integer)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Random Numbers - They Don't Really Matter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Addin (String)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;EM&gt;The complete path of your addin"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ImageURL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "The Path to our Image File"&lt;/P&gt;
&lt;P&gt;In the above list, &lt;STRONG&gt;bold&lt;/STRONG&gt; text represents registry KEYS, while non-bold text represents registry VALUES.&lt;/P&gt;
&lt;P&gt;So now that we know the GUIDS that we need, all we really need to throw together are two things - we need to create an image file or logo&amp;nbsp;that should appear in our list of Media Center games, and we also need to discover what the path of our C# assembly is supposed to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To make the full path for your assembly, you need a few parts. The first part is the &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name of the AddInModule class&amp;gt; , &amp;lt;Full Name of the Assembly&amp;gt; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;For example, the full path to the MCMLookalike sample addin is...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;MCMLookalike,MCMLookalike,Culture=Neutral,Version=0.0.1000.0,PublicKeyToken=aadbb711d5721433&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Because an assembly that is in the Global Assembly Cache can have many versions, you need to do more than just select the assembly by name. This method, with specifying culture, version and a key token allows you to be secure in the fact that the version of the assembly you expected is the version you are getting.&lt;/P&gt;
&lt;P&gt;So how do we figure out this address for TriviaCenter?&lt;/P&gt;
&lt;P&gt;Media Center applications all start from the same point - a class that is based on 'IAddInModule' and 'IAddInEntryPoint'. If you check out the source code in 'AddIn.cs', you will find that we already have a class like that. It's name is 'BaseAddin'.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; Launch(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;AddInHost&lt;/FONT&gt;&lt;FONT size=2&gt; host)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Host = host;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_session = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;HistoryOrientedPageSession&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_session.GoToPage(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"resx://TriviaCenter/TriviaCenter.Resources/Default"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;If you follow the code down for a while, you will find that there's a method called 'Launch'. All it does is creates a new 'HistoryOrientedPageSession' object, and calls 'GoToPage' to open our first MCML file.&lt;/P&gt;
&lt;P&gt;But OOPS - we don't HAVE an MCML file called 'Default' anymore. Let's fix this and change the path to this one...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_session.GoToPage(&lt;FONT color=#a31515 size=2&gt;"resx://TriviaCenter/TriviaCenter.Resources/StartPage"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;The &lt;STRONG&gt;HistoryOrientedPageSession&lt;/STRONG&gt; class allows Media Center to remember the 'history' of your application, meaning that when you press 'Back', you will return to the MCML file you were in previously. &lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;BaseAddin&lt;/STRONG&gt; class is in the namespace 'TriviaCenter'.&lt;/P&gt;
&lt;P&gt;So - we now know how to start our path - it's &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;TriviaCenter.BaseAddin&lt;/STRONG&gt;&lt;EM&gt; , &amp;lt;Full Name of the Assembly&amp;gt; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;How do we get the full name? Well there are a few command line tricks you can do, but I find it easier to cheat a little. &lt;/P&gt;
&lt;P&gt;As part of our compile we are already adding TriviaCenter to the Global Assembly Cache. So if we check the cache, it will already have all of the information we need.&lt;/P&gt;
&lt;P&gt;Go to 'Start | Run' and check out &lt;STRONG&gt;%WINDIR%/Assembly &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:488px;HEIGHT:229px;" height=229 hspace=10 src="http://thedigitallifestyle.com/cs/photos/developer/images/2916/original.aspx" width=488 border=1&gt;&lt;/P&gt;
&lt;P&gt;This is the folder where all of the files in your Global Assembly Cache are kept. All you need to do is scroll down from the top and find yourself 'TriviaCenter'. If you hover your mouse over the file (or right-click it and choose 'Properties') you will find the full name for the assembly.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;TriviaCenter,Culture=Neutral,Version=0.0.1000.0,PublicKeyToken=aadbb711d5721433&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;And there we go - all done. Our complete path is...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;TriviaCenter.BaseAddin&lt;/STRONG&gt;&lt;EM&gt; &lt;/EM&gt;&lt;STRONG&gt;,TriviaCenter,Culture=Neutral,Version=0.0.1000.0,PublicKeyToken=aadbb711d5721433&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The last&amp;nbsp;thing is to associate this entry point with a part of Media Center. If you've ever played in 'More Programs', you will have noticed that you have different categories, such as Games, Music, TV etc. &lt;/P&gt;
&lt;P&gt;The SDK gives a good list of your options here. To associate our addin with one of these places, you simply create a key under the section that you want. For example, to register our app under 'More Programs', you can simply create it under..&lt;/P&gt;
&lt;P&gt;.../&lt;STRONG&gt;Media Center/Extensibility/Categories/More Programs/&lt;EM&gt;Entry Point GUID&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppID (String)&amp;nbsp; "&lt;EM&gt;GUID of Application&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;To register it as a game, we add a key with the entry point GUID under&lt;/P&gt;
&lt;P&gt;../&lt;STRONG&gt;Media Center/Extensibility/Services/Games/&lt;EM&gt;Entry Point GUID&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppID (String)&amp;nbsp; "&lt;EM&gt;GUID of Application&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And all of the rest is kinda straight-forward. I'm not going to go into details of how to use the setup system here - all you really have to do is go through, give the thing a new ProductCode and UpgradeCode, change 'MCMLookalike' to 'TriviaCenter' and generally play around.&lt;/P&gt;
&lt;P&gt;Then change your build configuration from 'Debug' to 'Release' and compile. It will create a setup file for you.&lt;/P&gt;
&lt;P&gt;For the updated code &amp;amp; installer, download &lt;A class="" title=this href="http://www.push-a-button.com.au/downloads/triviacenter/stage10.zip"&gt;this&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2915" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nDseUnWyBOFLyMinrKiGu2zlpQM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nDseUnWyBOFLyMinrKiGu2zlpQM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nDseUnWyBOFLyMinrKiGu2zlpQM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nDseUnWyBOFLyMinrKiGu2zlpQM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/qmu0o4bjzfU" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Media+Center/default.aspx">Media Center</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/17/stage-10-installing-it.aspx</feedburner:origLink></item><item><title>My Rant: Steve Jobs - Do Your Research</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/-GY4Sqm1hG8/steve-jobs-do-your-research.aspx</link><pubDate>Wed, 13 Jun 2007 02:21:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2887</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2887</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/13/steve-jobs-do-your-research.aspx#comments</comments><description>&lt;P&gt;Steve Jobs recently announced something about the Apple TV&amp;nbsp;that REALLY irritated me&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;"This is the first time users can easily browse, find and watch YouTube videos right from their living room couch..."&lt;/EM&gt;&lt;/STRONG&gt; &lt;/P&gt;
&lt;P&gt;Ahem. Really.&lt;/P&gt;
&lt;P&gt;I'm not going to rant about Apple vs MS operating systems here - my friends with Macs know my opinions. &lt;/P&gt;
&lt;P&gt;But I think if someone is going to make a "This is a first" announcement, they should consider doing the&amp;nbsp;research behind it. I spent a LOT of time developing the first Yougle, and it's friend Yougle 2...and having someone say something like this leaves me quite annoyed.&lt;/P&gt;
&lt;P&gt;Particularly since the fact that he is Steve Jobs means that everyone will &lt;EM&gt;believe&lt;/EM&gt; it.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;And&lt;/EM&gt; he shares my first name! Ahh!&lt;/P&gt;
&lt;P&gt;So if anyone knows him (or his email address) and enjoyed Yougle, please give him a quick slap on the head and ask him to at least send me an email saying 'oops - sorry for that!'. I'm also happy to accept millions of dollars in a settlement, but just an apology would be nice :)&lt;/P&gt;
&lt;P&gt;Anyway, I think if you look hard enough you may also find that other programs such as MythTV and TVidia can handle Youtube videos, as well as the XBox Media Player. Of course, that last one requires a hacked XBox, so probably doesn't count as a consumer product.&lt;/P&gt;
&lt;P&gt;Anyway, I've had my rant...back to Media Center development...&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2887" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_GsxOa4H5nWxREgJ0TanP_YgoZQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_GsxOa4H5nWxREgJ0TanP_YgoZQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_GsxOa4H5nWxREgJ0TanP_YgoZQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_GsxOa4H5nWxREgJ0TanP_YgoZQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/-GY4Sqm1hG8" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Media+Center/default.aspx">Media Center</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Rant/default.aspx">Rant</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Apple+TV/default.aspx">Apple TV</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/13/steve-jobs-do-your-research.aspx</feedburner:origLink></item><item><title>EMUCenter Is Out Now</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/RHqLnn0FnUo/emucenter-is-out-now.aspx</link><pubDate>Mon, 11 Jun 2007 10:52:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2870</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>6</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2870</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/11/emucenter-is-out-now.aspx#comments</comments><description>&lt;P&gt;The guys on &lt;A href="http://www.thegreenbutton.com/"&gt;http://www.thegreenbutton.com&lt;/A&gt; have been asking me for features in MAMECenter, so I spent a chunk of time recently (with my internet connection gone) writing some code to make it happen.&lt;/P&gt;
&lt;P&gt;Say hello to 'EMUCenter'. It lets you create your own list of games to play from within Media Center. You can add your normal Windows games, as well as games from your old favourite machines (assuming you still own those disks and haven't thrown them out, of course!).&lt;/P&gt;
&lt;P&gt;If you would like to check it out (and tell me if it doesn't work!) feel free to drop on by the greenbutton forums - &lt;A href="http://thegreenbutton.com/forums/192174/ShowThread.aspx#192174"&gt;http://thegreenbutton.com/forums/192174/ShowThread.aspx#192174&lt;/A&gt;&amp;nbsp;- download the program and leave some comments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's also&amp;nbsp;a very early draft of the new Yougle for Vista - there's a few problems with the buffering (don't start any large videos, since it takes AGES for the darn thing to buffer the video for Media Player)...but it's generally running. Well, at least enough so I can let you play with it. &lt;/P&gt;
&lt;P&gt;Check it out at http://www.push-a-button.com.au/products/mce/vista/yougle2/index.php&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2870" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/S3EBBEXp9YCkMArP28YVZx9KKNU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S3EBBEXp9YCkMArP28YVZx9KKNU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/S3EBBEXp9YCkMArP28YVZx9KKNU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S3EBBEXp9YCkMArP28YVZx9KKNU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/RHqLnn0FnUo" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/06/11/emucenter-is-out-now.aspx</feedburner:origLink></item><item><title>Sorry for the Delay</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/Tcrmhvkizr8/sorry-for-the-delay.aspx</link><pubDate>Mon, 21 May 2007 08:51:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2801</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2801</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/05/21/sorry-for-the-delay.aspx#comments</comments><description>&lt;P&gt;Sorry it's been so long since my last post, but with moving house at the moment there isn't as much time as I'd normally have for posting.&lt;/P&gt;
&lt;P&gt;And once I got the time, my Media Center HDD died. I thought I'd finally take the opportunity to bring the little guy up to date by finally installing Windows Vista Home Premium on him.&amp;nbsp;It's an older system though, so it's taking time and effort&amp;nbsp;to make Vista&amp;nbsp;and Media Center completely happy in&amp;nbsp;it's new home.&lt;/P&gt;
&lt;P&gt;But there's a new post today - and it's a BIGGIE. Yes, the code below would take you to a point where your application REALLY DOES SOMETHING!&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2801" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1aGV-ME5WV7_6B83_6FeSTETaFo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1aGV-ME5WV7_6B83_6FeSTETaFo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1aGV-ME5WV7_6B83_6FeSTETaFo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1aGV-ME5WV7_6B83_6FeSTETaFo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/Tcrmhvkizr8" height="1" width="1"/&gt;</description><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/05/21/sorry-for-the-delay.aspx</feedburner:origLink></item><item><title>Stage 9: Navigating to a New Page &amp; Getting Trivia Data</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/NByYf1BFlgU/stage-9-navigating-to-a-new-page.aspx</link><pubDate>Sun, 20 May 2007 06:57:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2795</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2795</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/05/20/stage-9-navigating-to-a-new-page.aspx#comments</comments><description>&lt;P&gt;&amp;nbsp;&amp;nbsp; Allright&amp;nbsp;- are you like me, and you've had enough of playing with this scroller? It's time to hang that up and start working on something REAL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Our first step is to go to a new MCML page. This first page is handy, but it's now done it's job - the user can now choose a category. But to ask a question, we should have a new MCML page, to keep both parts nice and seperate (also, if we have them as two seperate pages, the 'back' button will then go from asking a question, to asking for a category).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; To move to another page in an MCML application, we use the 'Navigate' action. 'Navigate' allows you to make&amp;nbsp;Media Center&amp;nbsp;load another MCML file. You specify the name of the file (normally a resource inside your C# assembly) to navigate to. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Navigate&lt;/STRONG&gt; will normally go to the very first UI it finds within the target MCML file. However, if for some reason you want it to navigate to a &lt;EM&gt;particular&lt;/EM&gt; UI, you can use '#&amp;lt;&lt;EM&gt;uiname&lt;/EM&gt;&amp;gt;' at the end of the resource name. We won't be bothering with this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; For example, we will be creating a new MCML markup file called 'Questions.mcml'. To navigate to this page, we find the &lt;EM&gt;actions&lt;/EM&gt; in our &lt;EM&gt;Click&lt;/EM&gt; handler we created for our TextButton, and change it to...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Changed&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Clicker.Invoked]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;PlayAnimation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ButtonPanel]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Animation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;animation://me:Clicked&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Invoke&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.StartGame]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Navigate&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;@resx://TriviaCenter/TriviaCenter.Resources/Questions&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;game&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Changed&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;The Navigate command above does two things. First, it tells Media Center to open the resource named 'Questions' that is part of our DLL file (we will add this later) and show us the very first UI it finds. The second part is that it sets the 'game' property of this new UI to our TriviaCenter object.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Using Navigate is just like creating a UI directly (eg. when we create a &lt;STRONG&gt;TextButton&lt;/STRONG&gt;). You can pass it any parameters you like. In a little while, you'll see where and how we use the &lt;STRONG&gt;game&lt;/STRONG&gt; property in our second page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; You may also&amp;nbsp;notice that I've changed the name of the 'SomeoneClickedMe' function to 'StartGame'. This makes a lot of sense, since this function tells Media Center that you are now ready to answer questions from a category.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Speaking of changes to our C#, we had better discuss them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; As I said earlier on, I expect you to have a good general idea of C#. If you don't, I suggest you stop now, learn how to write some of your more simple Windows applications in C#, then come back to this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; When writing your C# code for Media Center development, it's often easier to write it in a Windows Forms application first. This allows you to use simple, well known and predicatable user interface elements, rather than causing yourself confusion where you don't know if it's your MCML or your C# at fault for problems/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I'm not going to walk you through every stage of the C# code - I'll just explain the very basics behind what I am trying to do here. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; The first step is to load our data from a sensible location. That location will be found either in the local directory to the application, or the 'Application Data' directory. We will be using some quiz files sourced from an open source project - you can download them here - &lt;A href="http://w3.misterhouse.net:81/mh/data/trivia/"&gt;http://w3.misterhouse.net:81/mh/data/trivia/&lt;/A&gt; (and they are included in the download).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Each file will represent a single category - Entertainment, Sports etc. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Now we need to look at what data we need to exchange between our two parts of the application - this is usually best done through a diagram or other visual aid. In this case, we are going to need to following key pieces of data to appear in our interface...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;The Question&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Four Multiple Choice Answers&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; The Current Score&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; The Total Number of Questions So Far&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;So in our C# object, we need to create properties to deliver all of these things to the MCML page, so they can be reported.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; _Question;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Choice _Answers;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;byte&lt;/FONT&gt;&lt;FONT size=2&gt; correctanswer; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; Question&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;/FONT&gt;&lt;FONT size=2&gt; { &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; _Question; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;Choice&lt;/FONT&gt;&lt;FONT size=2&gt; Answers&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;/FONT&gt;&lt;FONT size=2&gt; { &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; _Answers; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;...and I'm sure you get the rest. It's all pretty straight-forward by this stage in your progress through MCML development.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; We also need a couple of different &lt;EM&gt;actions&lt;/EM&gt; that the user can perform. These are...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Starting a New Game (StartGame)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; Answering a Question (Answer)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Since&amp;nbsp;for both of these actions, our user will be pressing a button (ie. the name of the category or the answer to the question), we are going to have to get that button press from the &lt;STRONG&gt;MCML&amp;nbsp;Page&lt;/STRONG&gt; to the &lt;STRONG&gt;C# Class&lt;/STRONG&gt;. So we will need to create public functions for them...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;
&lt;P&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; StartGame()&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&amp;nbsp;...&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; Answer()&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;{&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;};&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So we have already &lt;STRONG&gt;Navigate&lt;/STRONG&gt;d&amp;nbsp;to a page - but so far, it doesn't exist! Let's create it now. This&amp;nbsp;page is&amp;nbsp;going to contain our trivia question and the answers. This will be where the bulk of our game is played, and you will find that we can re-use almost &lt;EM&gt;every part of our original page&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:249px;HEIGHT:262px;" height=262 hspace=10 src="http://thedigitallifestyle.com/cs/photos/developer/images/2800/original.aspx" width=249 align=right border=1&gt;Let's create our new page using our old one as a template. Start out by right-clicking the 'Start Page.mcml' file in the Solution Explorer and choosing 'Copy', as pictured.&lt;/P&gt;
&lt;P&gt;Then right click the 'Markup' folder and choose 'Paste' to make a new copy of our MCML page. Rename it - ideally, to 'Questions.mcml'.&lt;/P&gt;
&lt;P&gt;Now, we dive into the MCML code. There is one vital thing we need to do first. Very early on in our first UI element, we create a new 'Local' - our &lt;STRONG&gt;TriviaGame&lt;/STRONG&gt; object.&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;In this case, we don't need this to be a local variable - we have already created a TriviaGame object in our FIRST page, where you select the category. So in order to make the selection of the category move from one MCML page to the next, we will need to sent the TriviaGame object as a &lt;EM&gt;property&lt;/EM&gt;, just like when we pass an object between two MCML elements that are in the one file.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;So simply change the 'Local' tags to 'Properties' tags, and we are ready to continue.&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Properties&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;a:TriviaGame&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;game&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Properties&lt;FONT color=#0000ff&gt;&amp;gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;You'll remember at the start that we set the 'game' property in our Navigate call. This is where we define that game property. Using this technique of passing our object as a property from page to page, we ensure that there is only ever a single&amp;nbsp;TriviaCenter object - it is simply shared amongst all of the&amp;nbsp;MCML pages.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Our BackgroundText object is still important - but&amp;nbsp;lets do something a little more impressive and&amp;nbsp;change it to the name of the category we chose. Because we passed our TriviaGame object from our original page, the&amp;nbsp;category&amp;nbsp;selected in the &lt;STRONG&gt;choice&lt;/STRONG&gt; object will still be selected, so we can use this to get the name of the&amp;nbsp;selected category.&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;con:BackgroundText&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Label&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;[game.Categories.Chosen!cor:String]&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FormLayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Right&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.95&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Top&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.05&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;con:BackgroundText&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Our trivia database only ever has questions with four multiple choice answers. We don't really need to worry about needing a Scroller object anymore - with four, we aren't going to fall off the page anymore. So we can get rid of all of that scroller-related code we have, and change it to a simple Panel.&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#000000&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VerticalFlow&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FormLayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Left&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Top&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.45&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Horizontal&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Children&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Repeater&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[&lt;STRONG&gt;game.Answers.Options&lt;/STRONG&gt;]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VerticalFlow&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FlowLayout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Orientation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Vertical&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ItemAlignment&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;me:TextButton&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Label&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[RepeatedItem!cor:String]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Indx&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[RepeatedItemIndex]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;game&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Repeater&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Children&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; And if you notice the bold text above, you'll also see where I've made another change. Rather than wanting to see the list of &lt;EM&gt;categories, &lt;/EM&gt;I now want this repeater to have a list of the &lt;EM&gt;answers&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; And since our &lt;STRONG&gt;TextButton &lt;/STRONG&gt;class already takes care of focus and choices, our work is almost done! All we need to do is change the &lt;EM&gt;actions&lt;/EM&gt; that the button performs when we click...since we aren't choosing a category this time, starting a new game seems a little silly.&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#000000&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Changed&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Clicker.Invoked]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;PlayAnimation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ButtonPanel]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Animation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;animation://me:Clicked&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Invoke&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[&lt;STRONG&gt;game.Answer&lt;/STRONG&gt;]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Changed&lt;FONT color=#000000&gt;&amp;gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#000000&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;The Answer function (which we discussed earlier) is one we defined in our C# object to tell us that the user has chosen an answer. It will check to see if it correct, update the score and then load the next question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Remember, since our buttons change the &lt;STRONG&gt;ChosenIndex &lt;/STRONG&gt;properties of the Choice objects they are based on, your C# class already knows which of the categories or answers you have selected. That's why we don't need to pass any parameters to our &lt;STRONG&gt;Answer&lt;/STRONG&gt; or &lt;STRONG&gt;StartGame&lt;/STRONG&gt; functions...because we already have all of the information we need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Finally, there's our friend the position indicator. Well, since we no longer have a scroller we certainly don't need this anymore...but there's one thing it COULD be useful for. How about for showing our current score?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So let's dive into the PositionIndicator. First, I'm going to rename it to a &lt;EM&gt;ScoreIndicator, &lt;/EM&gt;just so I know what I'm doing (don't forget to change the code where you actually create the indicator in the first UI!)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; There's only two things we need to do. Since we aren't using a &lt;EM&gt;choice&lt;/EM&gt; object anymore to get the information for our indicator, we need to change the property that we pass it from the main UI. We want to instead show the total number of questions asked, and the total number of questions that were right. Both of these are stored in our &lt;STRONG&gt;TriviaGame&lt;/STRONG&gt; object...so that is the property we need to pass to our new ScoreIndicator.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Properties&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;a:TriviaGame&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;game&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Properties&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;And we also need to change our Bindings. The 'game' object doesn't have Count or ChosenIndex properties, nor will&amp;nbsp; we need the MathTransformer to add one to a property - this is a very simple object now, with two bindings...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Binding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Position.Content]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.CorrectQuestions!cor:String]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Binding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Value.Content]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.TotalQuestions!cor:String]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The last thing we need to do is make our 'Questions.mcml' page &lt;EM&gt;part of our assembly &lt;/EM&gt;(or DLL file). To do this, double-click on the &lt;STRONG&gt;Resources.resx&lt;/STRONG&gt; file.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:163px;HEIGHT:182px;" height=182 hspace=10 src="http://thedigitallifestyle.com/cs/photos/developer/images/2802/original.aspx" width=163 align=left border=1&gt;At the top of the window that appears, there will be drop down&amp;nbsp;menu that will probably default to 'Images'. If you left click it, you'll get a list of choices like the ones here. Choose 'Files'. This allows you to embed files into your DLL by making them part of your resource.&lt;/P&gt;
&lt;P&gt;Simply left-click the 'Questions.mcml' file from the Solution Explorer and drag it into the list of Files. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;There!&lt;/EM&gt;. It's now part of your resource file, which will make sure that your C# code and your MCML interfaces can never be accidentally seperated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:353px;HEIGHT:142px;" height=142 hspace=10 src="http://thedigitallifestyle.com/cs/photos/developer/images/2803/original.aspx" width=353 align=right border=1&gt;&amp;nbsp;&amp;nbsp; And apart from putting in C# code to load the questions and fill the properties, we are &lt;EM&gt;done&lt;/EM&gt;. That's &lt;STRONG&gt;IT&lt;/STRONG&gt;. So after all that pain with the scroller, it's only a few fairly simple changes, a few&amp;nbsp;extra properties and&amp;nbsp;a little bit of behind-the-scenes&amp;nbsp;C# code to go from a simple list of categories to a working trivia game.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#000000&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#000000&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Of course, there's HEAPS of work to do making this pretty...but now you can have a game of your own running in your Media Center...or can you? You've got it working fine in MCMLPad...but how do we get it into Media Center?&lt;/P&gt;
&lt;P&gt;Tune in next time for the answer!&lt;/P&gt;
&lt;P&gt;Code is &lt;A class="" title=Here href="http://www.push-a-button.com.au/downloads/triviacenter/stage9.zip" target=_blank&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If you can't get it to run or your list of categories keeps coming up empty, create a folder called&amp;nbsp;&lt;STRONG&gt;%APPDATA%/Steven Harding/TriviaCenter&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You will need to copy the files ending in &lt;STRONG&gt;.DAT&lt;/STRONG&gt; (the question and answer files) from the &lt;STRONG&gt;/bin/debug &lt;/STRONG&gt;directory of TriviaCenter and copy them into the &lt;STRONG&gt;%APPDATA%/Steven Harding/TriviaCenter &lt;/STRONG&gt;folder. This is where it looks for the trivia questions.&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2795" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dBmX1JHpFE8og55V2FMuWT9wXFA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dBmX1JHpFE8og55V2FMuWT9wXFA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dBmX1JHpFE8og55V2FMuWT9wXFA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dBmX1JHpFE8og55V2FMuWT9wXFA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/NByYf1BFlgU" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Media+Center/default.aspx">Media Center</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/05/20/stage-9-navigating-to-a-new-page.aspx</feedburner:origLink></item><item><title>Stage 8: Showing the Current List Position and the Art of Binding</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/RVKmzL06tUI/stage-8-showing-the-current-list-position-and-the-art-of-binding.aspx</link><pubDate>Tue, 08 May 2007 06:52:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2732</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2732</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/05/08/stage-8-showing-the-current-list-position-and-the-art-of-binding.aspx#comments</comments><description>&lt;P&gt;Now we go back to our scroller.&lt;/P&gt;
&lt;P&gt;We've made our list scroll, show the current selection, work with the keyboard and mouse...but it's still easy to get lost in our list of options.&lt;/P&gt;
&lt;P&gt;Unless it's clear that there are more options above or below those showing on the current screen, your users can easily be confused. This is why most Media Center windows with lists of options give you a position in the bottom right hand corner.&lt;/P&gt;
&lt;P&gt;So let's make one of our own.&lt;/P&gt;
&lt;P&gt;First, we are going to need a new Panel to host our controls. Let's create this in the very first UI in our project. We will call it 'PositionIndicator'.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;PositionIndicator&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;IMG style="WIDTH:89px;HEIGHT:42px;" height=42 hspace=10 src="http://thedigitallifestyle.com/cs/photos/developer/images/2730/original.aspx" width=89 align=right border=1&gt;Look at the picture. You will see there are three distinct parts of this object. There is the &lt;EM&gt;current&lt;/EM&gt; position, a slash, and the &lt;EM&gt;total&lt;/EM&gt; number of options.&lt;/P&gt;
&lt;P&gt;They are all right next to each-other, in left-to-right order. So this tells us our layout method - we simply need to use 'HorizontalFlow', to space our objects out horizontally.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;PositionIndicator&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;HorizontalFlow&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;Now we create three text objects, one for each of the elements we identified earlier (&lt;EM&gt;position, slash and total)&lt;/EM&gt;.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Children&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Text&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Position&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Color&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;White&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Text&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; / &lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Color&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Aqua&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Text&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Value&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Color&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Aqua&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Children&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;We don't need to bother assigning a name to the &lt;EM&gt;slash&lt;/EM&gt; text control, since it's value will never change. Of course, our Font and other settings aren't really right yet (and you'll probably want to make them slightly transparent) but these are minor details you can clean up later.&lt;/P&gt;
&lt;P&gt;Now we need to get their position right. Since the main UI of our program is based on a FormLayout, we use the FormLayoutInput again. We want to place this object in the bottom right corner of our screen, so something like this should do the trick...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;FONT color=#0000ff size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;PositionIndicator&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;HorizontalFlow&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Alpha&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0.75&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FormLayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Right&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.95&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Top&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.9&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH:94px;HEIGHT:58px;" height=58 hspace=10 src="http://thedigitallifestyle.com/cs/photos/developer/images/2731/original.aspx" width=94 align=right border=1&gt;Very nice. Now it's visually quite reasonable. But as yet, it doesn't DO anything.&lt;/P&gt;
&lt;P&gt;Let's now get it working. What we need to do is use our &lt;EM&gt;Choice&lt;/EM&gt; object to get the values for this UI element.&lt;/P&gt;
&lt;P&gt;We have already seen some of the basics of getting values from our C# object, so it should be fairly straight forward. Rather than setting our &lt;EM&gt;current&lt;/EM&gt; and &lt;EM&gt;total&lt;/EM&gt; text elements to '1', we get them from &lt;STRONG&gt;[TriviaGame.Categories.Options.Count]&lt;/STRONG&gt; and &lt;STRONG&gt;[TriviaGame.Categories.ChosenIndex]&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;But if we simply use those values, we get &lt;EM&gt;errors!&lt;/EM&gt; Why would that be?&lt;/P&gt;
&lt;P&gt;Well, it turns out that MCML (like C#) is very type-sensitive. This means that it will raise errors when you try to convert one type of data (like an Integer, like the property &lt;STRONG&gt;TriviaGame.Categories.ChosenIndex&lt;/STRONG&gt;) to another type (say a String, like the &lt;STRONG&gt;Content&lt;/STRONG&gt; property of a text object).&lt;/P&gt;
&lt;P&gt;You need to tell MCML that it is OK to convert your data from an Integer to a String. You can tell MCML to typecast an object like this by using the '!' character, followed by the name of the class you want to convert to.&lt;/P&gt;
&lt;P&gt;Now if you refer back to one of the earlier posts on the MCML tag, you may remember that we used a like like this... &lt;FONT color=#ff0000 size=2&gt;&lt;/P&gt;
&lt;P&gt;xmlns:cor&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;assembly://MsCorLib/System&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;This line imported all of the standard core types, like Int and String. So to change our Integer properties (like the two properties we are getting from our Choice object) and convert them to a String which we need to set the Content of a Text object, they will need to look like this...&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Text&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Position&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;[game.Categories.ChosenIndex!cor:String]&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Color&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;White&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Text&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; / &lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Color&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Aqua&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Text&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Value&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;[game.Categories.Options.Count!cor:String]&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Color&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Aqua&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Excellent! We have now loaded our data from our C# object into our MCML UI.&lt;/P&gt;
&lt;P&gt;But there's another problem. You'll find that when we run our program, everything looks great. Our position is given as zero, and the total&amp;nbsp;number of choices is correct. This is working out fine...until we try to change the selection. &lt;EM&gt;Nothing happens!&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Now we come back to our &lt;STRONG&gt;ModelItem&lt;/STRONG&gt; object. Do you remember how ModelItem works - that when the data changes, all of the rules associated with a particular property are run again? The problem is that the values we are using in the &lt;STRONG&gt;Content&lt;/STRONG&gt; of our text objects are &lt;EM&gt;only ever checked when we first show the text objects&lt;/EM&gt;. Once they are created and set the first time - that's it.&lt;/P&gt;
&lt;P&gt;So how do we make our text objects update whenever the ChosenIndex changes? Well, as you may have guessed, we need a &lt;EM&gt;rule&lt;/EM&gt;. Then MCML will run the rule, which will update our value.&lt;/P&gt;
&lt;P&gt;And it so happens that there is a special rule just for this. It's called a &lt;STRONG&gt;binding&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;In our &lt;EM&gt;rules&lt;/EM&gt; section, we link the &lt;STRONG&gt;Content&lt;/STRONG&gt;&amp;nbsp;of our text object (called 'Position') to the &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt; of the &lt;EM&gt;Categories &lt;/EM&gt;Choice object (remembering we need to convert it to a String, of course)&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Binding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Position.Content]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.Categories.ChosenIndex!cor:String]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;So now whenever the value of our Source changes, the Target is updated.&lt;/P&gt;
&lt;P&gt;Now, when we change our selection the current position always changes! We are almost done now.&lt;/P&gt;
&lt;P&gt;There's one final thing to be done. You'll find that there's one annoyance. The &lt;EM&gt;ChosenIndex&lt;/EM&gt; of a Choice object is &lt;EM&gt;zero-based&lt;/EM&gt;. That means that the 1st choice has a number of 0. Our users really will like to see this as a &lt;EM&gt;one-based&lt;/EM&gt; value. How on earth do we add '1' to our value, without having to write a new property and new code?&lt;/P&gt;
&lt;P&gt;We use a &lt;STRONG&gt;Transformer&lt;/STRONG&gt;. And no, I'm not referring to the cartoon or the upcoming movie. Transformers are used to change (or &lt;EM&gt;transform) &lt;/EM&gt;a value. &lt;/P&gt;
&lt;P&gt;First, we split the &lt;STRONG&gt;binding&lt;/STRONG&gt; so it has both a start and an end tag. We then create 'Transformer' tags to hold our transformation.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Binding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Position.Content]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.Categories.ChosenIndex!cor:String]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Transformer&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Transformer&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Binding&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;And finally, we choose the transformation we want to actually perform. There are many options. Some are specifically for timespans and dates, some are for formatting strings, others to create true/false comparisons...but we want to perform a mathematical operation. For that, we need a &lt;STRONG&gt;MathTransformer&lt;/STRONG&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;MathTransformer&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Add&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;So to translate, every time your &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt; changes, the rules that use it are checked and run. The &lt;STRONG&gt;binding&lt;/STRONG&gt; will run, which takes the &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt;, runs it through the &lt;EM&gt;transformer&lt;/EM&gt; and adds '1', then sets the &lt;STRONG&gt;Content&lt;/STRONG&gt; property of your &lt;STRONG&gt;Text&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;We now have a working position indicator for our scroller!&lt;/P&gt;
&lt;P&gt;The final touch? Let's take our object (including it's rule) and create our own UI for this position indicator. The UI will only need one property - the &lt;STRONG&gt;Choice&lt;/STRONG&gt; object it needs to use to get it's data from.&lt;/P&gt;
&lt;P&gt;By putting it in it's own UI, we have created a re-usable object that will come in handy for future projects.&lt;/P&gt;
&lt;P&gt;And just in case, let's add another &lt;STRONG&gt;binding&lt;/STRONG&gt; to make sure that the &lt;EM&gt;total&lt;/EM&gt; number of options in the Choice object is also updated. You never know - you may write an application that adds to the list dynamically.&lt;/P&gt;
&lt;P&gt;Need some code? Try &lt;A class="" title=Here href="http://www.push-a-button.com.au/downloads/triviacenter/stage8.zip"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2732" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/phOdAMuAUnBFaG1pwVY3RP79YOI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/phOdAMuAUnBFaG1pwVY3RP79YOI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/phOdAMuAUnBFaG1pwVY3RP79YOI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/phOdAMuAUnBFaG1pwVY3RP79YOI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/RVKmzL06tUI" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/05/08/stage-8-showing-the-current-list-position-and-the-art-of-binding.aspx</feedburner:origLink></item><item><title>Stage 7: Showing the Current Selection, and a ModelItem introduction.</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/w1SXMhCHhss/stage-7-data-binding-finishing-touches-to-our-scroller.aspx</link><pubDate>Mon, 30 Apr 2007 07:38:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2698</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2698</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/04/30/stage-7-data-binding-finishing-touches-to-our-scroller.aspx#comments</comments><description>&lt;P&gt;There's still a few tricks we can do to make our Scroller work and look better - and one of them is going to also show us the art of &lt;STRONG&gt;binding&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;This topic is going to be a little hairy. Stick with me, because it will teach you some very important concepts.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;First, let's look at our program. If you are only using the keyboard, it works fine. But should you be using a mouse, you may find that when you move your mouse outside our list of category options, &lt;EM&gt;all&lt;/EM&gt; of our options go back to being faded - even the one we had selected. Personally, I'd like to show our user which item is the current one.&lt;/P&gt;
&lt;P&gt;To do this, we are going to use some more of the features of our Choice object. &lt;/P&gt;
&lt;P&gt;One of the most important members of Choice is &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt;. This gives us the index number of the currently selected item. For example, the first item in the list of &lt;STRONG&gt;Option&lt;/STRONG&gt;s will be '0', the second will be '1' etc, just like in C# arrays. Not only can we &lt;EM&gt;get&lt;/EM&gt; the currently selected item, we can also &lt;EM&gt;set&lt;/EM&gt; the selected item.&lt;/P&gt;
&lt;P&gt;So how do we set the currently selected option? Well, in this case we should set it whenever we highlight a new option. We have already done something very much like this - when we put our mouse over an option, it grows larger. Well, what we need to do now is as well as using &lt;STRONG&gt;set&lt;/STRONG&gt; to set the &lt;EM&gt;size &lt;/EM&gt;and&amp;nbsp;the &lt;EM&gt;alpha&lt;/EM&gt; of the object, we should also use &lt;STRONG&gt;set&lt;/STRONG&gt; to change the &lt;EM&gt;ChosenIndex&lt;/EM&gt; of our Choice object.&lt;/P&gt;
&lt;P&gt;But to do that, we need one more piece of information. In our buttons, we only have&amp;nbsp;properties for our TriviaGame object, and the label of the button. How do we know &lt;EM&gt;which&lt;/EM&gt; of our options is index #1? And which is #2?&lt;/P&gt;
&lt;P&gt;It turns out that it's not too difficult to do.&lt;/P&gt;
&lt;P&gt;If you take a look at our &lt;STRONG&gt;Repeater&lt;/STRONG&gt; object, you'll find that we used the special value &lt;STRONG&gt;RepeatedItem. &lt;/STRONG&gt;In a repeater, &lt;STRONG&gt;RepeatedItem&lt;/STRONG&gt; is the value of the item being repeated (in this case, the names of our various categories). It just so happens that there is another special value - &lt;STRONG&gt;RepeatedItemIndex&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;This is - as you could probably guess from the name - the index of our repeated item. We can use this value and&amp;nbsp;give it to our TextButton as a property, so that our button knows not only the label of the category, but also knows it's index number.&lt;/P&gt;
&lt;P&gt;First, we go to our TextButton and make a Property that we can use to store this index value.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Index&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Indx&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Index&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;$Required&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;So we now have a property called 'Index' in our TextButtons. Now all we need to do is go into our Repeater and make sure we &lt;EM&gt;set&lt;/EM&gt; this property in all of the TextButtons we create....&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Repeater&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.Categories.Options]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VerticalFlow&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FlowLayout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Orientation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Vertical&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ItemAlignment&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Layout&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;me:TextButton&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Label&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[RepeatedItem!cor:String]&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT color=#ff0000 size=2&gt;Indx&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[RepeatedItemIndex]&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;game&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game]&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Content&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#000000 size=2&gt;
&lt;P&gt;OK - so now we have a selection of TextButtons - one for each category. They contain both the name of the category (in the Label property) and the index of the property (in the Indx property). They also have a &lt;STRONG&gt;game&lt;/STRONG&gt; object that leads them back to the TriviaGame so they can interact with our code.&lt;/P&gt;
&lt;P&gt;These three properties are all we need to change the selection. We already have a Rule in our TextButton&amp;nbsp;covering when the mouse is over our object...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Input.KeyFocus]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;SourceValue&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ButtonPanel.Scale]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1.1,1.1,1.1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ButtonPanel.Alpha]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;This sets the object to 100% opacity (when alpha is 1, the object is visible), and scales the object up by 10% (1.1x it's original size).&lt;/P&gt;
&lt;P&gt;All we do now is add another Set tag. This time, what we want to do is set the &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt; of our &lt;STRONG&gt;Choice&lt;/STRONG&gt; object. Since we loaded all of our options from the '&lt;STRONG&gt;categories&lt;/STRONG&gt;' object in our &lt;STRONG&gt;game&lt;/STRONG&gt; class, all we need to do is add the following line...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.Categories.ChosenIndex]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Indx.Value]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wow - if that gets a little unclear, tell me. It's oddly difficult to describe in text, but it's pretty simple in practise. If you had trouble follwing, just see the example you can download at the bottom of this post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"Why use the &lt;U&gt;index&lt;/U&gt; like this? Why not just use the &lt;U&gt;label&lt;/U&gt;?"&lt;/EM&gt; &lt;/P&gt;
&lt;P&gt;I've&amp;nbsp;seen a couple of newer&amp;nbsp;developers using the '&lt;STRONG&gt;Chosen&lt;/STRONG&gt;' property instead of the '&lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt;' property when setting the current selection. It's much easier - the &lt;STRONG&gt;Chosen&lt;/STRONG&gt;&amp;nbsp;property contains&amp;nbsp;the actual&amp;nbsp;&lt;EM&gt;value&lt;/EM&gt; of the currently selected item. So for example. if we select the&amp;nbsp; 3rd category in our list, it's &lt;STRONG&gt;ChosenIndex&amp;nbsp;&lt;/STRONG&gt;may be&amp;nbsp;be '2', while it's &lt;STRONG&gt;Chosen&lt;/STRONG&gt; value&amp;nbsp;may be '&lt;EM&gt;Entertainment&lt;/EM&gt;'.&lt;/P&gt;
&lt;P&gt;The simple answer? Index is safer - because if you happen to have &lt;EM&gt;two or more&amp;nbsp;&lt;/EM&gt;categories with the same name, you'll be lost without the &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OK - the first part is out of the way.&lt;/P&gt;
&lt;P&gt;What we want to do now is change our TextButton so that the &lt;EM&gt;selected&lt;/EM&gt;&amp;nbsp;button looks different to the other options in the list. Now, since we have already explored rules, and you've seen how we &lt;EM&gt;set&lt;/EM&gt; the ChosenIndex property, you should have a good idea of how we can &lt;EM&gt;get&lt;/EM&gt; the property and use it to 'fire' a rule.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; =&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.Categories.ChosenIndex]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;SourceValue&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Indx.Value]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;There - that condition looks good.&amp;nbsp;This rule should be followed whenever the&amp;nbsp;&lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt; property of our &lt;STRONG&gt;Categories&lt;/STRONG&gt; object matches the &lt;STRONG&gt;Value&lt;/STRONG&gt; of our &lt;STRONG&gt;Index&lt;/STRONG&gt; property.&amp;nbsp;Quite simply, if this TextButton is for choice #2, then this rule will be fired when the &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt; is 2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We still need actions for our rule.&amp;nbsp;How are we going to differentiate our chosen item from all of the otheres?&lt;/P&gt;
&lt;P&gt;How about we change our MCML file a little bit? Currently (as you can see in the code I pasted in a little earlier) when any of our TextButton objects has the focus of the mouse or remote, it becomes brighter and bigger. Let's change this. We will make it so that when it has &lt;STRONG&gt;focus&lt;/STRONG&gt;, it's bigger. When it's &lt;STRONG&gt;selected&lt;/STRONG&gt;, it will be brighter.&lt;/P&gt;
&lt;P&gt;So - remove all of the lines that look like this... &lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ButtonPanel.Alpha]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0.75&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;from any of the rules that mention &lt;STRONG&gt;KeyFocus&lt;/STRONG&gt; and let's instead make them be the actions of our new rules - the ones that use the ChosenIndex.&lt;/P&gt;
&lt;P&gt;We end up with two rules...&lt;/P&gt;
&lt;P&gt;&amp;lt;!-- Highlight when you are selected --&amp;gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; =&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.Categories.ChosenIndex]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;SourceValue&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Indx.Value]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ButtonPanel.Alpha]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;1&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#000000&gt;&amp;lt;!--&amp;nbsp;Fade out again when you are not&amp;nbsp;--&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Source&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[game.Categories.ChosenIndex]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;SourceValue&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[Indx.Value]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ConditionOp&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;NotEquals&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ButtonPanel.Alpha]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0.75&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Actions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;If you've been following so far, these should be clear. When the ChosenIndex and TextButton index properties match, make the button 100% visible. When they do not match, fade out to 75%.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's only one problem. When you run this code...it doesn't work.&lt;/P&gt;
&lt;P&gt;Ahhh! Why not? Everything makes sense, doesn't it ( well, as much as it can with me describing it to you :P )&lt;/P&gt;
&lt;P&gt;Don't worry - I haven't led you down the wrong path. There's just something I need to explain about the way Media Center works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ModelItem&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You know how MCML applications are broken into two seperate pieces - the Model and the View? Well, there's a trick to connecting the two of parts to make them whole.&lt;/P&gt;
&lt;P&gt;You've got your C# (or VB.NET) classes, which MCML gets information from. We create rules and&amp;nbsp;set properties, intracting with our code. But there's a performance problem to think about.&lt;/P&gt;
&lt;P&gt;It's like working at a desk with a hyperactive manager. If you have someone breathing over your shoulder all day asking for status reports, you'll never actually get any &lt;EM&gt;work&lt;/EM&gt; done, since your too busy answering the same questions, over and over again. The same may happen to your C# code if you were forced to constantly respond to Media Center begging you for information. Remember, the Media Center interface&amp;nbsp;should be running at more than 30 frames per second...do you honestly want Media Center to be asking for each and every property that fast?&lt;/P&gt;
&lt;P&gt;So in MCML we have a trick around this - and it uses a class called &lt;STRONG&gt;ModelItem.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Basically, every time you create a C#/.NET class that you plan on using within MCML, you should &lt;EM&gt;always&lt;/EM&gt; base it on the &lt;STRONG&gt;ModelItem&lt;/STRONG&gt; class. This is because the most important responsibility of ModelItem is &lt;EM&gt;telling Media Center that a property value has changed&lt;/EM&gt;. &lt;/P&gt;
&lt;P&gt;There's a wonderful function that is part of ModelItem called '&lt;STRONG&gt;FirePropertyChanged'&lt;/STRONG&gt;. I'll show you how to use it yourself in a later post, but for right now I'll just tell you that &lt;EM&gt;this&lt;/EM&gt; function is the key to the whole system. Basically, the &lt;STRONG&gt;Choice&lt;/STRONG&gt; class we are using to hold our category names is already based on &lt;STRONG&gt;ModelItem&lt;/STRONG&gt;. When you change your &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt; property, it calls the '&lt;STRONG&gt;FirePropertyChanged&lt;/STRONG&gt;' function to try and tell Media Center that a change has happened.&lt;/P&gt;
&lt;P&gt;This means that all of the rules that pay any attention to &lt;STRONG&gt;ChosenIndex&lt;/STRONG&gt; will be re-checked.&lt;/P&gt;
&lt;P&gt;Our problem? The &lt;STRONG&gt;FirePropertyChanged&lt;/STRONG&gt; event can only flow back down to Media Center if &lt;EM&gt;every object in the chain is based on ModelItem&lt;/EM&gt;. &lt;/P&gt;
&lt;P&gt;So in this instance, our &lt;STRONG&gt;Choice&lt;/STRONG&gt;&amp;nbsp;object calls '&lt;STRONG&gt;FirePropertyChanged'. &lt;/STRONG&gt;But when it asks our '&lt;STRONG&gt;TriviaGame&lt;/STRONG&gt;' class to pass on the message to Media Center...nothing happens, because 'TriviaGame' isn't based on ModelItem.&lt;/P&gt;
&lt;P&gt;OK - a very long winded and explaination. In the end though, it's a very, very simple fix. We change this line (where we declare our class) from this...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;TriviaGame&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;To this...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;TriviaGame&lt;/FONT&gt;&lt;FONT size=2&gt; : &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ModelItem&lt;FONT color=#000000 size=2&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes. A lot of explaination for a very minor change, but understanding ModelItem now will really help in the future.&lt;/P&gt;
&lt;P&gt;And now we have success! Because we are a ModelItem now, Media Center is being told that our 'ChosenIndex' has changed. This means that every ChosenIndex rule&amp;nbsp;- like the ones that check to see how bright our TextButtons should be - is being re-evaluated when we set the ChosenIndex property.&lt;/P&gt;
&lt;P&gt;The next post will be simpler and cover how to create a control to show the user how far they are through the list.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title=Here href="http://www.push-a-button.com.au/downloads/triviacenter/stage7.zip" target=_blank&gt;Here&lt;/A&gt; is the code for this post.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2698" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ofGNS8E0GwiXE78tsLa8Mcf2WPk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ofGNS8E0GwiXE78tsLa8Mcf2WPk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ofGNS8E0GwiXE78tsLa8Mcf2WPk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ofGNS8E0GwiXE78tsLa8Mcf2WPk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/w1SXMhCHhss" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/04/30/stage-7-data-binding-finishing-touches-to-our-scroller.aspx</feedburner:origLink></item><item><title>Stage 6: Cleaning Up &amp; Scrolling our Choices</title><link>http://feedproxy.google.com/~r/TheDigitalLifestyleDeveloperBlog/~3/mXRp2HkvuoA/stage-6-cleaning-up-scrolling-our-choices.aspx</link><pubDate>Sun, 22 Apr 2007 13:33:00 GMT</pubDate><guid isPermaLink="false">39ccff37-4505-4887-ad36-80fcd951300e:2664</guid><dc:creator>IgnoranceIsBliss</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://thedigitallifestyle.com/cs/blogs/developer/rsscomments.aspx?PostID=2664</wfw:commentRss><comments>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/04/23/stage-6-cleaning-up-scrolling-our-choices.aspx#comments</comments><description>&lt;P&gt;We are making real progress now in doing things with our interface. But there are a couple of 'housework' items we need to do before we can say we are ready to move on to the next part of our program.&lt;/P&gt;
&lt;P&gt;The next question we need to ask ourselves is simple - 'what happens when there are a lot of categories to choose from'?&lt;/P&gt;
&lt;P&gt;When you are developing an application and you create something open-ended, like the category list, you always need to check how your system will behave if you have a large number of entries. And if we start adding a whole lot of category names we find that very quickly the screen gets filled with junk - and we begin to loose entries at the top and bottom of the screen.&lt;/P&gt;
&lt;P&gt;So - we need to clean up a little.&lt;IMG style="WIDTH:250px;HEIGHT:187px;" height=187 src="http://thedigitallifestyle.com/cs/photos/developer/images/2663/original.aspx" width=250 align=right border=1&gt;&lt;/P&gt;
&lt;P&gt;First, as you'll see from the image to the side, we have a couple of problems to deal with in terms of the positioning, sizing and alignment of our option text.&lt;/P&gt;
&lt;P&gt;What we need to do is...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;a) START the list items from a fixed point in the screen (vertically), so they do not flow around the center like that.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;b) Limit the physical height of the list, to ensure that the list doesn't grow quite so large.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;c) Allow the user to scroll through the list.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;So we have our work cut out for us this time...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;A) Changing the Position of the List&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;We currently don't bother setting any position details for the Panel that contains our list of options. This means that it is automatically centered on the screen. While this looked great in a small list, in a large list it's rubbish.&lt;/P&gt;
&lt;P&gt;So let's continue using what has worked for us so far - the FlowLayout. Below, I've got the revised code for the Panel that contains our &lt;STRONG&gt;repeater&lt;/STRONG&gt; object (which displays our various category options)...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Panel&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FormLayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Left&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,0&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Top&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.25&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Horizontal&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Children&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;So in the above code, we have added our new &lt;STRONG&gt;LayoutInput&lt;/STRONG&gt; tags to tell the &lt;STRONG&gt;FormLayout&lt;/STRONG&gt; exactly where we want to start our list. In this case, we are putting the &lt;EM&gt;left&lt;/EM&gt; hand side at '0' on the screen, and the &lt;EM&gt;top&lt;/EM&gt; of the control and 25% of the way &lt;EM&gt;down&lt;/EM&gt; the screen (remember, the Parent in this case is the screen itself).&lt;/P&gt;
&lt;P&gt;Because we have used the 'Center' option for the horizontal alignment, the control will be cenetered within the parent - so it will be in the dead center of the screen horizontally.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;B) Reducing the Size of the List&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;This is actually quite easy. But first, we need to change something.&lt;/P&gt;
&lt;P&gt;You've seen our &lt;STRONG&gt;Panel&lt;/STRONG&gt; control that we just moved. Well, it's time to give up on using Panel for this particular control, because we are going to start using it to deliberately clip off the bottom of our list in order to fit everything on the screen. And since we are &lt;EM&gt;clipping&lt;/EM&gt; our list, what we need to do is use a &lt;STRONG&gt;Clip&lt;/STRONG&gt; object instead of a &lt;STRONG&gt;Panel&lt;/STRONG&gt; one.&lt;/P&gt;
&lt;P&gt;Luckily, they are exactly the same in most parameters, so simply replace 'Panel' with 'Clip', (and the end tags, of course) and we are done creating our clip area.&lt;/P&gt;
&lt;P&gt;Now we need to give parameters to our clip. And the most important is &lt;EM&gt;MaximumHeight&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;But first, a digression....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Media Center is an unusual beast in that it&amp;nbsp;will most often use&amp;nbsp;&lt;EM&gt;percentages&lt;/EM&gt;&amp;nbsp;when positioning objects, but when sizing them it almost always uses &lt;EM&gt;pixels. &lt;/EM&gt;This can get very confusing, because the whole point behind positioning things by percentage is the fact that it's great for adapting to different screen sizes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So how can we use pixels? Since a pixel is a single point on the screen, doesn't that mean that something may look really tiny on a full-high-definition TV and absolutely massive on a old fashioned SD TV?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Actually, no. Because Media Center 'cheats' with it's pixels. It actually &lt;EM&gt;assumes you are building an interface based on 1024x768&lt;/EM&gt;,&amp;nbsp;a very standard 4:3&amp;nbsp;resolution. Well, to be completely honest, it assumes the screen is 768 pixels &lt;EM&gt;tall&lt;/EM&gt;. The WIDTH may vary depending on the aspect ratio of your TV (some may be 1300+ across, but still only 768 down).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So it means we can happily use a pixel size for our &lt;STRONG&gt;Clip&lt;/STRONG&gt; object and still be confident that it will work on various displays.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Back to it. All we need to do for our Clip object is to set it's MaximumSize. In this case, we don't care how WIDE it will be but we do care how TALL it will be. You specify a size with two numbers - written '&lt;EM&gt;&amp;lt;width&amp;gt;&lt;/EM&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;EM&gt;&amp;lt;height&amp;gt;'. &lt;/EM&gt;If the width or height is '0', it means "I Don't Care".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; So to say "I wan't my list to be no more than 450 pixels high", we try a line like this...&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Clip&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;MaximumSize&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0,450&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#000000 size=2&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; You can also FORCE the object to always be 450 pixels high (regardless of the size of the content within it) by setting it's &lt;EM&gt;minimumsize&lt;/EM&gt; to exactly the same amount.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;To make things prettier,&amp;nbsp;the Clip object also has the option of allowing us to gently 'fade' the objects that are being clipped. This not only looks good, but allows you to look more like a proper Media Center application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; To do this, you need to tell the &lt;STRONG&gt;Clip&lt;/STRONG&gt; object which way you are going to be fading - horzontally (across the screen) or vertically (up/down the screen). In this case, because our list grows vertically, we also need to use a vertical &lt;EM&gt;orientation&lt;/EM&gt; on our Clip object.&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Clip&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;MaximumSize&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0,450&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;MinimumSize&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0,450&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Orientation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Vertical&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;And now, the part we have all been waiting for...Scrolling&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;&lt;EM&gt;C) Scrolling the List&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;OK - this section will be a little odd, because Scroll objects take a bit of explaining. Firstly, these aren't as simply as just adding a 'Scroll' element to your MCML.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;A proper scroll area is built from three seperate parts. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;A 'Scroller' Object&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; A 'ScrollingHandler' Local Variable&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; and a 'ScrollingData' Local Variable&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;The &lt;STRONG&gt;Scroller&lt;/STRONG&gt; object works just like a normal Panel or Clip - it contains the items you are going to be scrolling through (in this case, your repeater object).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;In your &lt;STRONG&gt;&amp;lt;Locals&amp;gt;&lt;/STRONG&gt; section, you will also want to create the other two variables you will need...&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#000000 size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Locals&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ...&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;ScrollingData&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ScrollData&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;ScrollingHandler&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ScrollHandler&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;The &lt;STRONG&gt;ScrollingHandler&lt;/STRONG&gt; class is just like the &lt;STRONG&gt;ClickHandler&lt;/STRONG&gt; class we used earlier to check to see if the mouse had been clicked. It gives your Scroller control the ability to detect scroll events, like page down buttons, arrow buttons, mouse selects etc. It detects when the focus has changed and if nessicary, scrolls your content to suit.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;The &lt;STRONG&gt;ScrollingData&lt;/STRONG&gt; variable contains all of the information about the current scroll position of the scroll object. The main reason for this object to be kept seperate is so you can have two or more controls that all scroll &lt;EM&gt;together&lt;/EM&gt;. By sharing a &lt;EM&gt;ScrollingData&lt;/EM&gt; member, they can (but this is quite advanced - let's keep this for much later).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;So now, let's create our Scroller object. OK - I know I just taught you about &lt;STRONG&gt;Clip&lt;/STRONG&gt;, but now I'm going to be annoying and we are going to turn our Clip into a Scroller. Why did I take you through that step earlier? Because now you know about the Clip object and can use it in the future!&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;FONT color=#a31515&gt;&lt;STRONG&gt;Scroller&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;MaximumSize&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0,450&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;MinimumSize&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0,450&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Orientation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Vertical&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;FormLayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Left&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,0&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Top&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Parent,.25&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Horizontal&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Center&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;LayoutInput&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Children&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color=#a31515 size=2&gt;Scroller&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Orientation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Vertical&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color=#0000ff size=2&gt;&lt;STRONG&gt;&amp;gt;&lt;/STRONG&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;We have a scroller. I've told it that we will be scrolling vertically.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;We aren't quite done yet. There are still two more steps. We now have to &lt;EM&gt;link all of these different elements together&lt;/EM&gt;. We have a Handler, a Data element and the Scroller itself...but they don't KNOW about each-other.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;So let's hook our Scroller up to our ScrollingData object, by adding an attribute to our &lt;STRONG&gt;Scroller&lt;/STRONG&gt; tag...&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Scroller&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Orientation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Vertical&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color=#ff0000 size=2&gt;ScrollingData&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ScrollData]&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;This was the easy part. The last trick we have to do is a leetle more complicated. We have to create a new &lt;EM&gt;rule &lt;/EM&gt;to link the &lt;STRONG&gt;ScrollingHandler&lt;/STRONG&gt; and &lt;STRONG&gt;ScrollingData&lt;/STRONG&gt;. This rule is going to be run when the MCML page is first loaded, meaning it will have to be a &lt;STRONG&gt;default&lt;/STRONG&gt; rule.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;What it will do is link our ScrollingHandler to our ScrollingData object. This will mean that when the &lt;STRONG&gt;ScrollingHandler&lt;/STRONG&gt; (which is responsible for noticing mouse-clicks, focus events etc.) notices that we have tried to scroll, it will tell the &lt;STRONG&gt;ScrollingData &lt;/STRONG&gt;object, which will in turn scroll the &lt;STRONG&gt;Scroller&lt;/STRONG&gt;. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;STRONG&gt;ScrollingHandler&lt;/STRONG&gt; has a member variable called &lt;EM&gt;ScrollingData&lt;/EM&gt;. All we need to do is set it, with a &lt;EM&gt;set&lt;/EM&gt; rule, like this...&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Rules&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Default&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ScrollHandler.ScrollingData]&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Value&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ScrollData]&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Rules&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;There! If we run that, our new variables and Scroller object will keep everything nicely in line and when we move to far down or up, it will scroll to suit. Beautiful.&lt;/P&gt;
&lt;P&gt;And finally, a cosmetic&amp;nbsp;touch.&amp;nbsp;We need a &lt;STRONG&gt;FadeSize, &lt;/STRONG&gt;which tells Media Center how extreme - or how large - our fade will be when an object 'drops off'' the edge of our scroller. A value of zero will be a sharp cut, a value of five a relatively quick fadeout and 20 will give you a slow and gentle fade. And you can use both &lt;EM&gt;positive&lt;/EM&gt; and &lt;EM&gt;negative&lt;/EM&gt; fades. A positve fade will fade &lt;EM&gt;within&lt;/EM&gt; the object (for example, it will cut &lt;EM&gt;into&lt;/EM&gt; the rectangle you've specified in &lt;EM&gt;MaximumSize&lt;/EM&gt;. A negative fade value will fade &lt;EM&gt;outside&lt;/EM&gt; the bounds of this size.&lt;/P&gt;
&lt;P&gt;Oh, and with that Clip object we were talking about earlier? You can't use a negative fadesize...because the whole&amp;nbsp;point behind a Clip object is that anything you draw&amp;nbsp;&lt;EM&gt;outside&lt;/EM&gt; a Clip won't appear on the screen.&lt;/P&gt;
&lt;P&gt;So let's set our FadeSize to -20.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;Scroller&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Orientation&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Vertical&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ScrollingData&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[ScrollData]&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;MaximumSize&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0,450&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;MinimumSize&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;0,450&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;FadeSize&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;-20&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#000000&gt;And we are done!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#000000&gt;Get the source &lt;A class="" title=here href="http://www.push-a-button.com.au/downloads/triviacenter/stage6.zip" target=_blank&gt;here&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://thedigitallifestyle.com/cs/aggbug.aspx?PostID=2664" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QzQSOj9N1Mgag5J2mPlA-cXiDxM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QzQSOj9N1Mgag5J2mPlA-cXiDxM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QzQSOj9N1Mgag5J2mPlA-cXiDxM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QzQSOj9N1Mgag5J2mPlA-cXiDxM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheDigitalLifestyleDeveloperBlog/~4/mXRp2HkvuoA" height="1" width="1"/&gt;</description><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/Developer/default.aspx">Developer</category><category domain="http://thedigitallifestyle.com/cs/blogs/developer/archive/tags/MCML/default.aspx">MCML</category><feedburner:origLink>http://thedigitallifestyle.com/cs/blogs/developer/archive/2007/04/23/stage-6-cleaning-up-scrolling-our-choices.aspx</feedburner:origLink></item></channel></rss>
