ConfigWindow.xaml.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. 
  2. using GalaSoft.MvvmLight.Command;
  3. using GeekDesk.Control.UserControls;
  4. using GeekDesk.ViewModel;
  5. using HandyControl.Controls;
  6. using HandyControl.Data;
  7. using System;
  8. using System.Windows;
  9. using System.Windows.Input;
  10. namespace GeekDesk.Control
  11. {
  12. /// <summary>
  13. /// ConfigDialog.xaml 的交互逻辑
  14. /// </summary>
  15. public partial class ConfigWindow
  16. {
  17. public ConfigWindow(AppConfig appConfig)
  18. {
  19. InitializeComponent();
  20. this.DataContext = appConfig;
  21. RightCard.Content = new SettingControl();
  22. this.Topmost = true;
  23. }
  24. /// <summary>
  25. /// 移动窗口
  26. /// </summary>
  27. /// <param name="sender"></param>
  28. /// <param name="e"></param>
  29. private void DragMove(object sender, System.Windows.Input.MouseButtonEventArgs e)
  30. {
  31. if (e.LeftButton == MouseButtonState.Pressed)
  32. {
  33. DragMove();
  34. }
  35. }
  36. /// <summary>
  37. /// 点击关闭按钮
  38. /// </summary>
  39. /// <param name="sender"></param>
  40. /// <param name="e"></param>
  41. private void Close_Button_Click(object sender, RoutedEventArgs e)
  42. {
  43. this.Close();
  44. }
  45. }
  46. }