How to keep default theme of player framework.

Topics: Windows 8 Xaml
Feb 1, 2013 at 7:51 AM
my app supports light and dark theme. when I change theme using requestedtheme = light, player also changes its theme to light. I don't like light theme of player. how can I keep default theme?
Feb 1, 2013 at 10:50 PM
Great question Jack312. Unlike JS, it is not possible to apply the standard theme to an individual page or control. But, you can do just about anything with custom Xaml right? To confirm, I went ahead and created 2 separate dark theme xaml files (one for the default look and another for the entertainment theme) that hardcodes all colors instead of using the theme driven colors. I would share this now but it's based on slightly newer xaml which we haven't shipped yet so I don't think it will work with the shipping version. But, I'll make sure I include this in the next update's sample project.

In a nutshell, what I did was:
1) make a copy of the player framework's default xaml
2) mix in all the theme color resources (they are at the top of the file: C:\Program Files (x86)\Windows Kits\8.0\Include\WinRT\Xaml\Design\generic.xaml) and get the player to use those instead.
Feb 2, 2013 at 4:27 AM
I tried hard coding color. I was not able to set right colors for volume button and seekable slider (especially buffering status). I will wait for next update :). Thanks a lot!
Apr 17, 2013 at 3:54 AM
is this shipping as part of next update??
Apr 22, 2013 at 6:38 PM
Yes, it was also included in the v1.2 beta. You can find it in the samples zip under \Win8.Xaml.Samples\DarkTheme.xaml and DarkEntertainmentTheme.xaml
Apr 24, 2013 at 4:30 AM
I added DarkEntertainmentTheme.xaml to project and added ResourceDictionary Source="theme/DarkEntertainmentTheme.xaml" . player doesn't look like its picking entertainment theme. all player controls are at bottom and in white background. (i.e. normal player control with light theme). am I missing something?
Apr 26, 2013 at 4:06 PM
You'll need to explicitly specify the style of the MediaPlayer. For example, after dropping the xaml file in your project:
                <ResourceDictionary Source="ms-appx:///DarkEntertainmentTheme.xaml"/>
    <Grid Style="{StaticResource LayoutRootStyle}">
        <mmppf:MediaPlayer x:Name="player" Style="{StaticResource Dark_MediaPlayer}"/>
Alternatively, you could modify the DarkEntertainmentTheme.xaml file and remove the key on MediaPlayer (thereby defining an implicit style) and add the resource to app.xaml instead of your page's resources.
May 1, 2013 at 6:11 AM
thanks :). that worked!