private void OnItemTapped(object sender, C1TappedEventArgs e) { e.Handled = true; SuggestListPopup.IsOpen = false; C1ListBoxItem item = sender as C1ListBoxItem; string tag = (item.Content as Mail)?.Name?.Trim(); if (!string.IsNullOrEmpty(tag) && !AddressEditor.Text.Contains(tag)) { // add new tag AddressEditor.InsertTag(tag); AddressEditor.SetEditorText(string.Empty); AddressEditor.Focus(FocusState.Programmatic); Mail selectedMail = Mails[MyIndexOf(tag)]; _changedSelectedItemsInternal = true; if (ContactList.SelectedItems == null) { object[] selectedItems = new object[] { selectedMail }; ContactList.SelectedItems = selectedItems; } else { object[] selectedItems = ContactList.SelectedItems as object[]; var list = selectedItems.ToList(); if (!list.Contains(selectedMail)) { list.Add(selectedMail); ContactList.SelectedItems = list.ToArray(); } } _changedSelectedItemsInternal = false; } }
private void colorListBox_ItemTapped(object sender, C1TappedEventArgs e) { C1ListBoxItem item = sender as C1ListBoxItem; Border b = item.Content as Border; if (ColorMode == FontColorMode.Background) { if (Equals(b.Background, RichTextBox.Selection.InlineBackground)) { RichTextBox.Selection.InlineBackground = RichTextBox.Background; } else { RichTextBox.Selection.InlineBackground = b.Background; } } else { if (Equals(b.Background, RichTextBox.Selection.InlineBackground)) { RichTextBox.Selection.Foreground = RichTextBox.Foreground; } else { RichTextBox.Selection.Foreground = b.Background; } } Close(); }
private void colorListBox_ItemTapped(object sender, C1TappedEventArgs e) { C1ListBoxItem item = sender as C1ListBoxItem; if (item != null) { Border b = item.Content as Border; if (b != null) { dropDownBorder.Background = b.Background; } } c1DropDown1.IsDropDownOpen = false; }