コード例 #1
0
ファイル: PPLPicker.xaml.cs プロジェクト: madhur/SlExcel
        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));
                }
            }
        }
コード例 #2
0
ファイル: PeopleChooser.xaml.cs プロジェクト: madhur/SlExcel
        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));
        }