问题描述
我正在使用Windows手机应用程序。我想制作一个列表,其项目可以在水平或垂直的任何地方拖动。列表项是图像类型。
基本上我想要像包含瓷砖的Windows手机主页一样。当我们持有瓷砖一段时间它会弹出并可以拖动到页面的任何位置。
请帮助我紧急。
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.
推荐答案
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
2-对于要设置为可拖动的任何XAML对象,请使用以下代码(我的示例是在矩形上):
2- for any XAML object you want to set as drag-able use the following code(my example is on rectangle):
<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
这篇关于如何在Windows手机中制作可拖动的项目列表,如手机的主页瓷砖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!