Hi all,
I chose to use EnableNativeDrag to get around another bug I was having with the drag/drop (was giving me errors regarding my layout not wrapped in adorners layer, and someone suggested to use native drag). However, my OnDropInfo code, which was working previously, is now not executing the block when drop status is DropComplete.
More info:
I did RadDragAndDropManager.EnableNativeDrag = true in my drag source. The drag source is a RadTreeView and drop target is a RadChart.
Drag code:
I chose to use EnableNativeDrag to get around another bug I was having with the drag/drop (was giving me errors regarding my layout not wrapped in adorners layer, and someone suggested to use native drag). However, my OnDropInfo code, which was working previously, is now not executing the block when drop status is DropComplete.
More info:
I did RadDragAndDropManager.EnableNativeDrag = true in my drag source. The drag source is a RadTreeView and drop target is a RadChart.
Drag code:
private void OnDragQueryHandler(object sender, DragDropQueryEventArgs e){ if (e.Options.Status == DragStatus.DragQuery) { RadTreeViewItem item = e.OriginalSource as RadTreeViewItem; ContentControl cue = new ContentControl(); cue.ContentTemplate = this.Resources["ApplicationDragTemplate"] as DataTemplate; cue.Content = new TextBlock() { Padding = new Thickness(5), Background = new SolidColorBrush(Colors.LightBlue), FontSize = 12 }; if (item.Item is CustomItem) { // do stuff } else { e.QueryResult = false; return; } e.Options.DragCue = cue; } e.QueryResult = true;}private void OnDragInfoHandler(object sender, DragDropEventArgs e){ if (e.Options.Status == DragStatus.DragComplete) { // do stuff }}
And drop code:
private void OnDropQueryHandler(object sender, DragDropQueryEventArgs e)
{
var payload = e.Options.Payload;
e.QueryResult = payload is CustomItem;
}
private void OnDropInfoHandler(object sender, DragDropEventArgs e)
{
if (e.Options.Status == DragStatus.DropPossible)
{
UI_RadChart.BorderBrush = WPConstants.DRAG_BRUSH;
}
else
{
UI_RadChart.BorderBrush = null;
}
if (e.Options.Status == DragStatus.DropComplete)
{
// DO STUFF, NOT REACHING HERE
}
}