예제 #1
0
        public ConnectingAlphabetViewModel(ConnectingViewModelFactory factory)
        {
            _factory = factory;

            foreach (var letter in CommonHelper.GetAlphabet())
            {
                var rectangleViewModel = _factory.CreateRectangleViewModel(letter);
                ConnectingRectangles.Add(rectangleViewModel);
            }
        }
예제 #2
0
 public PlugboardViewModel(ConnectingAlphabetViewModel topAlphabet, ConnectingAlphabetViewModel bottomAlphabet, ConnectingViewModelFactory factory,
                           IEventAggregator viewEventAggregator, IEnigmaSettings enigmaSettings)
 {
     TopAlphabet          = topAlphabet;
     BottomAlphabet       = bottomAlphabet;
     _factory             = factory;
     _enigmaSettings      = enigmaSettings;
     _plugboardController = new PlugboardController(enigmaSettings);
     viewEventAggregator.Subscribe(this);
 }