This sample would be classified in the 'fun' category of neat things you can do with MCML and animations. Enjoy...!

<Mcml xmlns=""

 <UI Name="Move">

   <!-- A ListDataSet that handles content / order change events -->
   <ArrayListDataSet Name="MyList">
     <sys:String String="a"/>
     <sys:String String="b"/>
     <sys:String String="c"/>
     <sys:String String="d"/>
     <sys:String String="e"/>
     <sys:String String="f"/>
     <sys:String String="g"/>
     <sys:String String="h"/>
     <sys:String String="i"/>
     <sys:String String="j"/>
     <sys:String String="k"/>
     <sys:String String="l"/>
     <sys:String String="m"/>
     <sys:String String="n"/>
     <sys:String String="o"/>
     <sys:String String="p"/>
     <sys:String String="q"/>
     <sys:String String="r"/>
     <sys:String String="s"/>
     <sys:String String="t"/>
     <sys:String String="u"/>
     <sys:String String="v"/>
     <sys:String String="w"/>
     <sys:String String="x"/>
     <sys:String String="y"/>
     <sys:String String="z"/>

   <!-- A timer that fires every now and then to kick off a move event. -->
   <Timer Name="Timer" Interval="100" AutoRepeat="true" Enabled="true"/>

   <!-- Values that hold the old and new index to used with the Move() method -->
   <!-- to affect the position of individual items in the ArrayListDataSet. -->
   <sys:Int32 Name="OldIndex" Int32="0"/>
   <sys:Int32 Name="NewIndex" Int32="0"/>

   <!-- A random used to generate values for OldIndex and NewIndex. -->
   <sys:Random Name="RandomGenerator"/>

   <!-- A rule that evaluates for each tick of the timer. -->
   <Changed Source="[Timer.Tick]">
     <!-- Generate a random start and end index -->
     <Invoke Target="[RandomGenerator.Next]" maxValue="[MyList.Count]" ResultTarget="[OldIndex]" ExclusiveApply="false"/>
     <Invoke Target="[RandomGenerator.Next]" maxValue="[MyList.Count]" ResultTarget="[NewIndex]" ExclusiveApply="false"/>

     <!-- Invoke the Move() method which will modify the order -->
     <!-- of the ArrayListDataSet -->
     <Invoke Target="[MyList.Move]" oldIndex="[OldIndex]" newIndex="[NewIndex]"/>

     <!-- View the changes made to the indexes using a tool like DebugView to view. -->
     <!-- See -->
     <DebugTrace Message="Moving from from {0} to {1}">
       <ObjectPath ObjectPath="[OldIndex]"/>
       <ObjectPath ObjectPath="[NewIndex]"/>

   <Repeater Source="[MyList]" Layout="HorizontalFlow">
     <!-- The UI used for our item, passing in the Index and value from -->
     <!-- the ArrayListDataSet. -->
     <me:Item Index="[RepeatedItemIndex]" Value="[RepeatedItem!sys:String]">
       <!-- Each time the index changes for the ArrayListDataItem -->
       <!-- run this animation. Depending on the timer interval this can have -->
       <!-- a cumulative effect as the animation is applied across the range -->
       <!-- determined by the random number generator for OldIndex and NewIndex. -->
       <!-- A timer interval of 100 or less demonstrates this effect well. -->
       <Animation Type="Move">
         <PositionKeyframe Time="0.00" RelativeTo="Current" Interpolation="SCurve"/>
         <PositionKeyframe Time="0.15" RelativeTo="Current" Value="0,-20,0"/>
         <PositionKeyframe Time="0.35" RelativeTo="Final" Value="0,-20,0"/>
         <PositionKeyframe Time="0.50" RelativeTo="Final" Interpolation="SCurve"/>

 <UI Name="Item">

   <!-- These are set as each item is created in the repeater. -->
   <Index Name="Index" Index="$Required"/>
   <sys:String Name="Value" String="$Required"/>

   <!-- Bind the index. Note when the index changes we see the change reflected -->
   <!-- in the visuals without any explicit code setting the value. -->
   <Binding Source="[Index.Value.ToString]" Target="[IndexLabel.Content]"/>

   <Panel Layout="VerticalFlow">
     <!-- The text from the ArrayListDataSet which is repeated. -->
     <Text Content="[Value]" Color="White" Font="Courier New, 24"/>
     <!-- The index of the item in the ArrayListDataSet. -->
     <Text Name="IndexLabel" Color="Gray" Font="Courier New, 12">
       <!-- Each time the index changes animate the number beneath the text. -->
       <!-- Like the other animation this can have a cumulative effect -->
       <!-- as the timer interval is lowered. -->
       <Animation Type="ContentChangeHide">
         <PositionKeyframe Time="0.00" RelativeTo="Current" Interpolation="Log"/>
         <PositionKeyframe Time="0.50" RelativeTo="Current" Value="0,100,0"/>
         <AlphaKeyframe Time="0.00" RelativeTo="Current" Interpolation="Log"/>
         <AlphaKeyframe Time="0.50" RelativeTo="Current" Value="0"/>



