我有一个Windows Phone 8.1应用程序(WinRT),我有一个gridview,我可以重新排序图像,它工作正常。
在运行Windows 10的手机上使用相同的应用程序无法重新排序项目。
重新排序模式设置正确,图像有点漂浮,就像在WP8.1上一样,但当我删除项目时,没有任何变化。
这是一个已知的错误还是这是一个解决方法,使其工作?
我的代码如下:
<GridView x:Name="GridView"
VerticalAlignment="Top"
Margin="-3"
IsSwipeEnabled="True"
AllowDrop="True"
CanReorderItems="True"
ItemsSource="{Binding ImagesReordered}">
并在代码中
private void EnableReorderMode()
{
this.IsReordering = true;
this.GridView.ReorderMode = ListViewReorderMode.Enabled;
}
修改
尝试使用更简单的代码(仅限xaml):
<GridView AllowDrop="true"
CanReorderItems="true"
ReorderMode="Enabled">
<GridViewItem>
<Rectangle Width="80"
Height="80"
Fill="Red"
Margin="4" />
</GridViewItem>
<GridViewItem>
<Rectangle Width="80"
Height="80"
Fill="Yellow"
Margin="4" />
</GridViewItem>
<GridViewItem>
<Rectangle Width="80"
Height="80"
Fill="Green"
Margin="4" />
</GridViewItem>
</GridView>
在WP 8.1应用程序上,重新排序正在使用WP 8.1,而不是在Windows 10移动版上。 在W10 uwp上,重新排序在Windows 10上正常工作。
答案 0 :(得分:0)
请继续监控该案例,我们会在那里更新任何进展。 ListView和GridView也会出现同样的问题。通过检查内部状态,建议的修复程序将解决来自其基类的两个控件问题。但我仍然不能说这个修复程序何时/如何可用。如果对您有很大的影响,请按照Prashant在该MSDN线程中介绍的说明联系MS支持。
要解决此问题,如果以上信息无法帮助您,您需要自行处理拖放操作。