终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

79 lines
3.2 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using BPASmart.Model;
  7. using Microsoft.Toolkit.Mvvm.Input;
  8. using System.Collections.ObjectModel;
  9. using System.Windows.Forms;
  10. using System.IO;
  11. using BPA.Helper;
  12. using System.Diagnostics;
  13. using BeDesignerSCADA;
  14. using BeDesignerSCADA.Controls;
  15. using System.Windows;
  16. using System.Reflection;
  17. using System.Collections.Concurrent;
  18. using System.IO.Pipes;
  19. using BPA.Communication;
  20. using System.Threading;
  21. using BeDesignerSCADA.ViewModel;
  22. namespace BPASmart.ConfigurationSoftware
  23. {
  24. public class MainWindowViewModel : NoticeBase
  25. {
  26. public MainWindowViewModel()
  27. {
  28. NewProjectCommand = new RelayCommand(() => { ServiceCenter.GetInstance.OpenNewProjectWindow(); });
  29. NewPageCommand = new RelayCommand(() => { ServiceCenter.GetInstance.OpenNewPageWindow(); });
  30. OpenVarManagerCommand = new RelayCommand(() => { ServiceCenter.GetInstance.OpenVariableManagerTool(); });
  31. SelectedPageCommand = new RelayCommand<object>((o) => { ServiceCenter.GetInstance.SelectedPage(o); });
  32. SaveProjectCommand = new RelayCommand(() => { ServiceCenter.GetInstance.ProjectSave(); });
  33. GengrateCommand = new RelayCommand(() => { ServiceCenter.GetInstance.ApplicationBale(); });
  34. RemovePageCommand = new RelayCommand<object>((o) => { ServiceCenter.GetInstance.RemovePageCommand(o); });
  35. ReNameCommand = new RelayCommand<object>((o) => { ServiceCenter.GetInstance.ReNameCommand(o); });
  36. SetStartPageCommand = new RelayCommand<object>((o) => { ServiceCenter.GetInstance.SetStartPageCommand(o); });
  37. ServiceCenter.GetInstance.PageChange = new Action<FrameworkElement>((f) => { MainContent = f; });
  38. ServiceCenter.GetInstance.ProjectNameChange = new Action<string>((s) => { Head = s; });
  39. mainCanvasPanels = ServiceCenter.GetInstance.mainCanvasPanels;
  40. Pages = ServiceCenter.GetInstance.Pages;
  41. Message = ServiceCenter.GetInstance.Message;
  42. ServiceCenter.GetInstance.Init();
  43. }
  44. public RelayCommand NewProjectCommand { get; set; }
  45. public RelayCommand OpenVarManagerCommand { get; set; }
  46. public RelayCommand<object> SelectedPageCommand { get; set; }
  47. public RelayCommand SaveProjectCommand { get; set; }
  48. public RelayCommand NewPageCommand { get; set; }
  49. public RelayCommand GengrateCommand { get; set; }
  50. public RelayCommand<object> RemovePageCommand { get; set; }
  51. public RelayCommand<object> SetStartPageCommand { get; set; }
  52. public RelayCommand<object> ReNameCommand { get; set; }
  53. public string Head { get { return _mHead; } set { _mHead = value; OnPropertyChanged(); } }
  54. private string _mHead;
  55. public FrameworkElement MainContent { get { return _mMainContent; } set { _mMainContent = value; OnPropertyChanged(); } }
  56. private FrameworkElement _mMainContent;
  57. public List<MainCanvasPageModel> mainCanvasPanels { get; set; }
  58. public ObservableCollection<string> Pages { get; set; }
  59. public ObservableCollection<string> Message { get; set; }
  60. }
  61. }