Какая-то смотрелка, чего там происходит в девайсине
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace charger_gui
|
||||
{
|
||||
/// <summary>
|
||||
/// Логика взаимодействия для MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
private UpdateWorker worker;
|
||||
private DispatcherTimer updateTimer;
|
||||
MainWindowViewModel model;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
model = new MainWindowViewModel();
|
||||
DataContext = model;
|
||||
worker = new UpdateWorker(model);
|
||||
updateTimer = new DispatcherTimer();
|
||||
updateTimer.Tick += OnTimer;
|
||||
updateTimer.Interval = TimeSpan.FromMilliseconds(50);
|
||||
updateTimer.Start();
|
||||
}
|
||||
|
||||
private void OnTimer(object sender, EventArgs e)
|
||||
{
|
||||
model.OnPropertyChanged("IAcc");
|
||||
model.OnPropertyChanged("UAcc");
|
||||
model.OnPropertyChanged("ILamp");
|
||||
model.OnPropertyChanged("ULamp");
|
||||
model.OnPropertyChanged("ConnectionStatus");
|
||||
}
|
||||
|
||||
private void Ports_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
worker.SetPort(Ports.SelectedItem.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user