166 references to OriginalSource
Microsoft.VisualStudio.LanguageServices (4)
DocumentOutline\DocumentOutlineView.xaml.cs (2)
287&& e.OriginalSource is TreeViewItem { DataContext: DocumentSymbolDataViewModel symbolModel } item 316if (e.OriginalSource is TreeViewItem item)
InheritanceMargin\MarginGlyph\InheritanceMarginContextMenu.xaml.cs (1)
50if (e.OriginalSource is MenuItem { DataContext: TargetMenuItemViewModel viewModel })
InheritanceMargin\MarginGlyph\InheritanceMarginGlyph.cs (1)
176if (e.OriginalSource is ContextMenu { DataContext: InheritanceMarginGlyphViewModel inheritanceMarginViewModel }
PresentationCore (7)
System\Windows\Input\AccessKeyManager.cs (2)
307if (ProcessKeyForSender(e.OriginalSource, text, false /* existsElsewhere */,e.UserInitiated) != ProcessKeyResult.NoMatch) 332if (ProcessKeyForSender(e.OriginalSource, text, false /* existsElsewhere */,e.UserInitiated) != ProcessKeyResult.NoMatch)
System\Windows\Input\Command\CommandBinding.cs (1)
167Source = e.OriginalSource
System\Windows\Input\Command\CommandDevice.cs (1)
95IInputElement commandTarget = e.StagingItem.Input.OriginalSource as IInputElement;
System\Windows\RoutedEventArgs.cs (2)
26/// <see cref="RoutedEventArgs.OriginalSource"/> <para/> 54/// <see cref="OriginalSource"/> also defaults to null
System\Windows\UIElement.cs (1)
2329args.Source = args.OriginalSource;
PresentationFramework (70)
System\Windows\Controls\Calendar.cs (1)
1233if (!e.Handled && e.OriginalSource == c)
System\Windows\Controls\ComboBox.cs (7)
1078if (e.OriginalSource == comboBox) 1083else if (e.OriginalSource == comboBox.EditableTextBoxSite) 1317if (IsEditable && e.OriginalSource == EditableTextBoxSite) 1688if (e.OriginalSource == comboBox) 1699if (MenuBase.IsDescendant(comboBox, e.OriginalSource as DependencyObject)) 1732if (Mouse.Captured == comboBox && e.OriginalSource == comboBox) 1745Visual originalSource = e.OriginalSource as Visual;
System\Windows\Controls\Control.cs (2)
576doubleClick.Source = e.OriginalSource; // Set OriginalSource because initially is null 583doubleClick.Source = e.OriginalSource; // Set OriginalSource because initially is null
System\Windows\Controls\DataGrid.cs (5)
2298UIElement source = e.OriginalSource as UIElement; 5441bool shouldProcess = (e.OriginalSource == this); 5444ItemsControl itemsControl = ItemsControlFromItemContainer(e.OriginalSource as DependencyObject); 5592bool navigateFromCellContainer = e.OriginalSource == currentCellContainer; 6374UIElement sourceElement = e.OriginalSource as UIElement;
System\Windows\Controls\DataGridCell.cs (2)
558DataGridCell cell = DataGridHelper.FindVisualParent<DataGridCell>(e.OriginalSource as UIElement); 571DataGridCell cell = DataGridHelper.FindVisualParent<DataGridCell>(e.OriginalSource as UIElement);
System\Windows\Controls\DatePicker.cs (2)
844if (e.OriginalSource == picker) 849else if (e.OriginalSource == picker._textBox)
System\Windows\Controls\FlowDocumentScrollViewer.cs (1)
1018if (e.OriginalSource == ScrollViewer)
System\Windows\Controls\GridViewHeaderRowPresenter.cs (2)
1098if (_headerSV != null && _mainSV == e.OriginalSource) 1107if (_mainSV != null && _headerSV == e.OriginalSource)
System\Windows\Controls\ItemsControl.cs (3)
1680(e.OriginalSource == this || ItemsControlFromItemContainer(e.OriginalSource as DependencyObject) == this)) 3206UIElement focusedElement = e.OriginalSource as UIElement;
System\Windows\Controls\ListBox.cs (3)
409ListBoxItem source = e.OriginalSource as ListBoxItem; 507if (e.OriginalSource is GridViewColumnHeader gridViewColumnHeader && gridViewColumnHeader.Column != null) 555if (e.OriginalSource == this && Mouse.Captured == this)
System\Windows\Controls\Menu.cs (1)
283FrameworkElement element = e.OriginalSource as FrameworkElement;
System\Windows\Controls\MenuItem.cs (3)
1055if (sender != e.OriginalSource) 1058MenuItem source = e.OriginalSource as MenuItem; 1567if (e.OriginalSource == menuItem && menuItem.IsSubmenuOpen)
System\Windows\Controls\PopupControlService.cs (1)
959IInputElement source = e.OriginalSource as IInputElement;
System\Windows\Controls\Primitives\ButtonBase.cs (4)
535if ((e.OriginalSource == this) && (ClickMode != ClickMode.Hover) && !IsSpaceKeyDown) 617if ((!IsMouseCaptured) && (e.OriginalSource == this)) 634if (e.OriginalSource == this) 722if (e.OriginalSource == this)
System\Windows\Controls\Primitives\DataGridDetailsPresenter.cs (1)
112if (!PresentationSource.UnderSamePresentationSource(e.OriginalSource as DependencyObject, this))
System\Windows\Controls\Primitives\MenuBase.cs (4)
339MenuItem newSelectedMenuItem = e.OriginalSource as MenuItem; 546if (e.OriginalSource == menu) 557if (MenuBase.IsDescendant(menu, e.OriginalSource as DependencyObject)) 584MenuItem menuItemSource = e.OriginalSource as MenuItem;
System\Windows\Controls\Primitives\Popup.cs (2)
1106if (_popupRoot != null && e.OriginalSource == _popupRoot) 1225bool reestablishCapture = e.OriginalSource != root && Mouse.Captured == null && MS.Win32.SafeNativeMethods.GetCapture() == IntPtr.Zero;
System\Windows\Controls\Primitives\Selector.cs (2)
1897((Selector)sender).NotifyIsSelectedChanged(e.OriginalSource as FrameworkElement, true, e); 1902((Selector)sender).NotifyIsSelectedChanged(e.OriginalSource as FrameworkElement, false, e);
System\Windows\Controls\ScrollViewer.cs (2)
934if (e.OriginalSource == this) 1657if (!PresentationSource.UnderSamePresentationSource(e.OriginalSource as DependencyObject, this))
System\Windows\Controls\Slider.cs (3)
838Thumb thumb = e.OriginalSource as Thumb; 869Thumb thumb = e.OriginalSource as Thumb; 918Thumb thumb = e.OriginalSource as Thumb;
System\Windows\Controls\StickyNote.cs (1)
1240Visual source = args.OriginalSource as Visual;
System\Windows\Controls\ToolBar.cs (1)
709ButtonBase bb = args.OriginalSource as ButtonBase;
System\Windows\Controls\ToolBarTray.cs (1)
514Thumb thumb = e.OriginalSource as Thumb;
System\windows\Documents\TextEditorMouse.cs (1)
673ScrollViewer scrollViewer = e.OriginalSource as ScrollViewer;
System\windows\Documents\TextEditorTyping.cs (5)
262if (This == null || !This._IsEnabled || This.IsReadOnly || !This._IsSourceInScope(e.OriginalSource)) 294if (This == null || !This._IsEnabled || (This.IsReadOnly && !This.IsReadOnlyCaretVisible) || !This._IsSourceInScope(e.OriginalSource)) 340if (This == null || !This._IsEnabled || (This.IsReadOnly && !This.IsReadOnlyCaretVisible) || !This._IsSourceInScope(e.OriginalSource)) 369if (This == null || !This._IsEnabled || This.IsReadOnly || !This._IsSourceInScope(e.OriginalSource)) 1276if (This == null || !This._IsEnabled || This.IsReadOnly || !This._IsSourceInScope(e.OriginalSource))
System\Windows\FrameworkContentElement.cs (2)
1045if (sender == e.OriginalSource) 1058if (sender == e.OriginalSource)
System\Windows\FrameworkElement.cs (3)
5339if (e.OriginalSource == sender) 5365if (sender == e.OriginalSource) 5379if (sender == e.OriginalSource)
System\Windows\Input\KeyboardNavigation.cs (1)
1195DependencyObject sourceElement = keyEventArgs.OriginalSource as DependencyObject;
System\Windows\Navigation\NavigationService.cs (1)
115DependencyObject dobj = e.OriginalSource as DependencyObject;
System\Windows\Window.cs (3)
7056if (!PresentationSource.UnderSamePresentationSource(e.OriginalSource as DependencyObject, this)) 7065_currentPanningTarget.Target != e.OriginalSource) 7078UpdatePanningFeedback(manipulation.Translation, e.OriginalSource);
System.Windows.Controls.Ribbon (85)
Microsoft\Windows\Controls\KeyTipService.cs (1)
758DependencyObject globalScope = GetGlobalScopeForElement(keyArgs.OriginalSource as DependencyObject);
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (16)
1814if (!RibbonHelper.IsAncestorOf(_itemsPresenterPopup.TryGetChild(), e.OriginalSource as DependencyObject) && 1815!RibbonHelper.IsAncestorOf(_tabHeaderItemsControl, e.OriginalSource as DependencyObject)) 1858TreeHelper.IsVisualAncestorOf(this, e.OriginalSource as DependencyObject)) 2410ContextMenuOriginalSource = e.OriginalSource as UIElement; 2452DependencyObject obj = args.OriginalSource as DependencyObject; 2467UIElement originalSource = args.OriginalSource as UIElement; 2500DependencyObject originalSource = args.OriginalSource as DependencyObject; 2515DependencyObject originalSource = args.OriginalSource as DependencyObject; 2529DependencyObject originalSource = args.OriginalSource as DependencyObject; 2544DependencyObject originalSource = args.OriginalSource as DependencyObject; 2558DependencyObject obj = args.OriginalSource as DependencyObject; 2568UIElement originalSource = args.OriginalSource as UIElement; 2587DependencyObject originalSource = args.OriginalSource as DependencyObject; 2603DependencyObject originalSource = args.OriginalSource as DependencyObject; 2617DependencyObject originalSource = args.OriginalSource as DependencyObject; 2633DependencyObject originalSource = args.OriginalSource as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonApplicationMenu.cs (4)
381if (e.OriginalSource == this) 447DependencyObject element = e.OriginalSource as DependencyObject; 488DependencyObject element = e.OriginalSource as DependencyObject; 516DependencyObject element = e.OriginalSource as DependencyObject;
Microsoft\Windows\Controls\Ribbon\RibbonApplicationMenuItem.cs (1)
217if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonApplicationSplitMenuItem.cs (2)
215if (e.OriginalSource == this) 229else if (e.OriginalSource == HeaderButton)
Microsoft\Windows\Controls\Ribbon\RibbonButton.cs (2)
577if (e.OriginalSource == this) 590if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonCheckBox.cs (2)
584if (e.OriginalSource == this) 597if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (7)
176if (e.OriginalSource == this) 181else if (e.OriginalSource == EditableTextBoxSite) 1211if (e.OriginalSource == this || 1212e.OriginalSource == PartToggleButton) 1258Visual originalSource = e.OriginalSource as Visual; 1558if (e.OriginalSource == this) 1566if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonFilterMenuButton.cs (1)
136if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (2)
2742e.Handled = menuItem.HandleLeftKeyDown(e.OriginalSource as DependencyObject); 2784RibbonHelper.IsAncestorOf(filterPane, e.OriginalSource as DependencyObject))
Microsoft\Windows\Controls\Ribbon\RibbonGalleryItem.cs (6)
421if (e.OriginalSource == this) 430if (e.OriginalSource == this) 454if (e.OriginalSource == this) 480if (e.OriginalSource == this && RibbonGallery != null && RibbonGallery.ShouldGalleryItemsAcquireFocus) 788if (e.OriginalSource == this) 803if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonGroup.cs (3)
1645if (e.OriginalSource == this) 1682placementTarget = RibbonHelper.GetContainingUIElement(e.OriginalSource as DependencyObject); 1760if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (3)
1044if (e.OriginalSource == targetCapture) 1079else if (RibbonHelper.IsAncestorOf(targetCapture, e.OriginalSource as DependencyObject)) 1165if (!cancelPredicate(e.OriginalSource as DependencyObject))
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (11)
734if (e.OriginalSource == _partToggleButton || 735e.OriginalSource == this) 754if (e.OriginalSource == this || 755e.OriginalSource == _partToggleButton) 790int focusedIndex = ItemContainerGenerator.IndexFromContainer(e.OriginalSource as DependencyObject); 892FrameworkElement selectionItem = e.OriginalSource as FrameworkElement; 1402FrameworkElement source = e.OriginalSource as FrameworkElement; 1518if (e.OriginalSource != this && 1520!TreeHelper.IsVisualAncestorOf(this, e.OriginalSource as DependencyObject)) 1669if (e.OriginalSource == this) 1682if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (7)
833int focusedIndex = ItemContainerGenerator.IndexFromContainer(e.OriginalSource as DependencyObject); 878handled = HandleLeftKeyDown(e.OriginalSource as DependencyObject); 1009if (e.OriginalSource == this) 1503if (sender != e.OriginalSource) 1506FrameworkElement selectionItem = e.OriginalSource as FrameworkElement; 1809if (e.OriginalSource == this) 1825if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonQuickAccessToolBar.cs (2)
655if (e.OriginalSource == _overflowButton) 675if (e.OriginalSource == _overflowButton)
Microsoft\Windows\Controls\Ribbon\RibbonRadioButton.cs (2)
600if (e.OriginalSource == this) 613if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonSplitButton.cs (2)
544if (e.OriginalSource == this) 551else if (e.OriginalSource == _headerButton)
Microsoft\Windows\Controls\Ribbon\RibbonSplitMenuItem.cs (4)
253if (e.OriginalSource == _partArrowButton) 377if (e.OriginalSource == this) 391else if (e.OriginalSource == HeaderButton) 402if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonTab.cs (1)
875if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonTabHeader.cs (2)
639if (e.OriginalSource == this) 707if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonTextBox.cs (2)
689if (e.OriginalSource == this) 702if (e.OriginalSource == this)
Microsoft\Windows\Controls\Ribbon\RibbonToggleButton.cs (2)
619if (e.OriginalSource == this) 632if (e.OriginalSource == this)