Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / ListBoxItemAutomationPeer.cs / 1305600 / ListBoxItemAutomationPeer.cs
using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class ListBoxItemAutomationPeer : SelectorItemAutomationPeer, IScrollItemProvider { /// public ListBoxItemAutomationPeer(object owner, SelectorAutomationPeer selectorAutomationPeer) : base(owner, selectorAutomationPeer) { } /// override protected string GetClassNameCore() { return "ListBoxItem"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.ListItem; } /// override public object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.ScrollItem) { return this; } return base.GetPattern(patternInterface); } ///For ComboBoxItem for which peer is this element only, scrolling should happen when the pop-up is expanded. internal override void RealizeCore() { ComboBox parent = ItemsControlAutomationPeer.Owner as ComboBox; if (parent != null) { IExpandCollapseProvider iecp = (IExpandCollapseProvider)UIElementAutomationPeer.FromElement(parent) as ComboBoxAutomationPeer; if (iecp.ExpandCollapseState != ExpandCollapseState.Expanded) iecp.Expand(); } base.RealizeCore(); } void IScrollItemProvider.ScrollIntoView() { ListBox parent = ItemsControlAutomationPeer.Owner as ListBox; if (parent != null) parent.ScrollIntoView(Item); else { ComboBoxAutomationPeer parentPeer = ItemsControlAutomationPeer as ComboBoxAutomationPeer; if(parentPeer != null) parentPeer.ScrollItemIntoView(Item); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WpfSharedBamlSchemaContext.cs
- ParameterReplacerVisitor.cs
- Preprocessor.cs
- ActiveXContainer.cs
- DecoderFallbackWithFailureFlag.cs
- RuntimeArgumentHandle.cs
- XmlReader.cs
- SelectionProcessor.cs
- LinkUtilities.cs
- Decimal.cs
- CleanUpVirtualizedItemEventArgs.cs
- DesignerExtenders.cs
- SqlFileStream.cs
- KerberosRequestorSecurityTokenAuthenticator.cs
- DodSequenceMerge.cs
- DropDownHolder.cs
- StylusCollection.cs
- EntityTypeEmitter.cs
- EntitySetBase.cs
- MSAANativeProvider.cs
- ObjRef.cs
- JsonSerializer.cs
- FactoryMaker.cs
- MessageBox.cs
- rsa.cs
- AudioFormatConverter.cs
- TextAction.cs
- LayoutManager.cs
- StaticContext.cs
- MarginsConverter.cs
- Canvas.cs
- LicFileLicenseProvider.cs
- ComponentRenameEvent.cs
- DataGridTextBoxColumn.cs
- ServiceInfoCollection.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- Control.cs
- Color.cs
- BitmapEffectState.cs
- Mouse.cs
- RelationshipConverter.cs
- IdentityValidationException.cs
- MetadataCollection.cs
- FrameworkElement.cs
- Registry.cs
- QueryPageSettingsEventArgs.cs
- AddingNewEventArgs.cs
- ObjectDataSourceMethodEventArgs.cs
- XPathAxisIterator.cs
- Range.cs
- WindowsButton.cs
- Object.cs
- UndoManager.cs
- SqlConnection.cs
- WindowsToolbarItemAsMenuItem.cs
- BrowserCapabilitiesCompiler.cs
- BinaryObjectInfo.cs
- InternalMappingException.cs
- iisPickupDirectory.cs
- SafeSecurityHelper.cs
- DesignerForm.cs
- ToolboxItem.cs
- ShutDownListener.cs
- PreviewPageInfo.cs
- PeerApplicationLaunchInfo.cs
- CommandSet.cs
- OdbcFactory.cs
- Composition.cs
- BaseAddressPrefixFilterElement.cs
- WmfPlaceableFileHeader.cs
- TranslateTransform3D.cs
- DirectoryNotFoundException.cs
- GridViewUpdatedEventArgs.cs
- SchemaImporter.cs
- Byte.cs
- UmAlQuraCalendar.cs
- GridSplitterAutomationPeer.cs
- XmlSchemaObjectTable.cs
- DesignerWithHeader.cs
- SessionPageStatePersister.cs
- ManipulationCompletedEventArgs.cs
- WindowsUpDown.cs
- ExpandCollapseIsCheckedConverter.cs
- SqlDataSourceCustomCommandEditor.cs
- ComPlusInstanceProvider.cs
- XPathScanner.cs
- ShapingEngine.cs
- HttpHeaderCollection.cs
- Triplet.cs
- BoolExpressionVisitors.cs
- JavaScriptObjectDeserializer.cs
- TableRowGroup.cs
- ShadowGlyph.cs
- XmlSchemaObject.cs
- _HeaderInfoTable.cs
- DiagnosticSection.cs
- SafeWaitHandle.cs
- PackagePartCollection.cs
- ModelService.cs
- DropDownList.cs