Style of MediaElement in Windows 8.1

南笙酒味 提交于 2019-12-04 15:59:17

Actually you can change the colors by overriding the default colors in the App. Note this would apply now for all MediaElement controls with transport controls, but it is possible. In your App.xaml you would provide overrides for these values like this:

  <Application.Resources>
      <SolidColorBrush x:Key="MediaButtonForegroundThemeBrush" Color="Blue" />
      <SolidColorBrush x:Key="MediaButtonBackgroundThemeBrush" Color="Transparent" />
      <SolidColorBrush x:Key="MediaButtonPointerOverForegroundThemeBrush" Color="#FFFFFFFF" />
      <SolidColorBrush x:Key="MediaButtonPointerOverBackgroundThemeBrush" Color="#26FFFFFF" />
      <SolidColorBrush x:Key="MediaButtonPressedForegroundThemeBrush" Color="#FF000000" />
      <SolidColorBrush x:Key="MediaButtonPressedBackgroundThemeBrush" Color="#FFFFFFFF" />
      <SolidColorBrush x:Key="MediaButtonPressedBorderThemeBrush" Color="#FFFFFFFF" />
      <SolidColorBrush x:Key="MediaControlPanelVideoThemeBrush" Color="Red" />
      <SolidColorBrush x:Key="MediaControlPanelAudioThemeBrush" Color="#FF000000" />
      <SolidColorBrush x:Key="MediaDownloadProgressIndicatorThemeBrush" Color="#38FFFFFF" />
      <SolidColorBrush x:Key="MediaErrorBackgroundThemeBrush" Color="#FF000000" />
      <SolidColorBrush x:Key="MediaTextThemeBrush" Color="#FFFFFFFF" />
  </Application.Resources>

This would give you a visual like this:

Hope this helps!

I think if you do not want to write your own controlpanel with play-pause-stop controls, you can not change the background of this MediaElement rendered controlpanel because it is an overlay of the video and is designed to look MS/Windows8 conform.

Note: This controlpanel is also invisible if you do not mouse-over the video.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!