Child pages
  • Creating Skins for MP2

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
HTML Wrap
idtoc
Table of Contents
Table of Contents
outlinetrue
absoluteUrltrue
classwikitoc

Overview

This section introduces into the development of skins for MediaPortal 2. It will focus on the skinner's view. To understand the reasons for some of the skinning precepts given here, and to get some technical background, you should read the Skin Engine page.
When reading, you should always check the explained concepts against the currently available skin code (of the default skin, for example).

...

To create a typical "Hello World" skinfile, we use a text- or XML-editor. As XAML files are XML files, we need to put an XML header at the top of the file. The root element must always be Screen. Inside the Screen element, any UI element can be placed, we're using a label which shows our hello world text.

Code Block
languagebrush: xml; collapse: false; first-line: 1; gutter: true; ruler: false; toolbar: true; wrap-lines: true;xml
linenumberstrue
<?xml version="1.0" encoding="utf-8"?>
<Screen
    xmlns="www.team-mediaportal.com/2008/mpf/directx"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mp_special_workflow="clr-namespace:MediaPortal.UI.SkinEngine.SpecialElements.Workflow"
    mp_special_workflow:WorkflowContext.StateSlot="Root"
    x:Name="MyScreen"
    >
  <Label Content="Hello World"/>
</Screen>

As you can see, we use a default XML namespace of _

Code Block
languagephpxml
www.team-mediaportal.com/2008/mpf/directx

. This namespace contains all MPF UI elements, and works exactly like the default WPF namesapce 

Code Block
languagephpxml
[http://schemas.microsoft.com/winfx/2...l/presentation|http://schemas.microsoft.com/winfx/2006/xaml/presentation]

_ for most of our supported UI elements. The XML namespace declaration _xmlns:x="

Code Block
languagephpxml
[http://schemas.microsoft.com/winfx/2006/xaml]

...