Files
Ayay/SHH.CameraDashboard/MainWindow.xaml.cs

37 lines
973 B
C#
Raw Permalink Normal View History

2026-01-01 22:40:32 +08:00
using System.Windows;
using System.Windows.Controls;
2025-12-30 10:53:02 +08:00
using System.Windows.Input;
namespace SHH.CameraDashboard
{
2026-01-01 22:40:32 +08:00
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
2025-12-30 10:53:02 +08:00
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
2026-01-01 22:40:32 +08:00
private void TitleBar_MouseDown(object sender, MouseButtonEventArgs e)
2025-12-30 10:53:02 +08:00
{
if (e.ChangedButton == MouseButton.Left)
{
2026-01-01 22:40:32 +08:00
DragMove();
}
2025-12-30 10:53:02 +08:00
}
2026-01-01 22:40:32 +08:00
private void BtnTheme_Click(object sender, RoutedEventArgs e)
2025-12-30 10:53:02 +08:00
{
2026-01-01 22:40:32 +08:00
var btn = sender as Button;
if (btn != null && btn.ContextMenu != null)
{
// 设置菜单的目标为当前按钮(防止定位跑偏)
btn.ContextMenu.PlacementTarget = btn;
// 打开菜单
btn.ContextMenu.IsOpen = true;
}
2025-12-30 10:53:02 +08:00
}
}
}