我正在将我编写的WinForms应用程序转换为UWP,据我所知,拖放功能略有不同。以下是我从WinForms应用程序中获取“拖动”对象的代码,它是一个名为FunctionButton的控件;
private void flowLayoutPanel_ActiveGroup_DragDrop(object sender, DragEventArgs e)
{
Function_Button draggedItem;
/* Check if the dragged item is one of the allowed dragged item TYPES. */
draggedItem = (Function_Button)e.Data.GetData(type);
if (draggedItem != null)
{
//DO STUFF
}
}
我目前正在设置自己的StringDataFormats,以便在拖动开始时收集所需信息,然后使用DataView.GetDataAsync()来读取它们。但是在UWP中,如何直接访问已拖动的UIElement对象?