Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WPF拖放_Wpf_Vb.net_Drag And Drop - Fatal编程技术网

WPF拖放

WPF拖放,wpf,vb.net,drag-and-drop,Wpf,Vb.net,Drag And Drop,如何为WPF应用程序实现拖放?我可以打开两个相同的应用程序,将一个对象从一个拖动到另一个。下面是我要拖动的内容: 你好,世界 网格在另一个应用程序中的外观必须与从中拖动的网格相同。有解决方案吗?我过去成功地使用过拖放解决方案,这是一个非常容易使用的DLL。您可以在这里看到它的一个小示例:我过去成功地使用了拖放解决方案,这是一个非常容易使用的DLL。您可以在这里看到它的一个小示例:示例WPF拖放:使用vb.net 2010 <Window xmlns="h

如何为WPF应用程序实现拖放?我可以打开两个相同的应用程序,将一个对象从一个拖动到另一个。下面是我要拖动的内容:


你好,世界

网格在另一个应用程序中的外观必须与从中拖动的网格相同。有解决方案吗?

我过去成功地使用过拖放解决方案,这是一个非常容易使用的DLL。您可以在这里看到它的一个小示例:

我过去成功地使用了拖放解决方案,这是一个非常容易使用的DLL。您可以在这里看到它的一个小示例:

示例WPF拖放:使用vb.net 2010

        <Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="mofakfree"
        Title="drop test " Height="359" Width="329">
        <Grid>
                <Label x:Name="label2" AllowDrop="True"  Margin="159,30,12,0" Background="#FF1900FF" Content="To Here" DragEnter="label2_DragEnter" Drop="label2_Drop" Height="51" VerticalAlignment="Top" />
                <Label x:Name="label1" AllowDrop="True"  Margin="26,30,158,240" Background="#FFDE2626" Content="source" MouseDown="label1_MouseDown"/>
        </Grid>
        </Window>

示例WPF拖放:使用vb.net 2010

        <Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="mofakfree"
        Title="drop test " Height="359" Width="329">
        <Grid>
                <Label x:Name="label2" AllowDrop="True"  Margin="159,30,12,0" Background="#FF1900FF" Content="To Here" DragEnter="label2_DragEnter" Drop="label2_Drop" Height="51" VerticalAlignment="Top" />
                <Label x:Name="label1" AllowDrop="True"  Margin="26,30,158,240" Background="#FFDE2626" Content="source" MouseDown="label1_MouseDown"/>
        </Grid>
        </Window>
使用行为:

您需要这样的标记:

<Window xmlns:i=
"clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:custom=
"clr-namespace:CustomBehaviorsLibrary;assembly=CustomBehaviorsLibrary >
使用行为:

您需要这样的标记:

<Window xmlns:i=
"clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:custom=
"clr-namespace:CustomBehaviorsLibrary;assembly=CustomBehaviorsLibrary >