public MainWindow() { InitializeComponent(); Connection connection = new Connection(); m_Controller = new Controller(connection); m_StateView = new StateView(); m_StateWatcher = new StateWatcher(Dispatcher, m_StateView, m_Controller); DataContext = m_StateView; }
public StateWatcher(Dispatcher dispatcher, StateView stateView, Controller controller) { m_Dispatcher = dispatcher; m_View = stateView; m_Controller = controller; m_InvokeTimeout = new TimeSpan(500000); // 50 ms m_UpdateTimer = Stopwatch.StartNew(); CreateUpdaters(); // Register for state updates m_Controller.StateUpdate += OnStateUpdate; }