private async void selectOneImage() { Images.Shuffle(); LImagesMots tmpSeclected = Images[0]; imageSelected = new LImageMotReadMatching(tmpSeclected.ImageSource, tmpSeclected.ImageText, true); wordCandidates.Clear(); wordCandidates.Add(imageSelected); for (int i = 1; i < localSetting_m.LeonceReconnaitWordCount; i++) { tmpSeclected = Images[i]; LImageMotReadMatching falseWordSelected = new LImageMotReadMatching(tmpSeclected.ImageSource, tmpSeclected.ImageText, false); wordCandidates.Add(falseWordSelected); } wordCandidates.Shuffle(); await Task.Delay(1000); await letterPlayer_m.speachAsync(imageSelected.word); }
private async Task setMotChoisiSelected(LImageMotReadMatching motChoisi) { if (isEvaluating == false) { isEvaluating = true; gameCount++; motChoisi.setSelected(); if (!motChoisi.isCorrect) { ElementSoundPlayer.State = ElementSoundPlayerState.On; ElementSoundPlayer.Play(ElementSoundKind.GoBack); NotifyPropertyChanged("GameProgress"); NotifyPropertyChanged("ScoreActuel"); await letterPlayer_m.speachAsync(motChoisi.word); await Task.Delay(500); ElementSoundPlayer.State = ElementSoundPlayerState.Off; motChoisi.setUnSelected(); } else { score++; NotifyPropertyChanged("ScoreActuel"); NotifyPropertyChanged("GameProgress"); await playApplauseAsync(); await Task.Delay(1000); selectOneImage(); } isEvaluating = false; } }
private async void textBoxClicked(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { LImageMotReadMatching motChoisi = (LImageMotReadMatching)(sender as FrameworkElement).DataContext; await setMotChoisiSelected(motChoisi); }