Example #1
0
        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;
        }
Example #2
0
        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;
        }