终端一体化运控平台
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

55 wiersze
1.5 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace BPASmart.UserManagement
  17. {
  18. /// <summary>
  19. /// MainControl.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class MainControl : UserControl
  22. {
  23. public MainControl()
  24. {
  25. InitializeComponent();
  26. ActionManage.GetInstance.Register(new Action<object>((o) => {
  27. if (o == null)
  28. {
  29. return;
  30. }
  31. if (o == string.Empty)
  32. {
  33. mainContent.Content = null;
  34. return;
  35. }
  36. if (o is string pageName)
  37. {
  38. Type type = Type.GetType($"BPASmart.UserManagement.View.{pageName}");
  39. if (type == null) { return; }
  40. ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes);
  41. mainContent.Content = (FrameworkElement)cti.Invoke(null);
  42. }
  43. }), "ChangeMianContent");
  44. }
  45. private void NewUser_Click(object sender, RoutedEventArgs e)
  46. {
  47. ActionManage.GetInstance.Send("ChangeMianContent", "AddNewUser");
  48. }
  49. }
  50. }