The Windows Media Center Platform Team Blog RSS 2.0
 Thursday, October 26, 2006

Ian Dixon has posted part 2 of the interview I did with him a few weeks ago where we discussed Media Center Markup Language (MCML) development.  This episode goes into more detail about MCML development.  We discuss topics such as using Rules in your UI, when and how to write code-behind assemblies for MCML applications, Windows Media Center Presentation Layer web applications, and packaging and deployment of applications.

Here are links to this segment and also to the previous segment and the extra session that Ian recorded where he demonstrates some of the Windows Media Center SDK tools and samples:

Aaron

 

Categories: News | Comments [0] | # | Posted on Thursday, October 26, 2006 5:38:01 PM (GMT Standard Time, UTC+00:00)   
 Thursday, October 19, 2006

A new episode of the Media Center Show has been posted today that focuses on Media Center Markup Language (MCML) development.  I talked with Ian Dixon a few weeks ago, and he decided to create a  2 part show based on our talk (part 2 will be coming next week).

The first part focuses on getting started if you are new to MCML development.  It includes a discussion of some of the learning tools and samples included in the Windows Media Center SDK (such as McmlSampler and the Q sample podcast and videoblog client).

In addition, Ian posted a Media Center Show Extra segment where he presents an overview of both McmlSampler and Q running within Windows Media Center.

Here are links to both the show and the extra segment:

Hopefully you will find this information useful as you get started with Windows Media Center development.

Aaron

 

Categories: News | Comments [1] | # | Posted on Thursday, October 19, 2006 4:51:55 PM (GMT Standard Time, UTC+00:00)   
 Wednesday, October 04, 2006

One of the developers on our team recently created a sample Windows Media Center Presentation Layer web application that demonstrates how to utilize a Host object to access data that is created dynamically on a server without requiring the page to reload.  This technique can be particularly useful when you want to update some content on a page that contains numerous assets that you do not want to re-download and/or if you want to avoid visible flashing and transitions for page reloads.

There are two components to this sample - the sample UI and the sample data generation file.

Sample UI component

A live version of the sample UI can be found at http://play.mediacentersandbox.com/Sample.DataTransfer.mcml.  It contains 2 UI elements: a DataTransfer UI, and the main UI.

DataTransfer UI

The DataTransfer UI is an abstraction layer that encapsulates the functionality of loading new data into an already visible MCML page. 

Consumers that want to use this DataTransfer object need to provide the following properties:

  • A ResultSet (which is an ArrayListDataSet object) to store the results of the server-side data generation
  • A RequestStatus (which is an EditableText object) to store the current status of the data transfer
  • A TargetSource (which is a string) to specify the URL where the data should come from
  • A RefreshCommand (which is a Command object) that will invoke a data refresh

Main UI

The main UI contains an example of a common usage scenario using the DataTransfer UI. It contains the following elements:

  • An instance of the DataTransfer UI
  • A button that triggers the DataTransfer object to refresh its data when invoked (this could be easily modified to automatically refresh the data by using a timer instead of a button that the user has to click)
  • A Text field to display the status of the data transfer - it is bound to the RequestStatus that is returned by the DataTransfer object
  • A Repeater to display the updated data - it is bound to the ResultSet that is returned by the DataTransfer object

Sample data generation file

A live version of the sample data generation file can be found at http://play.mediacentersandbox.com/RandomData.aspx.  The source code for it looks like this:

<%@ Page Language="C#" %>
<% Response.ContentType = "text/xml"; %><%Response.Expires=0; %>
<% Random r = new Random(); %>
<Mcml
    xmlns="http://schemas.microsoft.com/2006/mcml"
    xmlns:cor="assembly://MSCorLib/System"
    xmlns:me="Me"
>

  <UI Name="Result">
    <Properties>
      <ArrayListDataSet Name="ResultSet">
        <Source>
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
          <cor:String String="Random.Next = <%=r.Next()%>" />
        </Source>
      </ArrayListDataSet>
    </Properties>
  </UI>

</Mcml>

You can try out this example on your Windows Vista Home Premium or Ultimate Edition RC1 or later system by downloading this RegisterMceApp XML file and running RegisterMceApp.exe <path to codeless_datatransfer_example.xml>

When you register this XML file, you will have an entry named Data Transfer Sample in the Program Library.  When you launch the sample in Windows Media Center and click the Load New Data button, the ResultSet object will be populated with 6 new random numbers, and since the ResultSet is bound to the repeater on the client UI, the data in the repeater will automatically update each time you click the button without requiring the entire page to refresh.  The UI will look like the following:

A couple of additional notes

  1. Keep in mind that due to the security restrictions in place for Windows Media Center Presentation Layer Web Applications, the UI page and the data generation page must both be hosted on the same web domain for this scenario to work as expected.  For this sample, both are hosted on the play.mediacentersandbox.com domain
  2. This scenario demonstrates a relatively simple dynamic data scenario.  For a more involved example of how to dynamically switch hosts, see the sample in McmlSampler named AdvancedMarkup.HostViewItem.mcml

Aaron

 

Categories: Sample | Comments [1] | # | Posted on Wednesday, October 04, 2006 1:14:38 AM (GMT Standard Time, UTC+00:00)   
Blogroll
About

Disclaimer
All information available via this site is provided 'as is' with no warranties and confers no rights.

© Copyright 2008 Microsoft Corporation.

Sign In
All Content © 2008, Microsoft Corporation.