Reputation: 1
I have a VariableSizeWrapGrid and custom drag/drop handling logic. I need to remove (or collapse) the item when it began being dragged. VariableSizeWrapGrid's dataSource is ObservableCollection.
Collapsing (Visibility=Collapsed
) an item does not work: it becomes invisible, but occupies its original space anyway. Invalidating VariableSizeWrapGrid does not get rid of these spaces.
Removing an item does not work because dragging process is aborted by some unknown reasons when i'm removing dragged item from its original source. Removing any other items does not abort dragging. I've overridden void OnItemsChanged(object e)
with empty handler (not calling base version), but this does not help too.
Short code sample:
void VariableGridView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
{
var tile = e.Items[0] as Tile;
tile.removeFromOwnerContainer(); // this line interrupts dragging
}
Upvotes: 0
Views: 135