Simu_TMView.xaml.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using System.Windows.Input;
  4. using System.Collections.Generic;
  5. using Aitex.Core.UI.MVVM;
  6. using Aitex.Core.Utilities;
  7. using MECF.Framework.Simulator.Core.Commons;
  8. using CyberX8_Simulator.Devices;
  9. namespace CyberX8_Simulator.Views
  10. {
  11. /// <summary>
  12. /// Interaction logic for Simu_TMView .xaml
  13. /// </summary>
  14. public partial class Simu_TMView : UserControl
  15. {
  16. public Simu_TMView ()
  17. {
  18. InitializeComponent();
  19. this.DataContext = new TMSimulatorViewModel();
  20. this.Loaded += OnViewLoaded;
  21. }
  22. private void OnViewLoaded(object sender, RoutedEventArgs e)
  23. {
  24. (DataContext as TimerViewModelBase)?.Start();
  25. }
  26. }
  27. class TMSimulatorViewModel : SocketDeviceViewModel
  28. {
  29. public string Title
  30. {
  31. get { return "TM Simulator"; }
  32. }
  33. private TMSimulatorServer _sim;
  34. public TMSimulatorViewModel() : base("TMSimuViewModel")
  35. {
  36. _sim = new TMSimulatorServer();
  37. Init(_sim);
  38. }
  39. }
  40. }