private void AddPickerEntry() { //cast the selected name as a PickerEntry PickerEntry pe = (PickerEntry)ResultsLst.SelectedItem; if (pe == null) { return; } // UserNameTxt.Text = pe.DisplayName; SelectedAccountName = pe.AccountName; bool contains = selectedAccounts.Any(p => p.AccountName.Equals(SelectedAccountName)); if (!contains) { if (AllowMultiple) { selectedAccounts.Add(new AccountList(pe.AccountName, pe.DisplayName)); } else { selectedAccounts.Clear(); selectedAccounts.Add(new AccountList(pe.AccountName, pe.DisplayName)); } } }
private void SetSingleResult(Dictionary <String, PickerEntry> values) { PickerEntry pi = values.Values.ToArray <PickerEntry>()[0]; UserTextBox.Text = pi.DisplayName; UserTextBox.FontStyle = FontStyles.Italic; UserTextBox.Foreground = new SolidColorBrush(Colors.Black); UserTextBox.BorderBrush = new SolidColorBrush(Colors.Black); selectedAccounts.Clear(); selectedAccounts.Add(new AccountList(pi.AccountName, pi.DisplayName)); }