SlideShare a Scribd company logo
1 of 28
Developing Media CenterPresentation Layer Applications Andrew Cherry Digital Living Solutions Ltd
A bit about me UK Media Center & WHS User Group 23-Apr-2009 2 Digital Living Solutions Ltd Hampshire based, specialising in digital home installation,  integration, and software development (including Media Center) Microsoft MVP for Media Center since July 2007 “Community Dev Expert” for the Media Center Sandbox (Microsoft-run developer forum for Media Center)
Purpose of today's session Remove the mystery behind Media Center development Give you a taster of how straightforward it is to develop for Media Center Hopefully inspire you to take the next step and start developing your own add-ins! 23-Apr-2009 UK Media Center & WHS User Group 3
Why develop for Media Center? Potential reach Every Vista Home Premium/Ultimate system has Media Center on it already! Cost of entry All the tools you need are free – Visual C# Express, Media Center SDK You can develop some fun stuff! Limited only by your imagination and patience! 23-Apr-2009 UK Media Center & WHS User Group 4
Media Center Presentation Layer (MCPL) Core building block of Media Center The core UI for Vista Media Center is written in MCML XML based Markup Language Developed (and optimised) specifically for Media Center Used in conjunction with “backend” C# code Applications = code + markup Code = “application logic”, Markup = UI Model-View-Controller pattern 23-Apr-2009 UK Media Center & WHS User Group 5
Media Center Markup Language“Code Behind” Application logic (code + data) Managed code language (e.g. C#) Cannot directly modify view properties Can respond to view events Non-visual, code only Known as a “ModelItem” 23-Apr-2009 UK Media Center & WHS User Group 6 Model View ,[object Object]
Media Center Markup Language
Can read/write model properties
Can respond to model changes
Visual + UI logic
Known as a “ViewItem”,[object Object]
The Bad News	 “Windows 1.0 programmers had a straightforward life. They had almost no choices about how to do things; either there was an application programming interface (API), or there wasn’t, and most of the time there wasn’t. This meant that developers had to build almost everything by hand.” 23-Apr-2009 UK Media Center & WHS User Group 8 MCPL = Windows 1.0 Windows Forms 2.0 Programming, Chris Sells & Michael Weinhardt
Media Center Markup LanguageBasics “UI” encapsulates the definition of the user interface at a specific level All content appears within a Content element, within the UI element 23-Apr-2009 UK Media Center & WHS User Group 9 <Mcmlxmlns="http://schemas.microsoft.com/2006/mcml">   <UI Name="UI name">     <Content>       ...     </Content>   </UI> </Mcml>
Media Center Markup LanguageVisual Primitives Three visual primitives <Text> <Graphic> <ColorFill> 23-Apr-2009 UK Media Center & WHS User Group 10 <Text 	Content="Hello World!" Color="White"  	Font="Arial,30" /> <Graphic Content="resx://addin/addin.resources/image" /> <ColorFill Content="Red" />
Media Center Markup LanguageVisual Primitives Two “non-visible” container primitives <Panel> <Clip> Seven layout modes Form Anchor Dock Flow 23-Apr-2009 UK Media Center & WHS User Group 11 ,[object Object]
Scale
Rotate,[object Object]
Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 13 <Content>   <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor">     <Children>       <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true">         <LayoutInput>           <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/>         </LayoutInput>         <Children>           <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/>         </Children>       </Clip>       <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/>     </Children>   </Panel> </Content> Play
Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 14 <Content>   <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor">     <Children>       <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true">         <LayoutInput>           <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/>         </LayoutInput>         <Children>           <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/>         </Children>       </Clip>       <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/>     </Children>   </Panel> </Content> Play
Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 15 <Content>   <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor">     <Children>       <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true">         <LayoutInput> <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/>         </LayoutInput>         <Children>           <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/>         </Children>       </Clip>       <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/>     </Children>   </Panel> </Content> Play
Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 16 <Content>   <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor">     <Children>       <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true">         <LayoutInput>           <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/>         </LayoutInput>         <Children>           <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/>         </Children>       </Clip>       <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/>     </Children>   </Panel> </Content> Play
Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 17 <Content>   <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor">     <Children>       <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true">         <LayoutInput>           <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/>         </LayoutInput>         <Children>           <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/>         </Children>       </Clip>       <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/>     </Children>   </Panel> </Content> Play
Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 18 <Rules>   <Rule>   <Conditions> <Equality Source="[Input.KeyFocus]“ Value="true"/> </Conditions>   <Actions> <Set Target="[Background.Content]" Value="[FocusImage]”/> </Actions>   </Rule>   <Condition Source="[Model.Dormant]" SourceValue="true"> <Actions> <Set Target="[Text.Color]" Value=“[DormantBlue]"/> </Actions>   </Condition> <Rules> Play
Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 19 <Rules>   <Rule>     <Conditions>       <Equality Source="[Input.KeyFocus]“ Value="true"/>     </Conditions>     <Actions>       <Set Target="[Background.Content]" Value="[FocusImage]”/>     </Actions>   </Rule>   <Condition Source="[Model.Dormant]" SourceValue="true">     <Actions>       <Set Target="[Text.Color]" Value=“[DormantBlue]"/>     </Actions>   </Condition> <Rules> Play
Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 20 <Rules>   <Rule>     <Conditions>       <Equality Source="[Input.KeyFocus]“ Value="true"/>     </Conditions>     <Actions>       <Set Target="[Background.Content]" Value="[FocusImage]”/>     </Actions>   </Rule>   <Condition Source="[Model.Dormant]" SourceValue="true">     <Actions>       <Set Target="[Text.Color]" Value=“[DormantBlue]"/>     </Actions>   </Condition> <Rules> Play
Media Center Markup LanguageModelItems Built-in objects “known” to MCML – can be inherited from Can be used safely to interact with View Items(Model Items are created on the application thread) Model Items can trigger actions in their associated View (using the FirePropertyChangedmethod) Have special functions in the Media Center environment (e.g. ArrayListDataSet) 23-Apr-2009 UK Media Center & WHS User Group 21
Media Center Markup LanguageBuilt-in ModelItem Examples ArrayListDataSet BooleanChoice ByteRangedValue Choice Command EditableText Image IntRangedValue ListDataSet ModelItem RangedValue VirtualList 23-Apr-2009 UK Media Center & WHS User Group 22
The Media Center API Access to non-visual elements of Media Center Transport and volume controls Launch applications and navigate to pages Play media Show dialogs Control DVD Changers Access scheduled and recorded TV metadata 23-Apr-2009 UK Media Center & WHS User Group 23

More Related Content

Similar to Uk Media Center User Group April 2009

Mix Essentials Denmark
Mix Essentials DenmarkMix Essentials Denmark
Mix Essentials Denmarkfelixthehat
 
Developing for Windows Phone 7
Developing for Windows Phone 7Developing for Windows Phone 7
Developing for Windows Phone 7Zeddy Iskandar
 
Yahoo Mobile Widgets
Yahoo Mobile WidgetsYahoo Mobile Widgets
Yahoo Mobile WidgetsJose Palazon
 
PreDevCamp San Diego slides
PreDevCamp San Diego slidesPreDevCamp San Diego slides
PreDevCamp San Diego slidesDavid Horn
 
Ruby & Python with Silverlight O RLY? YA RLY!
Ruby & Python with Silverlight O RLY? YA RLY!Ruby & Python with Silverlight O RLY? YA RLY!
Ruby & Python with Silverlight O RLY? YA RLY!Martha Rotter
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileChris Toohey
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Doris Chen
 
Pragmatics of Declarative Ajax
Pragmatics of Declarative AjaxPragmatics of Declarative Ajax
Pragmatics of Declarative Ajaxdavejohnson
 
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]Chris Toohey
 
