2013-04-17 77 views
2

我們正在研究支持標籤的SUR40應用程序。但是有時候我們在TagVisualizationHostAdapter移動一個標籤時遇到一個奇怪且難以重現的崩潰。我們有一個作爲TagVisualizationHost的ScatterView。Surface SDK TagVisualizationHostAdapter內部崩潰

堆棧跟蹤下方。任何人的想法?

THX,

馬騰

System.ArgumentNullException: Value cannot be null. Parameter name: visualization 

at Microsoft.Surface.Presentation.Controls.TagVisualizationHostAdapter.NotifyVisualizationMoved(TagVisualization visualization, Point center, Double orientation, UIElement relativeTo) 
at Microsoft.Surface.Presentation.Controls.ScatterViewTagVisualizationHostAdapter.OnContainerMoved(ScatterViewItem container, Point containerCenter, Double containerOrientation) 
at Microsoft.Surface.Presentation.Controls.ScatterViewTagVisualizationHostAdapter.OnContainerPositionChanged(ScatterContentControlBase item) 
at Microsoft.Surface.Presentation.Controls.ScatterContentControlBase.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) 
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) 
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) 
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) 
at Microsoft.Surface.Presentation.Controls.ScatterContentControlBase.OnManipulationDeltaPrivate(ManipulationDeltaEventArgs e) 
at Microsoft.Surface.Presentation.Controls.ScatterContentControlBase.OnManipulationDelta(ManipulationDeltaEventArgs e) 
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) 
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) 
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) 
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) 
at System.Windows.Input.InputManager.ProcessStagingArea() 
at System.Windows.Input.ManipulationDevice.ProcessManipulationInput(InputEventArgs e) 
at System.Windows.Input.ManipulationLogic.OnInertiaTick(Object sender, EventArgs e) 
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused) 
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 
at System.Windows.Threading.DispatcherOperation.InvokeImpl() 
at System.Threading.ExecutionContext.runTryCode(Object userData) 
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) 
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) 
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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) 
at System.Windows.Threading.Dispatcher.InvokeImpl(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.Application.RunInternal(Window window) 
at System.Windows.Application.Run() 
at MaterialSource.App.Main() 

回答

0

我知道這是一個古老的職位,但我今天在這個同樣的錯誤下降。 我已經測試了一些,在我看來,錯誤與標籤和表面之間的不正確接觸有關。在我的情況下,如果我的代碼仍在VisualizationAdded事件處理程序中時移動或移除標記,似乎就會發生。 如果在你身邊,你找到了另一個原因,你可能想在這裏分享它? Thx Julien