我从电话部分开始创建通用应用程序。
我成功安装了PlayerFramework并将其添加为参考。
但是当我将MediaPlayer
元素添加到App.xaml
时,我收到以下错误:
The name "MediaPlayer" does not exist in the namespace "using:Microsoft.PlayerFramework".
我的App.xaml
看起来像这样:
<Application
x:Class="MusicTracker.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyNameSpace!"
xmlns:mmppf="using:Microsoft.PlayerFramework">
<Application.Resources>
<Style x:Key="RootFrameStyle" TargetType="Frame">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Frame">
<Grid>
<mmppf:MediaPlayer x:Name="MediaPlayer" AudioCategory="BackgroundCapableMedia" AutoPlay="True" />
<ContentPresenter />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Application.Resources>