private void HandleSwitchView(SwitchViewMessage msg) { if (msg.ViewModelType == GetType()) { _busyService.ShowBusyIndicatorUntilFinishDrawing(); var pair = (VarietyPair)msg.DomainModels[0]; SelectedVarietyPair = _varietyPairFactory(pair, true); Set(() => SelectedVariety1, ref _selectedVariety1, _varieties[pair.Variety1]); Set(() => SelectedVariety2, ref _selectedVariety2, _varieties[pair.Variety2]); VarietyPairState = pair.Variety1.VarietyPairs.Contains(pair.Variety2) ? VarietyPairState.SelectedAndCompared : VarietyPairState.SelectedAndNotCompared; if (msg.DomainModels.Count > 1) { var meaning = (Meaning)msg.DomainModels[1]; _selectedVarietyPair.Cognates.SelectedWordPairs.Clear(); _selectedVarietyPair.Cognates.SelectedWordPairs.AddRange(_selectedVarietyPair.Cognates.WordPairs.Where(wp => wp.Meaning.DomainMeaning == meaning)); _selectedVarietyPair.Noncognates.SelectedWordPairs.Clear(); if (_selectedVarietyPair.Cognates.SelectedWordPairs.Count == 0) { _selectedVarietyPair.Noncognates.SelectedWordPairs.AddRange(_selectedVarietyPair.Noncognates.WordPairs.Where(wp => wp.Meaning.DomainMeaning == meaning)); } } } }
private void HandleSwitchView(SwitchViewMessage msg) { if (msg.ViewModelType == GetType()) { if (msg.DomainModels.Count == 2) { var variety = (Variety)msg.DomainModels[0]; var meaning = (Meaning)msg.DomainModels[1]; SelectedVarietyMeaning = _varieties[variety].Meanings.Single(m => m.DomainMeaning == meaning); } } }
private void HandleSwitchView(SwitchViewMessage msg) { if (msg.ViewModelType == GetType()) { SelectedVariety = _varieties[(Variety)msg.DomainModels[0]]; if (msg.DomainModels.Count > 1) { var meaning = (Meaning)msg.DomainModels[1]; _selectedVariety.Words.SelectedWords.Clear(); _selectedVariety.Words.SelectedWords.AddRange(_selectedVariety.Words.Words.Where(w => w.Meaning.DomainMeaning == meaning)); } } }
private void HandleSwitchView(SwitchViewMessage msg) { if (msg.ViewModelType == GetType()) { _busyService.ShowBusyIndicatorUntilFinishDrawing(); var pair = (VarietyPair)msg.DomainModels[0]; SelectedVarietyPair = _varietyPairFactory(pair, true); Set(() => SelectedVariety1, ref _selectedVariety1, _varieties[pair.Variety1]); Set(() => SelectedVariety2, ref _selectedVariety2, _varieties[pair.Variety2]); VarietyPairState = pair.Variety1.VarietyPairs.Contains(pair.Variety2) ? VarietyPairState.SelectedAndCompared : VarietyPairState.SelectedAndNotCompared; } }
private void HandleSwitchView(SwitchViewMessage msg) { if (msg.ViewModelType == GetType()) { _busyService.ShowBusyIndicatorUntilFinishDrawing(); var meaning = (Meaning)msg.DomainModels[0]; SelectedMeaning = _meanings[meaning]; if (msg.DomainModels.Count > 1) { var wp = (WordPair)msg.DomainModels[1]; _selectedWords.ReplaceAll(new[] { _words.First(w => w.DomainWord == wp.Word1), _words.First(w => w.DomainWord == wp.Word2) }); } } }
private void HandleSwitchView(SwitchViewMessage msg) { SwitchView(msg.ViewModelType); }
private void HandleSwitchView(SwitchViewMessage msg) { if (msg.ViewModelType == GetType()) { _busyService.ShowBusyIndicatorUntilFinishDrawing(); var meaning = (Meaning) msg.DomainModels[0]; SelectedMeaning = _meanings[meaning]; if (msg.DomainModels.Count > 1) { var wp = (WordPair) msg.DomainModels[1]; _selectedWords.ReplaceAll(new[] { _words.First(w => w.DomainWord == wp.Word1), _words.First(w => w.DomainWord == wp.Word2)}); } } }
private void HandleSwitchView(SwitchViewMessage msg) { if (msg.ViewModelType == GetType()) { if (msg.DomainModels.Count == 2) { var variety = (Variety) msg.DomainModels[0]; var meaning = (Meaning) msg.DomainModels[1]; SelectedVarietyMeaning = _varieties[variety].Meanings.Single(m => m.DomainMeaning == meaning); } } }
private void HandleSwitchView(SwitchViewMessage msg) { if (msg.ViewModelType == GetType()) { SelectedVariety = _varieties[(Variety) msg.DomainModels[0]]; if (msg.DomainModels.Count > 1) { var meaning = (Meaning) msg.DomainModels[1]; _selectedVariety.Words.SelectedWords.Clear(); _selectedVariety.Words.SelectedWords.AddRange(_selectedVariety.Words.Words.Where(w => w.Meaning.DomainMeaning == meaning)); } } }
private void HandleSwitchView(SwitchViewMessage msg) { if (msg.ViewModelType == GetType()) { _busyService.ShowBusyIndicatorUntilFinishDrawing(); var pair = (VarietyPair) msg.DomainModels[0]; SelectedVarietyPair = _varietyPairFactory(pair, true); Set(() => SelectedVariety1, ref _selectedVariety1, _varieties[pair.Variety1]); Set(() => SelectedVariety2, ref _selectedVariety2, _varieties[pair.Variety2]); VarietyPairState = pair.Variety1.VarietyPairs.Contains(pair.Variety2) ? VarietyPairState.SelectedAndCompared : VarietyPairState.SelectedAndNotCompared; if (msg.DomainModels.Count > 1) { var meaning = (Meaning) msg.DomainModels[1]; _selectedVarietyPair.Cognates.SelectedWordPairs.Clear(); _selectedVarietyPair.Cognates.SelectedWordPairs.AddRange(_selectedVarietyPair.Cognates.WordPairs.Where(wp => wp.Meaning.DomainMeaning == meaning)); _selectedVarietyPair.Noncognates.SelectedWordPairs.Clear(); _selectedVarietyPair.Noncognates.SelectedWordPairs.AddRange(_selectedVarietyPair.Noncognates.WordPairs.Where(wp => wp.Meaning.DomainMeaning == meaning)); } } }