28 lines
779 B
C#
28 lines
779 B
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
|
|
namespace SWS.CAD.Views.CustomControl
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for customWindowTitleBar.xaml
|
|
/// </summary>
|
|
public partial class customWindowTitleBar : UserControl
|
|
{
|
|
public customWindowTitleBar()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Border_MouseDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
// 将事件传递给父窗口,要求窗口进行拖动
|
|
if (e.ChangedButton == MouseButton.Left)
|
|
{
|
|
var window = Window.GetWindow(this); // 获取父窗口
|
|
window?.DragMove(); // 调用窗口的 DragMove 方法
|
|
}
|
|
}
|
|
}
|
|
}
|