58 lines
1.2 KiB
C#
58 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace Main.Test
|
|
{
|
|
/// <summary>
|
|
/// MainHeaderImageContent.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class MainHeaderImageContent : UserControl
|
|
{
|
|
public MainHeaderImageContent()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
private void IndicatorItem_PreviewMouseDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
e.Handled = true;
|
|
TryDragMove();
|
|
}
|
|
|
|
private void TimeItem_PreviewMouseDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
e.Handled = true;
|
|
TryDragMove();
|
|
}
|
|
|
|
private void TryDragMove()
|
|
{
|
|
Window window = Application.Current?.MainWindow;
|
|
if (window is null)
|
|
{
|
|
return;
|
|
}
|
|
try
|
|
{
|
|
//if (window.WindowState == WindowState.Maximized)
|
|
//{
|
|
// window.WindowState = WindowState.Normal;
|
|
//}
|
|
window.DragMove();
|
|
}
|
|
catch { }
|
|
}
|
|
}
|
|
}
|