/// <summary> /// Will call Steam api to find manually entered username, navigate to new page if valid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void TypedUser(object sender, RoutedEventArgs e) { username = UsernameTextBox.Text; Debug.WriteLine(username); bool valid = await CheckUsername(username); if (valid) { if (!savedUsers.Contains(username)) { try { File.AppendAllText(userFilePath, "\n" + username); } catch (Exception error) { Debug.Print(error.Message); } } ViewFilters filterPage = new ViewFilters(username, userKey); this.NavigationService.Navigate(filterPage); } else { } }
/// <summary> /// Will call Steam api to find player from saved list, then navigate to new page if valid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void SelectedUser(object sender, RoutedEventArgs e) { var listBox = peopleListBox; var listBoxItem = (ListBoxItem)peopleListBox.SelectedValue; username = listBoxItem.Content.ToString(); bool valid = await CheckUsername(username); if (valid) { ViewFilters filterPage = new ViewFilters(username, userKey); this.NavigationService.Navigate(filterPage); } }