123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using Showlicense.ViewModel;
- using System.Windows;
- using System.Windows.Input;
- namespace Showlicense
- {
- /// <summary>
- /// MainWindow.xaml 的交互逻辑
- /// </summary>
- public partial class MainWindow
- {
- public MainWindow()
- {
- WindowStartupLocation = WindowStartupLocation.CenterScreen;
- InitializeComponent();
- DataContext = new MainWindowViewModel();
- }
- /// <summary>
- /// 关闭按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 鼠标拖动标题栏时整个窗口跟随移动
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Window_MouseMove(object sender, MouseEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Pressed)
- {
- this.DragMove();
- }
- }
- }
- }
|