Ejemplo n.º 1
0
 private async void InitializeAsync()
 {
     if (!DesignerProperties.GetIsInDesignMode(new DependencyObject()))
     {
         IsLoading = true;
         List <Phrase> loadedPhrases = (await PhraseRepository.GetAllPhrasesFromLevelAsync(6)).ToList();
         SearcheablePhrases = new SearcheableObservableCollection <Phrase>(loadedPhrases);
         IsLoading          = false;
     }
 }
        private async void LoadAsync()
        {
            IEnumerable <Phrase> loadedPhrases = await PhraseRepository.GetAllPhrasesAsync();

            IEnumerable <SelectableItem <Phrase> > phrases = loadedPhrases.Select(loadedPhrase => new SelectableItem <Phrase>(loadedPhrase));

            SearcheablePhrases = new SearcheableObservableCollection <SelectableItem <Phrase> >(phrases);

            IEnumerable <MeasureWord> loadedMeasureWords = await MeasureWordRepository.GetAllMeasureWordsAsync();

            IEnumerable <SelectableItem <MeasureWord> > measureWords = loadedMeasureWords.Select(loadedMeasureWord => new SelectableItem <MeasureWord>(loadedMeasureWord));

            SearcheableMeasureWords = new SearcheableObservableCollection <SelectableItem <MeasureWord> >(measureWords);
        }