我正在使用 Silverlight 工具包ListBoxDragDropTarget并在使用动态添加列表时遇到错误。我正在将包含列表的用户控件动态添加到布局网格中。当我在网格中将一个项目从一个列表拖到另一个列表时,我得到以下异常。
在 MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)\n
在 MS.Internal.XcpImports.MethodPack 处抛出新错误(“Silverlight 2 应用程序值中的未处理错误不在预期范围内。(IntPtr objectPtr, String methodName, Object[] rawData)\n 在 MS.Internal.XcpImports.Collection_Insert[T](PresentationFrameworkCollection1 collection, Int32 index, Object value)\n at System.Windows.PresentationFrameworkCollection
1.InsertImpl(Int32 index, Object value)\n 在 System.Windows.Controls.ItemCollection.InsertImpl( Int32 索引,对象值)\n 在 System.Windows.Controls.ItemCollection.InsertInternal(Int32 索引,对象值)\n 在 System.Windows.PresentationFrameworkCollection`1.Insert(Int32 索引,T 值)\n 在 System.Windows .Controls.ItemsControlExtensions.InsertItem(ItemsControl that, Int32 index, Object item)\n
……