1
Vote

DropSource/DropTarget in FloatableWindow

description

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

comments