What I brought back from Austin
What I brought back from AustinWhat I brought back from Austin
What I brought back from AustinLisa Adkins
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Finalematrix
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsRicardo Varela
 
Introdução ao Microsoft Silverlight 2.0 - Campus Party Brasil 2009
Introdução ao Microsoft Silverlight 2.0 - Campus Party Brasil 2009Introdução ao Microsoft Silverlight 2.0 - Campus Party Brasil 2009
Introdução ao Microsoft Silverlight 2.0 - Campus Party Brasil 2009Ramon Durães
 
Silver Light By Nyros Developer
Silver Light By Nyros DeveloperSilver Light By Nyros Developer
Silver Light By Nyros DeveloperNyros Technologies
 
OpenSocial - GTUG Stockholm Meeting Oct 1 2009
OpenSocial - GTUG Stockholm Meeting Oct 1 2009OpenSocial - GTUG Stockholm Meeting Oct 1 2009
OpenSocial - GTUG Stockholm Meeting Oct 1 2009Jacob Gyllenstierna
 

Similar to Uk Media Center User Group April 2009 (20)

Presentation wpf
Presentation wpfPresentation wpf
Presentation wpf
 
Mix Essentials Denmark
Mix Essentials DenmarkMix Essentials Denmark
Mix Essentials Denmark
 
Developing for Windows Phone 7
Developing for Windows Phone 7Developing for Windows Phone 7
Developing for Windows Phone 7
 
BluePrint Mobile Framework
BluePrint Mobile FrameworkBluePrint Mobile Framework
BluePrint Mobile Framework
 
Yahoo Mobile Widgets
Yahoo Mobile WidgetsYahoo Mobile Widgets
Yahoo Mobile Widgets
 
Windows 8 Developer Preview
Windows 8 Developer PreviewWindows 8 Developer Preview
Windows 8 Developer Preview
 
