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 { /// /// Interaction logic for PowerSupplierView.xaml /// 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); } } }