DragSource/DragTarget in Floatable Window

Sep 14, 2009 at 11:31 PM

I just noticed I added this as an issue instead of a discussion item.  I moved it here but cannot remove it from the issue tracker, so feel free to remove that so we can discuss here.

I am trying to get drag/drop working between different FloatableWindow Controls. (Tim Heuer's modification of the ChildControl - http://floatablewindow.codeplex.com/). When I attempt this, I am getting an InvalidCastError. I am assuming this is probably due to it being within something other than a UserControl. For example:

<controls:FloatableWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=FloatableWindow"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dd="clr-namespace:SL_Drag_Drop_BaseClasses;assembly=SL_Drag_Drop_BaseClasses"
mc:Ignorable="d"
xmlns:local="clr-namespace:SilverTasksDragDropPOC"
x:Class="SilverTasksDragDropPOC.TaskList"
Title="FloatableWindow2"
Loaded="FloatableWindow_Loaded"
SizeChanged="FloatableWindow_SizeChanged">
<Canvas HorizontalAlignment="Stretch" x:Name="FloatableWindow2_LayoutRoot" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Width="Auto" Height="Auto" >

<ListBox Name="tasks" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
<ListBox.ItemTemplate>
<DataTemplate>
<dd:DragSource DragHandleMode="FullDragSource" AllDropTargetsValid="true">

</dd:DragSource>
</DataTemplate>
</ListBox.ItemTemplate>

</ListBox>
</Canvas>
</controls:FloatableWindow>

Any help is appreciated. Thanks!
Bob

Coordinator
Sep 21, 2009 at 8:50 PM

Hello,

 

I haven't checked this (haven't used the FloatableWindow), but using the Drag/Drop classes on something else than a UserControl shouldn't be a problem, normally speaking.  Will check this out when I find the time.

 

Regards,
Kev