void DocumentsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Due to an issue with ElementFlow we need to synchronize the selected items manually var elementFlow = VisualTreeWalker.FindName <ElementFlow>("ef", DocumentsListBox); if (elementFlow != null) { elementFlow.SelectedIndex = DocumentsListBox.SelectedIndex; } }
void AddLabel_Executed(object sender, ExecutedRoutedEventArgs e) { ClientStats.LogEvent("Add label in stream"); using (new ListViewIndexFix(streamView.StreamListView)) { if (State.SelectedMessages.Count == 1) { var lvItem = (ListViewItem)streamView.StreamListView.ItemContainerGenerator.ContainerFromItem(State.SelectedMessage); var editor = (LabelsEditorControl)VisualTreeWalker.FindName("LabelsEditor", lvItem); editor.Visibility = Visibility.Visible; FocusHelper.Focus(editor); } else { // Show modal labels adder EventBroker.Publish(AppEvents.RequestAddLabels, State.SelectedMessages.ToList()); } } }