终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

79 rader
2.3 KiB

  1. using BPASmartClient.Helper;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Reflection;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace BPASmart.UserManagement
  18. {
  19. /// <summary>
  20. /// Interaction logic for MainWindow.xaml
  21. /// </summary>
  22. public partial class MainWindow : Window
  23. {
  24. public MainWindow()
  25. {
  26. InitializeComponent();
  27. this.br.MouseLeftButtonDown += (o, e) =>
  28. {
  29. if (e.ClickCount > 1)
  30. {
  31. if (this.WindowState == WindowState.Maximized)
  32. this.WindowState = WindowState.Normal;
  33. else if (this.WindowState == WindowState.Normal)
  34. this.WindowState = WindowState.Maximized;
  35. }
  36. };
  37. ActionManage.GetInstance.Register(new Action<object>((o) => {
  38. if (o == null)
  39. {
  40. return;
  41. }
  42. if(o == string.Empty)
  43. {
  44. mainContent.Content = null;
  45. return;
  46. }
  47. if(o is string pageName)
  48. {
  49. Type type = Type.GetType($"BPASmart.UserManagement.View.{pageName}");
  50. if (type == null) { return; }
  51. ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes);
  52. mainContent.Content = (FrameworkElement)cti.Invoke(null);
  53. }
  54. }), "ChangeMianContent");
  55. }
  56. private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  57. {
  58. this.DragMove();
  59. }
  60. private void Button_Click(object sender, RoutedEventArgs e)
  61. {
  62. this.Close();
  63. }
  64. private void NewUser_Click(object sender, RoutedEventArgs e)
  65. {
  66. ActionManage.GetInstance.Send("ChangeMianContent", "AddNewUser");
  67. }
  68. }
  69. }