public void SetVM(RC2014.EMU.RC2014 vm) { rc2014 = vm; stkCPU.Dispatcher.Invoke(() => { stkCPU.DataContext = vm.CPU; }); }
private static void InitVM() { CancelThreads(); var vm = _VM = _serviceProvider.GetService <RC2014.EMU.RC2014>(); _monitor?.SetVM(vm); var console = vm.Ports.First(p => p is IConsoleFeed) as IConsoleFeed; console.Initalise(); _cancellationTokenSource = new CancellationTokenSource(); _cancellationToken = _cancellationTokenSource.Token; _tasks.Prepend(Task.Factory.StartNew(() => console.KeyboardHandler(_cancellationToken, HandleKey), _cancellationToken)); }