Xaml错误:属性“0”;“价值”;在类型“中找不到”;WindowsUIXamlBindingWrapper";

Xaml错误:属性“0”;“价值”;在类型“中找不到”;WindowsUIXamlBindingWrapper";,xaml,windows-phone-8.1,Xaml,Windows Phone 8.1,我正在编写一个使用集线器控制的Windows 8.1应用程序。 此项目还使用mvvmLight 像这样的DataContext类 public class UserInfoViewModel : ViewModelBase { private UserInfo userInfo; public UserInfo User { get { return userInfo; } set { if (va

我正在编写一个使用集线器控制的Windows 8.1应用程序。 此项目还使用mvvmLight

像这样的DataContext类

public class UserInfoViewModel : ViewModelBase
{
    private UserInfo userInfo;

    public UserInfo User
    {
        get { return userInfo; }
        set
        {
            if (value == userInfo)
                return;
            userInfo = value;

            RaisePropertyChanged("User");
        }
    }
    public UserInfoViewModel()
    {


        User = new UserInfo()
        {
            NikeName = "User",
            ProfileImage = "ms-appx:///image/test.jpg"
        };

    }
}
当我像这样使用
HubSection.ContentTemplate
时, 似乎装订有问题

  <HubSection.ContentTemplate>
                    <DataTemplate>
                        <ContentControl>
                            <StackPanel
                                    DataContext="{Binding User, Source={StaticResource Locator}}">
                            </StackPanel>
                        </ContentControl>
                    </DataTemplate>
                </HubSection.ContentTemplate>

将有一个XAML错误

在类型“WindowsUIXamlBindingWrapper”中找不到属性“Value”

