Thank you very much for making such a terrific and useful component open and free to use. I'm using this as the basis for my first Silverlight project, and so far it's been tremendously helpful. Again, thank you.
I have a couple of questions, however...
1) I have two lists; one list I'll call the "source pool" and the other I'll call the "target pool". What I'm attempting is that when an item is dragged from the source pool and dropped in the target pool it is not removed from the source.
The animations, ghosts, etc. can stay (and are preferable), but I'd like for the item from the source pool to essentially "copy" into the target pool, not completely move over (and thus be removed from the source pool list).
2) At run-time I'm dynamically adding droptargets to the target pool. For some reason, when I attempt to drop an item into one of the bottom targets in the target pool it moves to the one above it. I'm thinking maybe I'm having an indexing issue (see below)?
2a) When the page first loads it goes out and retrieves a list of items from a database. We'll call these Containers; a list of Containers. It dynamically populates an Accordion control with this list, and within each AccordionItem it's creating a stack panel
that will hold drop targets.
void dataService_GetContainersCompleted(object sender, SilverlightPipelineConfiguration.DataSource.GetContainersCompletedEventArgs e)
AccordionContainer.Loaded += new RoutedEventHandler(AccordionContainer_Loaded);
Collection allContainers = e.Result;
for (int i = 0; i < allContainers.Count; i++)
AccordionItem item = new AccordionItem();
StackPanel sp = new StackPanel();
sp.Height = 250;
sp.Name = "StackPanel" + i;
item.Content = sp;
2b) For each container I'm adding a single drop target into the stack panel I created previously once the accordion control has finished populating (shown previously):
void AccordionContainer_Loaded(object sender, RoutedEventArgs e)
for (int i = 0; i < AccordionContainer.Items.Count; i++)
AccordionItem item = AccordionContainer.ItemContainerGenerator.ContainerFromIndex(i) as AccordionItem;
if (item != null)
DropTarget dt = new DropTarget()
Ghost = new DropTargetGhost()
object itemNode = item.FindName("StackPanel" + i);
if (itemNode is StackPanel)
StackPanel itemStack = itemNode as StackPanel;
But when I attempt to move an item from the source pool to one of the targets it's automatically trying to put it into the target before it. Very strange.
I'm hoping you can give me some pointers on how I might accomplish what I'm after, and I'd love to share with the rest of the community.
Thank you kindly in advance!