Categories: Sample | Comments [0] | # | Posted on Thursday, October 25, 2007 6:49:34 AM (GMT Daylight Time, UTC+01:00)   

I can't believe Chris posted the press release but didn't go nuts around the fact the new XBox 360 Arcade has the same great Media Center Extender built in as all of its predecessors. I was happily surprised to note these have HDMI on board -- there is a LOT of bang for buck this Christmas in this new arcade SKU for consumers. Kudos to the XBox team for making it happen!

Categories: Media Center Extender | Windows Media Center | XBox 360 | Comments [65] | # | Posted on Tuesday, October 23, 2007 9:28:34 PM (GMT Daylight Time, UTC+01:00)   

Robert has been trashing Microsoft quite a bit lately -- his most recent dig at Zune is somewhat over the top. A response is in order...

Robert: "Many projects there are simply defensive ones. To keep a competitor from getting more inroads into one of its businesses."

Many (perhaps even most) products are born in response to competitive pressures. I would say it's a sign of a company which is not satisfied with the status quo and very much has a 'can do' attitude with a belief they can make a better mousetrap.

Robert: "The problem is that whenever you do something just to defend another business you don’t do it from a position of love. Or a position of strength."

I personally don't believe the concepts of 'defense' and 'love' and 'strength' are mutually exclusive. I believe you can play a defensive position out of love for the company or product. A soccer analogy is a good one here. On a soccer team you have offensive and defensive players. The defensive objective is to stop the other team and move the ball forward to the offense so they can score points. I play soccer, specifically as a defender. I play with every bit as much passion and love of the game as the offensive player. In the case of Zune I think Robert is off base. Everything I've seen and heard is about building a better mousetrap, not protecting another mousetrap. I'd also say there is absolutely nothing wrong with building a better mousetrap AND defending the one you already have -- just like in soccer.

Robert: "I’m totally uninspired. Yawn."

That's probably because you haven't actually sat down for any length of time and played with one of the new Zunes, its software or communities. On this I will say the following: Shame on you, Robert, for jumping on the bashing bandwagon. Maybe next time you should wait and actually use the product before you drag its reputation through the mud. I could be wrong but I *think* you will be singing a different tune once you've had a chance to experience it yourself.

Finally, I'm beginning to think Robert is forgetting there are real people who work at Microsoft. Once upon a time he went from office to office with his video camera and helped to tell the stories of interesting individuals and teams working on neat stuff. Perhaps we haven't changed all that much while your access to the percolation of technology here at Microsoft has and in that vacuum you can only assume a negative end result.

Life is good here at Microsoft (you can't measure everything about a corporation based solely on their current stock price). In many, many ways it's much better than when you were here, Robert. Do try to keep the interpersonal relationships in mind when you are negative or critical of us over here in the collective hive. :-) Perhaps that should go in the manifesto right underneath number 5.

Categories: Be Smart | Zune | Comments [3] | # | Posted on Thursday, October 4, 2007 3:02:48 AM (GMT Daylight Time, UTC+01:00)   

Chris Lanier, once he has actually played with the new Zune devices and software, will end up loving them. I was lucky enough to get to play with one of the new Zune 80 devices a couple of weeks back and the ZunePad is absolutely brilliant (not sure how much I can say about how it works -- but trust me, you will think it's pretty cool -- the wife acceptance factor takes a HUGE leap over the iPod clickwheel - nuff said I think). Likewise, the software is wonderful -- many of the same crew who have worked on Windows Media Center (design, usability, engineering) had a big hand in bringing a fresh, new experience to life.

On a related note, Michael Gartenberg doesn't really appreciate the candid and earnest opinion of Bill Gates about Zune. Don't get me wrong, the Steve Jobs reality distortion field is nice and comfy -- but doesn't really tell the whole story about their products.

Categories: Zune | Comments [8] | # | Posted on Wednesday, October 3, 2007 4:22:25 PM (GMT Daylight Time, UTC+01:00)   
RSS 2.0
Sign In | All Content © 2014 Charlie Owen

This is a personal weblog. The opinions expressed here represent my own and not those of my employer.

Powered by newtelligence dasBlog 2.3.9074.18820