博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ListViewBase中的CanReorderItems属性
阅读量:4358 次
发布时间:2019-06-07

本文共 958 字,大约阅读时间需要 3 分钟。

最近使用GridView时,想实现Item之间的自由拖动排列,一开始自己写了个Panel,后来才发现自带的API中已经有了这么一个属性CanReorderItems,然而在设置为true之后,不没有能使Item自由排列,google了一下才找到原因。

下面是来自中的解释

But, there are some things you need to know to get it to work. First of all the AllowDrop property also needs to be set to true.

And the grid or list needs to be binded to a ObservableVector (no ObservableCollection is not good enough). But in the developer preview only an interface exists for this collection, so you have to make your own implementation or borrow one.. like  one.

One caveat remains.. the ObservableVector needs to be initialized with object as T, strong types will not work in the developer preview of windows 8. Like so:

简单易懂,就不翻译了=。=

但使用过程中有以下注意点()

  • 如果启用了项目选择,并且将  设置为 false,则用户可以通过鼠标右击来取消选择项目,但是不能通过重击手势,使用触控来取消选择项目。
  • 如果将 CanDragItems 设置为 true,并将  设置为 false,则用户可以用鼠标拖动项目,但不能通过触摸方式。
  • 如果将  设置为 true,并将  设置为 false,则用户可以用鼠标对项目重新排序,但不能通过触摸方式。

转载于:https://www.cnblogs.com/xdshennju/archive/2013/02/19/2917443.html

你可能感兴趣的文章
Nutch系列1:简介
查看>>
前端UI框架选择区别对比推荐
查看>>
栈 队列 和 双向队列
查看>>
从垃圾回收看闭包
查看>>
Intel Core Microarchitecture Pipeline
查看>>
如何去除交叉表的子行(列)的小计?
查看>>
Web字体(链接)嵌入
查看>>
switch… case 语句的用法
查看>>
day07补充-数据类型总结及拷贝
查看>>
语言、数据和运算符
查看>>
正则表达式30分钟入门教程
查看>>
sqlserver try catch·
查看>>
怎么在三维世界里叙述五维故事
查看>>
css技巧
查看>>
代码优化(一)
查看>>
为什么JSP会比Beetl慢
查看>>
移动端rem的用法
查看>>
php-laravel中间件使用
查看>>
myslq 表与表之前的数据转移
查看>>
python学习日志
查看>>