I have a list box that drops an item onto a treeView. The TreeView is bound to a List<> and has a two level template. The Item is dropped on the top level items and need the item to expand when the new item is dropped on it.
The listBox is the source and i have added some clunky Refresh() to get both ItemsSources to update and show the changes. I know i am doing this wrong, but the tree branch still does not expand on drop.
Any help would be great!
Thanks,
Brian
private
void
OnDropInfo(
object
sender, DragDropEventArgs e)
{
if
(e.Options.Status == DragStatus.DropComplete)
{
ListBoxItem item = e.Options.Source
as
ListBoxItem;
DeviceApp payload = item.Content
as
DeviceApp;
freeApps.Remove(payload);
appList.UnselectAll();
appList.ItemsSource = freeApps;
stationTree.ItemsSource = stations;
appList.Items.Refresh();
stationTree.Items.Refresh();
}
}
The listBox is the source and i have added some clunky Refresh() to get both ItemsSources to update and show the changes. I know i am doing this wrong, but the tree branch still does not expand on drop.
Any help would be great!
Thanks,
Brian