Silverlight Toolkit ListBoxDragTarget Only One Way

Posted by Tom Allen on Stack Overflow See other posts from Stack Overflow or by Tom Allen
Published on 2010-03-08T12:41:56Z Indexed on 2010/05/16 22:30 UTC
Read the original article Hit count: 358

I've got a Silverlight 3 app that has two ListBoxes that I need to be able to drag items between. I've got the toolkit control working so that I can drag from ListBox lbA to ListBox lbB but i then can't drag the item from lbB back to lbA.

<toolkit:ListBoxDragDropTarget mswindows:DragDrop.AllowDrop="True">
    <ListBox x:Name="lbA" Style="{StaticResource ListBoxStyle}">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding DisplayMember}"/>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</toolkit:ListBoxDragDropTarget>

<toolkit:ListBoxDragDropTarget mswindows:DragDrop.AllowDrop="True">
    <ListBox x:Name="lbB" Style="{StaticResource ListBoxStyle}" Width="350">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding DisplayMember}"/>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</toolkit:ListBoxDragDropTarget>

I'm binding lbA to an ObservableCollection of MyObject items which is a parent class for objects MyObjectA and MyObjectB (and there is a mix of ChildObjectA and ChildObjectB items). Is the one way behaviour I'm seeing due to binding to a collection MyObjects or something else i'm missing?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about toolkit