UnitViewModel.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using OHV.Module.Interactivity;
  2. using Prism.Commands;
  3. using Prism.Events;
  4. using Prism.Mvvm;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Input;
  11. using VehicleControlSystem;
  12. namespace OHV.Module.MainViews.Views
  13. {
  14. public class UnitViewModel : BindableBase
  15. {
  16. IEventAggregator eventAggregator = null;
  17. VCSystem vcSystem = null;
  18. MessageController msgController = null;
  19. public ICommand ServoConfigCommand { get; set; }
  20. public ICommand InoutPupup { get; set; }
  21. public ICommand BatteryPopup { get; set; }
  22. public UnitViewModel( IEventAggregator _ea , VCSystem _vcSystem , MessageController _msgController )
  23. {
  24. this.eventAggregator = _ea;
  25. this.vcSystem = _vcSystem;
  26. this.msgController = _msgController;
  27. this.ServoConfigCommand = new DelegateCommand( ExecuteServoConfigCommand );
  28. this.InoutPupup = new DelegateCommand( ExecuteInOutCommand );
  29. this.BatteryPopup = new DelegateCommand( ExecuteBatteryCommand );
  30. }
  31. private void ExecuteBatteryCommand( )
  32. {
  33. this.msgController.ShowBatteryPopupView();
  34. }
  35. private void ExecuteInOutCommand( )
  36. {
  37. this.msgController.ShowInOutPopupView();
  38. }
  39. private void ExecuteServoConfigCommand( )
  40. {
  41. this.msgController.ShowServoConfigPopupView();
  42. }
  43. public void Init()
  44. {
  45. }
  46. }
  47. }