I have a small test project to check the Drag/Drop feature of RadTreeListView. Markup:
<t:RadTreeListView ItemsSource="{Binding Items}" IsReadOnly="True" IsDragDropEnabled="True" x:Name="tree" AutoGenerateColumns="False">
<t:RadTreeListView.DragCueItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Name}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Children count : "/>
<TextBlock Text="{Binding Children.Count}"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</t:RadTreeListView.DragCueItemTemplate>
<t:RadTreeListView.ChildTableDefinitions>
<t:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
</t:RadTreeListView.ChildTableDefinitions>
<t:RadTreeListView.Columns>
<t:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Nume"/>
</t:RadTreeListView.Columns>
</t:RadTreeListView>
Nothing fancy here... I bind it to a simple hierarchy of Node's and if I drag an item I receive this event in
private static void TreePreviewDragEnded(object sender, RadTreeListViewDragEndedEventArgs e)
{
Debug.WriteLine("DropPosition: " + e.DropPosition);
Debug.WriteLine("IsCanceled: " + e.IsCanceled);
Debug.WriteLine("TargetDropItem: " + (e.TargetDropItem == null ? "<null>" : e.TargetDropItem.ToString()));
Debug.WriteLine("DraggedItems: " + e.DraggedItems);
if (e.DraggedItems.Count > 0)
{
foreach (var item in e.DraggedItems)
{
Debug.WriteLine(" Dragged item : " + item);
}
}
Debug.WriteLine("-----------------");
}
Am I doing something wrong?

FileManager fileManager = new FileManager(diagram);fileManager.SaveToFile(FileLocation.Disk);
I have a ListBox bound to collection of items, which each defines its Command in the ViewModel.
The SelectedItem is Bound to the ViewModel of the ListBox itself with TwoWay-Binding since I need to change Selection from Code.
Short version looks like this.
<telerik:RadListBox ItemsSource="{Binding Items}"
ItemTemplate="{StaticResource ItemTemplate}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
Command="{Binding SelectedItem.Command}"
SelectionMode="Single">
Now I've encountered the problem, that if I set SelectedItem in the ViewModel to 'null', the Item thats just been DeSelected still fires its Command one more time, which I personally would consider a bug.
Also this leads to an interesting behaviour in my app...
Someone any ideas, other than to create an event Handler for Selection changed and fire the Command from CodeBehind?
Any suggestions would be much appreciated.
Thx a bunch.