PreDevCamp San Diego slides
PreDevCamp San Diego slidesPreDevCamp San Diego slides
PreDevCamp San Diego slides
 
Ruby & Python with Silverlight O RLY? YA RLY!
Ruby & Python with Silverlight O RLY? YA RLY!Ruby & Python with Silverlight O RLY? YA RLY!
Ruby & Python with Silverlight O RLY? YA RLY!
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for Mobile
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
 
Pragmatics of Declarative Ajax
Pragmatics of Declarative AjaxPragmatics of Declarative Ajax
Pragmatics of Declarative Ajax
 
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
 
What I brought back from Austin
What I brought back from AustinWhat I brought back from Austin
What I brought back from Austin
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Final
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile Widgets
 
Mashup Y! widget
Mashup Y! widgetMashup Y! widget
Mashup Y! widget
 
Introdução ao Microsoft Silverlight 2.0 - Campus Party Brasil 2009
Introdução ao Microsoft Silverlight 2.0 - Campus Party Brasil 2009Introdução ao Microsoft Silverlight 2.0 - Campus Party Brasil 2009
Introdução ao Microsoft Silverlight 2.0 - Campus Party Brasil 2009
 
Silver Light By Nyros Developer
Silver Light By Nyros DeveloperSilver Light By Nyros Developer
Silver Light By Nyros Developer
 
Creating a Mobile Portal
Creating a Mobile PortalCreating a Mobile Portal
Creating a Mobile Portal
 
OpenSocial - GTUG Stockholm Meeting Oct 1 2009
OpenSocial - GTUG Stockholm Meeting Oct 1 2009OpenSocial - GTUG Stockholm Meeting Oct 1 2009
OpenSocial - GTUG Stockholm Meeting Oct 1 2009
 

