This project is read-only.

Applying Entertainment theme to for windows phone media player

Topics: Windows Phone 8
Jul 9, 2014 at 9:06 AM
I have a windows phone 8 application and am using version 2.0 of the media player framework. I would like to apply the entertainment theme to my media player. Does anyone have a sample that shows how to do this?

I looked at the documentation and tried adding this resource to my page:
    <ResourceDictionary >
            <ResourceDictionary Source="ms-appx:///Microsoft.PlayerFramework/themes/EntertainmentTheme.xaml"/>
However, XAML complains that it cannot find that resource. Is it because that resource is only available for Windows (and not winphone) apps?
Jul 11, 2014 at 8:16 AM
Actually if anyone had a tutorial or instructions on how to change the default theme to anything else (classic, entertainment, universal) for a WP8.0 app, this would be greatly appreciated.
Jul 11, 2014 at 1:36 PM
The Entertainment theme is only for Windows 8 apps as far as I know (to adapt the player to Win8 UI guidelines), and therefore not applicable to a Windows Phone app.

To apply another theme, add something like this to you app.xaml.
<ResourceDictionary Source="/Microsoft.PlayerFramework;component/Themes/universal.xaml" />

Note that the URL syntax is a Little different from the Windows 8 version you posted above.
Jul 15, 2014 at 6:04 AM
Thanks for the tip! I've gotten a little further, I can switch to the classic theme with line:

<ResourceDictionary Source="/Microsoft.PlayerFramework;component/Themes/universal.xaml" />

The xaml file is found but when I look at the design window I see this error:

InvalidOperationException: Cannot resolve TargetProperty Foreground on specified object.
at MS.Internal.XcpImports.VisualStateManager_GoToState(Control reference, String StateName, Boolean useTransitions, Boolean& refreshInheritanceContext)
at System.Windows.VisualStateManager.GoToState(Control control, String stateName, Boolean useTransitions)
at System.Windows.Controls.Button.ChangeVisualState(Boolean useTransitions)
at System.Windows.Controls.Primitives.ButtonBase.OnIsEnabledChanged(IsEnabledChangedEventArgs e)
at System.Windows.Controls.Control.OnIsEnabledChanged(Control control, EventArgs args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName

Is there any way to work around this error?
Jul 15, 2014 at 9:34 AM
Yeah I get that too. Seems to be a bug in the theme xaml. The error comes from the TransportBarTextButtonStyle style, starting at line 113 in Universal.xaml. The storyboards refer to a Foreground property that doesn't exist on the ContentPresenter. Either comment out the storyboards from the Pressed/Disabled visual states, or replace the ContentPresenter with a ContentControl (like in the TransportBarButtonStyle style).
Jul 16, 2014 at 6:11 AM
That works perfectly. Thanks!!!!!