1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- using System.Collections.Generic;
- using Aitex.Core.UI.MVVM;
- using Aitex.Core.Utilities;
- using MECF.Framework.Simulator.Core.Commons;
- using CyberX8_Simulator.Devices;
- using System.Threading;
- namespace CyberX8_Simulator.Views
- {
- /// <summary>
- /// Interaction logic for PowerSupplierView.xaml
- /// </summary>
- public partial class PowerSupplierView : UserControl
- {
- public PowerSupplierView()
- {
- InitializeComponent();
- this.Loaded += OnViewLoaded;
- }
- private void OnViewLoaded(object sender, RoutedEventArgs e)
- {
- (DataContext as TimerViewModelBase)?.Start();
- }
- }
- class PowerSupplierViewModel : SocketDeviceViewModel
- {
- public string Title
- {
- get { return "PowerSupplier Simulator"; }
- }
- private PowerSupplierSocketSimulator _sim;
- public PowerSupplierViewModel(string str) : base("PowerSupplierViewModel")
- {
- int.TryParse(str, out int port);
- _sim=new PowerSupplierSocketSimulator(port);
- Init(_sim);
- }
- }
- }
|