The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

MCML vs XAML

Last post 09-20-2008, 12:24 AM by AndyC. 9 replies.
Sort Posts: Previous Next
  •  02-15-2008, 1:14 PM 6620

    MCML vs XAML

    Now that Vista Media Center can host a XAML page, what is the benefit of using MCML over XAML? I've been using WPF/XAML for a few months now and really love it - it would be nice to be able to re-use that knowledge.

    If you've used both, can you provide any insight?
  •  02-15-2008, 2:16 PM 6621 in reply to 6620

    Re: MCML vs XAML

    I've used both and have to say for Media Center development I much prefer MCML. 

    MCML has better integration into Media Center than WPF but the biggest reason to not use WPF is that it is deprecated in the SDK as of v5.3 - i.e. no further support for this technology, even though it may currently still work.

    If you've been doing your WPF development using binding in your UI and setting the DataContext to the associated partial class, then you can develop MCML in exactly the same way.  If you've been coding in the old "VB style" of directly manipulating your UI from code, then it's going to be a tougher transition.

    Cheers,
    Andrew

     

  •  02-15-2008, 2:46 PM 6622 in reply to 6621

    Re: MCML vs XAML

    I typically do my binding in markup - unless its more complex or just makes sense to use code-behind. Does MCML not allow you to modify the UI from code?

    Can you provide a little more detail about the "better integration w/ Media Center" that MCML provides?

    Thanks for the quick reply!
  •  02-15-2008, 4:56 PM 6623 in reply to 6622

    Re: MCML vs XAML

    Keep chatting with AndyC -- but please know we deprecated the XAML Browser Application (XBAP) paradigm with the release of the 5.3 SDK.


    Charlie Owen (Microsoft)
  •  02-15-2008, 9:26 PM 6624 in reply to 6620

    Re: MCML vs XAML

    To me it boils down to fidelity of graphics and animations, with mcml you get full motion graphics using XBAP on the other hand you are limited to 3 or 4 FPS. Also as noted above XBAP has been deprecated.
    blog.manghera.com
  •  02-16-2008, 12:30 AM 6631 in reply to 6622

    Re: MCML vs XAML

    bobbyderosa:
    I typically do my binding in markup - unless its more complex or just makes sense to use code-behind. Does MCML not allow you to modify the UI from code?

    Can you provide a little more detail about the "better integration w/ Media Center" that MCML provides?

    Thanks for the quick reply!

    In WPF you can bind your XAML to the partial class that is created alongside it by putting this.DataContext = this in the constructor of the partial class, or you can put DataContext="{Binding RelativeSource={RelativeSource Self}}" in the XAML window/page element.  You can then put {Binding Path=propertyname, Mode=TwoWay} as the data source for your UI element (e.g. <CheckBox IsChecked="{..}">), and define properties in your class firing OnPropertyChanged when the setter is accessed.

    In MCML you can create the properties in exactly the same way in a class (I create a class per page, with the same name as the MCML file - e.g. DisplayPage.mcml and DisplayPage.cs).  Inherit your class from ModelItem and you can then access FirePropertyChanged in your setter to notify your MCML that a property has changed.  To "bind" the code behind, pass a property into the page (I call it "Page" for some reason :) and then bind each individual property using a <Binding> rule.

    For integration differences, have a look at both the other comments in this post but also search for XBAP, XAML, and WPF in the forum - there are a number of posts about it.   The biggest benefit (not mentioned in any posts that I can recall) is that the animations in MCML are much easier (IMHO) than in WPF.  The worst feature of WPF in Media Center for me is that it is overlaid on the Media Center surface rather than being in it, like MCML so the transition between Media Center and the XBAP is ugly.

    Cheers,
    Andrew

  •  02-17-2008, 12:10 PM 6643 in reply to 6631

    Re: MCML vs XAML

    Thanks for the clarification guys.

    OK, well that was an easy decision.  It's obvious MCML is the proper choice in my case. Do any of you know if there are any MCML books available? I searched amazon but came up fruitless.

    Thanks again.
  •  02-17-2008, 8:44 PM 6653 in reply to 6643

    Re: MCML vs XAML

    We wrote a book -- it's called the SDK. :-)
    Charlie Owen (Microsoft)
  •  09-18-2008, 3:41 AM 8391 in reply to 6653

    Re: MCML vs XAML

    Hi,

    before XBAP was deprecated in Media Center, I was thinking to build an application with 3D animations, to drive a massage armchair. I guess this feature is unavailable using MCML. Am I right?

  •  09-20-2008, 12:24 AM 8397 in reply to 8391

    Re: MCML vs XAML

    I wouldn't say that Media Center was your best option for this application!

    You can still use XBAP, just be aware that by Windows 7 it may not work.

    Cheers,
    Andrew

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems