C# DragDropTarget中的ItemDroppedOnTarget应具有目标元素
我正在使用C# DragDropTarget中的ItemDroppedOnTarget应具有目标元素,c#,silverlight,drag-and-drop,silverlight-5.0,silverlight-toolkit,C#,Silverlight,Drag And Drop,Silverlight 5.0,Silverlight Toolkit,我正在使用Silverlight Toolkit中的DragDropListBoxTarget控件来支持拖放行为。但是我面临着这个控制的问题 很难找到项目被丢弃的目标元素。在ItemDroppedOnTarget事件参数中必须包含这样的内容 当我拖动一个项目时,我需要在用户拖放它时,一个中间事件应该修改目标项目。但是我找不到实现它的方法 我是否使用了正确的控件,或者我还有其他选择吗?我也有同样的问题。我最终使用了。我重新编译了Silverlight 5的源代码。它让我知道目标。我也很懒,仍然想要
Silverlight Toolkit
中的DragDropListBoxTarget
控件来支持拖放行为。但是我面临着这个控制的问题
很难找到项目被丢弃的目标元素。在ItemDroppedOnTarget事件参数中必须包含这样的内容
当我拖动一个项目时,我需要在用户拖放它时,一个中间事件应该修改目标项目。但是我找不到实现它的方法
我是否使用了正确的控件,或者我还有其他选择吗?我也有同样的问题。我最终使用了。我重新编译了Silverlight 5的源代码。它让我知道目标。我也很懒,仍然想要在使用工具箱DragDropTarget控件时拖动的任何东西的ghost drag图片,所以我将我的源代码包装在其中,也包装在新的拖放工具中 我定义拖动的方式:
<toolkit:ListBoxDragDropTarget AllowedSourceEffects="Copy">
<ListBox ItemsSource="{Binding Path=UnitOfWork.Templates}" Width="130" Height="360" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<dd:DragSource>
<TextBlock Text="{Binding Path=Name}" Width="120"/>
</dd:DragSource>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</toolkit:ListBoxDragDropTarget>
<dd:DropTarget Grid.Row="2" AllowDrop="True" OnDropped="Target_OnDropped">
<Border BorderBrush="Black" BorderThickness="1" Width="98" Height="30">
<TextBlock Text="Drop Here" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</dd:DropTarget>
这种方式保留了ListBoxDragDropTarget创建的拖动重影,同时允许我使用dd:DragSource和dd:DropTarget控件来允许更细粒度的拖放。我也遇到了同样的问题。我最终使用了。我重新编译了Silverlight 5的源代码。它让我知道目标。我也很懒,仍然想要在使用工具箱DragDropTarget控件时拖动的任何东西的ghost drag图片,所以我将我的源代码包装在其中,也包装在新的拖放工具中 我定义拖动的方式:
<toolkit:ListBoxDragDropTarget AllowedSourceEffects="Copy">
<ListBox ItemsSource="{Binding Path=UnitOfWork.Templates}" Width="130" Height="360" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<dd:DragSource>
<TextBlock Text="{Binding Path=Name}" Width="120"/>
</dd:DragSource>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</toolkit:ListBoxDragDropTarget>
<dd:DropTarget Grid.Row="2" AllowDrop="True" OnDropped="Target_OnDropped">
<Border BorderBrush="Black" BorderThickness="1" Width="98" Height="30">
<TextBlock Text="Drop Here" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</dd:DropTarget>
这样可以保留ListBoxDragDropTarget创建的拖动重影,同时允许我使用dd:DragSource和dd:DropTarget控件来允许更细粒度的拖放