我正在开发一款Windows Phone 8的XAML/C#应用程序,当我将播放器框架从1.8.2.2更新到2.0.0.0时,编译失败并出现以下错误:标签不存在。
在我的ResourceDictionary中,它存储了播放器框架的XAML样式代码,这个样式在1.8.2.2版本可以正常工作,但在2.0.0.0版本中不再兼容。
它告诉我:在XML命名空间'clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework'中不存在标签'PlayPauseButton'。
在我的ResourceDictionary中,它存储了播放器框架的XAML样式代码,这个样式在1.8.2.2版本可以正常工作,但在2.0.0.0版本中不再兼容。
<Style TargetType="playerFramework:PlayPauseButton" x:Name="DmPlayPauseButtonStyle" BasedOn="{StaticResource DmMediaPlayerButtonStyle}">
<Setter Property="SelectedContent" Value=""/>
<Setter Property="UnselectedContent" Value=""/>
<Setter Property="FontSize" Value="36"/>
<Setter Property="AutomationProperties.AutomationId" Value="PlayPauseButton"/>
</Style>
它告诉我:在XML命名空间'clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework'中不存在标签'PlayPauseButton'。
其他人有这个问题吗?
编辑(我安装了playerframework的V2.0.0.0版本):
所以我不得不使用blend重新开发样式。棘手的部分是一开始blend没有识别播放器的样式,因此我不能轻松地设计播放器。
为了克服这个问题,我将播放器的整个样式(在这里找到:http://playerframework.codeplex.com/SourceControl/latest#Phone.SL/themes/generic.xaml)与我的播放器链接起来,然后blend能够帮助我设计播放器。
希望这能帮助你们!
PS:1.8.2.2和2.0.0.0的样式完全不同,因此您无法从一个样式重用完全相同的代码设计另一个样式。
编辑2:这是MSDN文章,帮助我使用blend http://msdn.microsoft.com/en-us/library/jj171012.aspx 它包含了我学习如何使用blend所需的所有信息。