0

我刚刚将一个旧项目从 WP7.0 升级到 WP7.1 (MANGO),现在,在启动应用程序后,我在主 App.cs 类的 InitializeComponent 方法中收到此错误:

在“DoubleAnimation”类型中找不到属性“IsOptimized”。[行:14 位置:37]

我不知道如何解决这个问题,因为“App”InitializeComponent 方法似乎是自动生成的

在第 14 行,我只是引用了这样的资源字典:

<ResourceDictionary x:Key="keyname">
      <ResourceDictionary.MergedDictionaries>
          <ResourceDictionary Source="Resources/AppStyles.xaml"/>
      </ResourceDictionary.MergedDictionaries>
 </ResourceDictionary>

堆栈跟踪根本不是很有帮助:

at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at WP7App.App.InitializeComponent()
   at WP7App.App..ctor()
   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo rtci, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
   at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
   at MS.Internal.TypeProxy.<>c__DisplayClass30.<GetCreateObjectDelegate>b__2a()
   at MS.Internal.TypeProxy.CreateInstance(UInt32 customTypeId)
   at MS.Internal.FrameworkCallbacks.CreateKnownObject(IntPtr nativeRootPeer, UInt32 customTypeId, String initializationString, IntPtr& nativePeer, UInt32 isCreatedByParser)
   at MS.Internal.FrameworkCallbacks.CreateUnknownObject(String assemblyName, String typeName, IntPtr nativeRootPeer, String initializationString, UInt32& customTypeId, UInt32& coreTypeId, UInt32& typeFlags, IntPtr& nativePeer)
4

1 回答 1

0

我注意到资源字典引用了一个样式 xaml 文件,带有“isoptimized”键:

<DoubleAnimation Duration="0" To="0.4" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image1" d:IsOptimized="True"/>

删除密钥解决了问题

于 2013-05-10T15:26:54.423 回答