Uk Media Center User Group April 2009

  • 1. Developing Media CenterPresentation Layer Applications Andrew Cherry Digital Living Solutions Ltd
  • 2. A bit about me UK Media Center & WHS User Group 23-Apr-2009 2 Digital Living Solutions Ltd Hampshire based, specialising in digital home installation, integration, and software development (including Media Center) Microsoft MVP for Media Center since July 2007 “Community Dev Expert” for the Media Center Sandbox (Microsoft-run developer forum for Media Center)
  • 3. Purpose of today's session Remove the mystery behind Media Center development Give you a taster of how straightforward it is to develop for Media Center Hopefully inspire you to take the next step and start developing your own add-ins! 23-Apr-2009 UK Media Center & WHS User Group 3
  • 4. Why develop for Media Center? Potential reach Every Vista Home Premium/Ultimate system has Media Center on it already! Cost of entry All the tools you need are free – Visual C# Express, Media Center SDK You can develop some fun stuff! Limited only by your imagination and patience! 23-Apr-2009 UK Media Center & WHS User Group 4
  • 5. Media Center Presentation Layer (MCPL) Core building block of Media Center The core UI for Vista Media Center is written in MCML XML based Markup Language Developed (and optimised) specifically for Media Center Used in conjunction with “backend” C# code Applications = code + markup Code = “application logic”, Markup = UI Model-View-Controller pattern 23-Apr-2009 UK Media Center & WHS User Group 5
  • 6.
  • 9. Can respond to model changes
  • 10. Visual + UI logic
  • 11.
  • 12. The Bad News “Windows 1.0 programmers had a straightforward life. They had almost no choices about how to do things; either there was an application programming interface (API), or there wasn’t, and most of the time there wasn’t. This meant that developers had to build almost everything by hand.” 23-Apr-2009 UK Media Center & WHS User Group 8 MCPL = Windows 1.0 Windows Forms 2.0 Programming, Chris Sells & Michael Weinhardt
  • 13. Media Center Markup LanguageBasics “UI” encapsulates the definition of the user interface at a specific level All content appears within a Content element, within the UI element 23-Apr-2009 UK Media Center & WHS User Group 9 <Mcmlxmlns="http://schemas.microsoft.com/2006/mcml"> <UI Name="UI name"> <Content> ... </Content> </UI> </Mcml>
  • 14. Media Center Markup LanguageVisual Primitives Three visual primitives <Text> <Graphic> <ColorFill> 23-Apr-2009 UK Media Center & WHS User Group 10 <Text Content="Hello World!" Color="White" Font="Arial,30" /> <Graphic Content="resx://addin/addin.resources/image" /> <ColorFill Content="Red" />
  • 15.
  • 16. Scale
  • 17.
  • 18. Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 13 <Content> <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor"> <Children> <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true"> <LayoutInput> <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/> </LayoutInput> <Children> <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/> </Children> </Clip> <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/> </Children> </Panel> </Content> Play
  • 19. Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 14 <Content> <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor"> <Children> <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true"> <LayoutInput> <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/> </LayoutInput> <Children> <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/> </Children> </Clip> <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/> </Children> </Panel> </Content> Play
  • 20. Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 15 <Content> <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor"> <Children> <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true"> <LayoutInput> <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/> </LayoutInput> <Children> <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/> </Children> </Clip> <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/> </Children> </Panel> </Content> Play
  • 21. Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 16 <Content> <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor"> <Children> <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true"> <LayoutInput> <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/> </LayoutInput> <Children> <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/> </Children> </Clip> <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/> </Children> </Panel> </Content> Play
  • 22. Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 17 <Content> <Panel Name="Panel" Margins="10,0,10,0" MinimumSize="[Size]" MaximumSize="[Size]" Layout="Anchor"> <Children> <Clip Name="Fade" FadeSize="10" FadeAmount="1.0" FarOffset="-40" ShowFar="true" ShowNear="false" Visible="true"> <LayoutInput> <AnchorLayoutInput Left="Parent,0" Top="Parent,0" Right="Parent,1" Bottom="Parent,1"/> </LayoutInput> <Children> <Text Name="Text" Content="[Description]" Margins="10,8,10,8" Color=“White" Font=“Segoe Media Center,20”/> </Children> </Clip> <Graphic Name="Background" Content=“[NoFocusImage]" MinimumSize=“[Size]" MaximumSize=“[Size]"/> </Children> </Panel> </Content> Play
  • 23. Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 18 <Rules> <Rule> <Conditions> <Equality Source="[Input.KeyFocus]“ Value="true"/> </Conditions> <Actions> <Set Target="[Background.Content]" Value="[FocusImage]”/> </Actions> </Rule> <Condition Source="[Model.Dormant]" SourceValue="true"> <Actions> <Set Target="[Text.Color]" Value=“[DormantBlue]"/> </Actions> </Condition> <Rules> Play
  • 24. Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 19 <Rules> <Rule> <Conditions> <Equality Source="[Input.KeyFocus]“ Value="true"/> </Conditions> <Actions> <Set Target="[Background.Content]" Value="[FocusImage]”/> </Actions> </Rule> <Condition Source="[Model.Dormant]" SourceValue="true"> <Actions> <Set Target="[Text.Color]" Value=“[DormantBlue]"/> </Actions> </Condition> <Rules> Play
  • 25. Media Center Markup LanguageAnatomy of a button Use a combination of visual primitives, layouts, and rules to generate effects 23-Apr-2009 UK Media Center & WHS User Group 20 <Rules> <Rule> <Conditions> <Equality Source="[Input.KeyFocus]“ Value="true"/> </Conditions> <Actions> <Set Target="[Background.Content]" Value="[FocusImage]”/> </Actions> </Rule> <Condition Source="[Model.Dormant]" SourceValue="true"> <Actions> <Set Target="[Text.Color]" Value=“[DormantBlue]"/> </Actions> </Condition> <Rules> Play
  • 26. Media Center Markup LanguageModelItems Built-in objects “known” to MCML – can be inherited from Can be used safely to interact with View Items(Model Items are created on the application thread) Model Items can trigger actions in their associated View (using the FirePropertyChangedmethod) Have special functions in the Media Center environment (e.g. ArrayListDataSet) 23-Apr-2009 UK Media Center & WHS User Group 21
  • 27. Media Center Markup LanguageBuilt-in ModelItem Examples ArrayListDataSet BooleanChoice ByteRangedValue Choice Command EditableText Image IntRangedValue ListDataSet ModelItem RangedValue VirtualList 23-Apr-2009 UK Media Center & WHS User Group 22
  • 28. The Media Center API Access to non-visual elements of Media Center Transport and volume controls Launch applications and navigate to pages Play media Show dialogs Control DVD Changers Access scheduled and recorded TV metadata 23-Apr-2009 UK Media Center & WHS User Group 23
  • 29. Examples of add-ins for Media Center 23-Apr-2009 UK Media Center & WHS User Group 24 GridSearch for Media CenterTM © JFDI Engineering
  • 30. Examples of add-ins for Media Center 23-Apr-2009 UK Media Center & WHS User Group 25 Niveus Weather © Niveus Media, Inc.
  • 31. Examples of add-ins for Media Center 23-Apr-2009 UK Media Center & WHS User Group 26 Life|Ware © Exceptional Innovation, LLC
  • 32. Examples of add-ins for Media Center 23-Apr-2009 UK Media Center & WHS User Group 27 Niveus Movie Library © Niveus Media, Inc.
  • 33. Where next? Read the SDK help file from start to finish! Play with the MCML Sampler in the SDK Install and play with the Q and Z applications Experiment with creating your own controls Experiment with creating layouts Get help from the community http://discuss.mediacentersandbox.com Start developing! 23-Apr-2009 UK Media Center & WHS User Group 28