Caliburn.Micro Drag&在WPF中删除文件 [英] Caliburn.Micro Drag & Drop of a File in a WPF
本文介绍了Caliburn.Micro Drag&在WPF中删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< TextBox Name =Relatorio
宽度=612Margin =1
AllowDrop =True
cal:Message.Attach =[Event Drop] = [Action DropQ($ eventArgs)];
[Event DragOver] = [Action DragQ($ eventArgs)]>
有什么建议吗?
解决方案
解决方案
< TextBox Name =Relatorio
Width = 612Margin =1
AllowDrop =True
cal:Message.Attach =[Event Drop] = [Action FileDropped($ eventArgs)];
[Event PreviewDragOver] = [Action FilePreviewDragEnter($ eventArgs)]/>
public void FilePreviewDragEnter(DragEventArgs e)
{
e.Handled = true;
}
public void FileDropped(DragEventArgs e)
{
}
I Have create and desktop application with Caliburn.Micro (2.0.1) and now I need to add a drag&drop behavior, the user will drag a file from the Windows Explorer and I need to get the path of it, however I´m searching for 2 days now and I don´t found any example or explanation of how to add a Drag&Drop behavior for the Caliburn.Micro. I found a question about it (Drag and Drop Files into WPF with Caliburn Micro Framework) but that don´t workout. I have tried a lot of different maners but now sucess, my list try was this:
<TextBox Name="Relatorio"
Width="612" Margin="1"
AllowDrop="True"
cal:Message.Attach="[Event Drop] = [Action DropQ($eventArgs)];
[Event DragOver] = [Action DragQ($eventArgs)]">
Any suggestions at all?
解决方案
Solution,
<TextBox Name="Relatorio"
Width="612" Margin="1"
AllowDrop="True"
cal:Message.Attach="[Event Drop] = [Action FileDropped($eventArgs)];
[Event PreviewDragOver] = [Action FilePreviewDragEnter($eventArgs)]"/>
public void FilePreviewDragEnter(DragEventArgs e)
{
e.Handled = true;
}
public void FileDropped(DragEventArgs e)
{
}
这篇关于Caliburn.Micro Drag&在WPF中删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文