Click here to Skip to main content
15,889,732 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am working on a windows phone app. I want to make a list whose items are dragable anywhere horizontally or vertically. List items are of image types.

Basically I want this like windows phone main page that contains tiles. When we hold a tile for some time it popups and can be dragable to anywhere in page.
Please help me its urgent.
Posted
Comments
Jeff Blankenburg 26-Feb-13 9:23am    
What have you tried thus far?

1 solution

here is my solution using only XAML:
1- in the headers of the .XAML page
add this reference:
C#
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"


2- for any XAML object you want to set as drag-able use the following code(my example is on rectangle):

XML
<Rectangle Height="104" HorizontalAlignment="Left" Margin="80,90,0,0" Name="rectangle1" Stroke="Black" StrokeThickness="1" VerticalAlignment="Top" Width="124" AllowDrop="False">
               <i:Interaction.Behaviors>
                   <el:MouseDragElementBehavior ConstrainToParentBounds="True"/>
               </i:Interaction.Behaviors>
  </Rectangle>


and now it's your job to implement the hold tap thing and control it in anyway you wish :)

if you found this useful please mark as solution and rate so more people see it

Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900