2011-04-01 24 views
1

我知道這已經過很多次討論,但我已經瀏覽了互聯網上的所有帖子,沒有任何幫助解決我的問題。AllowDrop * DragDropTarget在最新的Silverlight工具包中不可用4

我正在使用PanelDragDropTarget,但無法在我的xaml中使用AllowDrop屬性時生成它。我當然註冊的兩個命名空間,但仍然得到以下錯誤:

The property 'AllowDrop' does not exist on the type 'PanelDragDropTarget' in the XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit'. C:\MainPage.xaml

The property 'AllowDrop' does not exist on the type 'PanelDragDropTarget' in the XML namespace 'clr-namespace:Microsoft.Windows;assembly=System.Windows.Controls.Toolkit'. c:\MainPage.xaml

引用的工具包庫的4.0.5.0版本,我也引用Toolkit.Internals。我正在使用VS 2008.

回答

0

聽起來像你實際上在Silverlight 3中工作而不是4. AllowDrop是在Silverlight 4中添加的UIElement的屬性。它與主機系統和主機系統之間的文件列表的拖放有關Silverlight的。它與工具箱提供的DragDrop框架無關,該工具箱側重於Silverlight中元素的拖動。

您應該改爲處理PanelDragDropTargetDragEnter事件,並將您的首選值指定給Effects該事件中的eventargs。

相關問題