public void AddRow(object sender, RoutedEventArgs e) { TermsDefinitions.Add(new TermDefinitionViewModel() { Valid = true }); TermIds.Add(0); }
public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state) { var set = parameter as Set; if (parameter != null) { EditMode = true; TermsDefinitions.Clear(); foreach (var term in set.Terms) { var termAndDef = new TermDefinitionViewModel() { Definition = term.Definition, Term = term.TermText, Valid = true, }; TermsDefinitions.Add(termAndDef); TermIds.Add(term.Id); } Title = set.Title; if (set.Visibility == "public") { EveryoneOrMe = true; } else { EveryoneOrMe = false; } SetId = set.Id; var termLang = LanguageOptions. Where(x => x.CountryCode == set.LangTerms) .SingleOrDefault(); var defLang = LanguageOptions. Where(x => x.CountryCode == set.LangDefinitions) .SingleOrDefault(); SelectedDefinitionLanguage = defLang; SelectedTermLanguage = termLang; } await Task.CompletedTask; }