c# - How to AllowDrop only for specific types? -


i use librarybar display items have relationship. since there different relationships between items, have multiple containers. default setting if set allowdrop true librarybar, possible drag elements librarybar, , items added collection dropped.

now don't want that. don't want possible drag item 1 librarybar another. can't set allowdrop false, because want drag tagvisualizations librarybar.

so defined in method handles dropevents:

public void ontargetdrop(object sender, surfacedragdropeventargs e)         {             //only if tagvisualization             if (e.cursor.data image)             {                 ((sender librarybar).tag isourcefile).unexpand();                 e.handled = true;             }             else             {                 //todo: cancel drag&drop             }         } 

as can see allow drops if cursor's data image (and therefore tagvisualization). works, no longer possible drop item librarybar librarybar. animation played if item dragged on librarybar still played. how can disable animation specific types?

add event handler dragcompleted event. set handled equal true types want exclude. dragcompletedeventargs have cursor.data property.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -