1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using Aitex.Core.UI.MVVM;
- using CyberX8_Simulator.Devices;
- using MECF.Framework.Simulator.Core.Commons;
- using System.Windows;
- using System.Windows.Controls;
- namespace CyberX8_Simulator.Views
- {
- /// <summary>
- /// FestoView.xaml 的交互逻辑
- /// </summary>
- public partial class FestoView : UserControl
- {
- public FestoView()
- {
- InitializeComponent();
- this.Loaded += OnViewLoaded;
- }
- private void OnViewLoaded(object sender, RoutedEventArgs e)
- {
- (DataContext as TimerViewModelBase)?.Start();
- }
- }
- class FestoViewModel : SocketDeviceViewModel
- {
- public string Title
- {
- get { return "Festo Simulator"; }
- }
- private FestoSocketSimulator _sim;
- public FestoViewModel(string str) : base("FestoViewModel")
- {
- int.TryParse(str, out int port);
- _sim = new FestoSocketSimulator(port);
- Init(_sim);
- }
- }
- }
|