public override void Handle(LetterTranslation translation) { var fromView = LetterViewModels.First(vm => vm.Letter == translation.Input).GetView() as LetterView; var toView = LetterViewModels.First(vm => vm.Letter == translation.Result).GetView() as LetterView; ConnectionDrawer.Draw(fromView, toView, translation.Direction); }
public override void Handle(LetterTranslation translation) { Grid.UpdateLayout(); LetterView fromView, toView; if (translation.Direction == SignalDirection.In) { fromView = InnerLetterViews.First(vm => vm.Letter == translation.Input).GetView() as LetterView; toView = OuterLetterViews.First(vm => vm.Letter == translation.Result).GetView() as LetterView; } else { fromView = OuterLetterViews.First(vm => vm.Letter == translation.Input).GetView() as LetterView; toView = InnerLetterViews.First(vm => vm.Letter == translation.Result).GetView() as LetterView; } ConnectionDrawer.Draw(fromView, toView, translation.Direction); }