I have 3 user controls hosted in a main page. I would like to make the user controls draggable within the main page itself. How do I implement them? Currently, this is wat I did:
<ListBox x:Name="allApplicationsBox" BorderThickness="0" telerik:StyleManager.Theme="Metro"
AllowDrop="True" Background="Transparent" BorderBrush="Transparent"
ItemContainerStyle="{StaticResource draggableItemStyle}">
<ListBox.Items>
<ListBoxItem>
<my:TopContainer x:Name="topContainer" Grid.Row="0" HorizontalAlignment="Left" Width="1190" telerik:DragDropManager.AllowDrag="True"/>
</ListBoxItem>
<ListBoxItem>
<my:MiddleContainer x:Name="middleContainer" Grid.Row="1" HorizontalAlignment="Left" Width="1190" telerik:DragDropManager.AllowDrag="True"/>
</ListBoxItem>
<ListBoxItem>
<my:BottomContainer x:Name="bottomContainer" Grid.Row="2" HorizontalAlignment="Left" Width="1190" telerik:DragDropManager.AllowDrag="True"/>
</ListBoxItem>
</ListBox.Items>
</ListBox>
The styles are as follows:
<Style TargetType="ListBoxItem" x:Key="draggableItemStyle">
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Foreground" Value="#000000" />
<Setter Property="telerik:DragDropManager.AllowDrag" Value="True" />
<Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
</Style>
Need some help and guidance on how to make it done, preferrably with some code snippets.
Thanks and regards,
ML