private void HandleFeedListPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // Get the object that was clicked on var originalSource = (DependencyObject)e.OriginalSource; // Look for a row that contains the object var dataGridRow = (DataGridRow)FeedListBox.ContainerFromElement(originalSource); // If the selection already contains this row then ignore it if (dataGridRow != null && FeedListBox.SelectedItems.Contains(dataGridRow.Item)) { e.Handled = true; } }
private async Task LoadFeed(SectionType section, bool resetOffset) { SetIsEnabled(false); try { await vm.LoadSection(section, resetOffset); if (FeedListBox.Items.Count > 0) { FeedListBox.ScrollIntoView(FeedListBox.Items[0]); } } catch (Exception e) { throw; } finally { SetIsEnabled(true); } }