public ProtocolViewModel(ProtocolRunner runner, CascadeProtocolRuntimeEnvironment environment)
        {
            _runner = runner;
            _environment = environment;
            NextStepCommand = new RelayCommand(_ => _runner.NextStep());
            StartProcessCommand = new RelayCommand(_ => { _runner.Start(); _runner.NextStep(); });

            _screenCapture = new ScreenCapture("images");

            _runner.StepStarted += RunnerOnStepStarted;
            _runner.StepFinished += RunnerOnStepFinished;

            AliceKey = environment.AliceKey.Select(item => new KeyItemViewModel(item)).ToList();
            BobKey = environment.BobKey.Select(item => new KeyItemViewModel(item)).ToList();
            ErrorItems =
                environment.BobKey.Where((model, i) => environment.AliceKey[i].Value != model.Value)
                           .Select(model => new KeyItemViewModel(model))
                           .ToList();

            const int numberOfPasses = 4;
            AliceBlocks = new BlockSetViewModel[numberOfPasses];
            for (var i = 0; i < numberOfPasses; ++i)
            {
                AliceBlocks[i] = new BlockSetViewModel
                    {
                        Blocks = environment.AliceBlocks[i].Select(block => new BlockViewModel(block, AliceKey)).ToList()
                    };
            }

            BobBlocks = new BlockSetViewModel[numberOfPasses];
            for (var i = 0; i < numberOfPasses; ++i)
            {
                BobBlocks[i] = new BlockSetViewModel
                {
                    Blocks = environment.BobBlocks[i].Select(block => new BlockViewModel(block, BobKey)).ToList()
                };
            }
        }
 private IEnumerable<BlockViewModel> GetAllBlocks(BlockSetViewModel[] blocks)
 {
     return Enumerable.Range(0, 4).SelectMany(i => blocks[i].Blocks);
 }