【发布时间】:2012-04-29 21:16:20
【问题描述】:
我正在使用
创建一个 WPF/xaml 应用程序WindowStyle="无"
因此我不得不使用
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
// Begin dragging the window
this.DragMove();
使它可以在屏幕上拖动窗口。但是,我也想在我计划使用的窗口中制作可拖动的图像
<Image HorizontalAlignment="Right" Height="65" Width="203" Margin="0,278.271,14.434,82.5" Source="Images/Implementation1.png" Stretch="Fill">
<i:Interaction.Behaviors>
<ei:MouseDragElementBehavior ConstrainToParentBounds="True"/>
</i:Interaction.Behaviors>
</Image>
问题是我不能让它们都在同一个窗口上工作,因为它们只有在另一个被关闭时才能工作。任何帮助将不胜感激。
【问题讨论】:
标签: c# .net wpf xaml drag-and-drop