Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将项目从树视图拖动到面板。
树视图项是一个由图像和标签组成的 StackPanel。
将树视图项目拖入 PanelDragDropTarget 时,我应该如何获取标签中的文本?
得到了一些答案,但有点糟糕。
我得到了被拖动的 UIElement 的类型,
if Label 然后获取其内容
如果 Image 然后获取其父级并搜索标签并获取其内容。