System.ArgumentNullException
值不能为null。
参数名称:key
位于System.Collections.Generic.Dictionary`2.Remove(TKey)
位于Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.WindowsRuntimeContext.UnregisterDynamicType(类型dynamicType)
位于Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.UnregisterDynamicType(类型dynamicType)
位于Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.MockTypeGenerator.Reset()
位于Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.XamlProjectMetadata.OnTypesInvalidatedInternal(IList`1 invalidatedAssemblies)
位于Microsoft.VisualStudio.DesignTools.Platform.Metadata.TypeResolver.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
在Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.XamlProjectMetadata.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)上
位于Microsoft.VisualStudio.DesignTools.Designer.Project.ProjectAssemblyCollection.FireChangedEvent(NotifyCollectionChangedEventArguments)
在Microsoft.VisualStudio.DesignTools.Designer.Project.ProjectAssemblyCollection.AssemblyCollection\u EnumerationChanged(对象发送方,EnumerationChangedEventArgs`1 e)
在System.EventHandler`1.Invoke处(对象发送方,TEventArgs e)
位于Microsoft.VisualStudio.DesignTools.Utility.Collections.NotifyingCollectionBase`1.EventInvoker(EnumerationChangedEventArgs`1 eventArguments)
位于Microsoft.VisualStudio.DesignTools.Utility.Events.SuspendingEventManager`1.ForwardEvents()
位于Microsoft.VisualStudio.DesignTools.Utility.Events.Suspender.SuspendDisposer.Dispose(布尔处理)
在Microsoft.VisualStudio.DesignTools.Utility.Events.Suspender.SuspendDisposer.Dispose()中
在Microsoft.VisualStudio.DesignTools.Designer.Assemblys.AssemblyCollection.AssemblyService\u AssemblysUpdated(对象发送方,EventArgs`1 e)
在Microsoft.VisualStudio.DesignTools.Designer.Assemblys.AssemblyService.OnAssemblysUpdate上(IEnumerable`1 assemblyInformation)
在Microsoft.VisualStudio.DesignTools.Designer.Assemblys.AssemblyService.RefreshDesignerCaches()上
位于Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.SetIterationContext(字符串[]路径)
在Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.SynchronizedDesignerContext()上
位于Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.ProcessShadowCopyResults(IEnumerable`1结果)
在Microsoft.VisualStudio.DesignTools.Designer.Assemblys.AssemblyService.FlushShadowCopyUpdateQueue()上
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调、对象参数、Int32 numArgs)
位于System.Windows.Threading.ExceptionWrapper.TryCatchWhen(对象源、委托回调、对象参数、Int32 numArgs、委托catchHandler)
在System.Windows.Threading.DispatcherOperation.InvokeImpl()中
位于System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(对象状态)
位于System.Threading.ExecutionContext.RunInternal(ExecutionContext ExecutionContext、ContextCallback回调、对象状态、布尔值preserveSyncCtx)
在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态,布尔保存SyncCTX)
在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态)
在System.Windows.Threading.DispatcherOperation.Invoke()中
在System.Windows.Threading.Dispatcher.ProcessQueue()中
位于System.Windows.Threading.Dispatcher.WndProcHook(IntPtr-hwnd、Int32-msg、IntPtr-wParam、IntPtr-lParam、Boolean和handled)
在MS.Win32.HwndWrapper.WndProc(IntPtr-hwnd、Int32-msg、IntPtr-wParam、IntPtr-lParam、Boolean和handled)
在MS.Win32.HwndSubclass.DispatcherCallbackOperation(对象o)上
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调、对象参数、Int32 numArgs)
位于System.Windows.Threading.ExceptionWrapper.TryCatchWhen(对象源、委托回调、对象参数、Int32 numArgs、委托catchHandler)
位于System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority优先级、TimeSpan超时、委托方法、对象参数、Int32 numArgs)
位于MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd、Int32 msg、IntPtr wParam、IntPtr lParam)
位于MS.Win32.unsafentivemethods.DispatchMessage(MSG&MSG)
位于System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame框架)
在System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame框架)上
位于System.Windows.Application.RunDispatcher(对象忽略)
位于System.Windows.Application.RunInternal(窗口)
在System.Windows.Application.Run(窗口)中
在Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.RunApplication()中
位于Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider.AppContainerDesignerProcessRun(字符串[]activationContextArgs)
在Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider.c__DisplayClass3_0.b__0()中
位于System.Threading.ThreadHelper.ThreadStart\u上下文(对象状态)
位于System.Threading.ExecutionContext.RunInternal(ExecutionContext ExecutionContext、ContextCallback回调、对象状态、布尔值preserveSyncCtx)
at系统。Threa
System.ArgumentNullException
Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.Remove(TKey key)
   at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.WindowsRuntimeContext.UnregisterDynamicType(Type dynamicType)
   at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.UnregisterDynamicType(Type dynamicType)
   at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.MockTypeGenerator.Reset()
   at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.XamlProjectMetadata.OnTypesInvalidatedInternal(IList`1 invalidatedAssemblies)
   at Microsoft.VisualStudio.DesignTools.Platform.Metadata.TypeResolver.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.XamlProjectMetadata.OnAssemblyCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Microsoft.VisualStudio.DesignTools.Designer.Project.ProjectAssemblyCollection.FireChangedEvent(NotifyCollectionChangedEventArgs eventArguments)
   at Microsoft.VisualStudio.DesignTools.Designer.Project.ProjectAssemblyCollection.AssemblyCollection_EnumerationChanged(Object sender, EnumerationChangedEventArgs`1 e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Microsoft.VisualStudio.DesignTools.Utility.Collections.NotifyingCollectionBase`1.EventInvoker(EnumerationChangedEventArgs`1 eventArguments)
   at Microsoft.VisualStudio.DesignTools.Utility.Events.SuspendingEventManager`1.ForwardEvents()
   at Microsoft.VisualStudio.DesignTools.Utility.Events.Suspender.SuspendDisposer.Dispose(Boolean disposing)
   at Microsoft.VisualStudio.DesignTools.Utility.Events.Suspender.SuspendDisposer.Dispose()
   at Microsoft.VisualStudio.DesignTools.Designer.Assemblies.AssemblyCollection.AssemblyService_AssembliesUpdated(Object sender, EventArgs`1 e)
   at Microsoft.VisualStudio.DesignTools.Designer.Assemblies.AssemblyService.OnAssembliesUpdated(IEnumerable`1 assemblyInformation)
   at Microsoft.VisualStudio.DesignTools.Designer.Assemblies.AssemblyService.RefreshDesignerCaches()
   at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.SetIterationContext(String[] paths)
   at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.SynchronizeDesignerContext()
   at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.ProcessShadowCopyResults(IEnumerable`1 results)
   at Microsoft.VisualStudio.DesignTools.Designer.Assemblies.AssemblyService.FlushShadowCopyUpdateQueue()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.RunApplication()
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider.AppContainerDesignerProcessRun(String[] activationContextArgs)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider.<>c__DisplayClass3_0.<applicationView_Activated>b__0()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()