void ExecuteCheckCommand()
 {
     VocabularyPairs.Remove(CurrentVocabularyPair);
     CurrentVocabularyPair = VocabularyPairs.FirstOrDefault();
     ShownText             = CurrentVocabularyPair.Vocabulary1.Text;
     Culture1 = CurrentVocabularyPair.Vocabulary1.Language;
     Culture2 = CurrentVocabularyPair.Vocabulary2.Language;
 }
        public async override void OnAppearing()
        {
            base.OnAppearing();

            var list = await _vocabularySqliteConnection.GetAllWithChildrenAsync <VocabularyPair <OwnVocabulary> >();

            if (list is null || !list.Any())
            {
                return;
            }
            VocabularyPairs       = new ObservableCollection <VocabularyPair <OwnVocabulary> >(list);
            ShownText             = list.FirstOrDefault().Vocabulary1.Text;
            CurrentVocabularyPair = list.FirstOrDefault();
            Culture1 = list.FirstOrDefault().Vocabulary1.Language;
            Culture2 = list.FirstOrDefault().Vocabulary2.Language;
        }
Beispiel #3
0
        async void ExecuteCreateVocabularyCommand()
        {
            var ownVocabel = new VocabularyPair <OwnVocabulary>
            {
                Vocabulary1 = new OwnVocabulary
                {
                    Language = Language1,
                    Text     = Text1
                },
                Vocabulary2 = new OwnVocabulary
                {
                    Language = Language2,
                    Text     = Text2
                }
            };
            await _vocabularySqliteConnection.InsertOrReplaceWithChildrenAsync(ownVocabel);

            Text1 = "";
            Text2 = "";
        }