Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / MS / Internal / AppModel / NavigationHelper.cs / 1 / NavigationHelper.cs
using System; using System.Windows; using System.Windows.Navigation; using System.Windows.Controls; using System.Windows.Automation; using System.Windows.Media; using System.Globalization; using System.Diagnostics; using MS.Internal; namespace MS.Internal.AppModel { internal static class NavigationHelper { ////// See INavigatorImpl.FindRootViewer(). /// internal static Visual FindRootViewer(ContentControl navigator, string contentPresenterName) { object content = navigator.Content; if (content == null || content is Visual) return content as Visual; ContentPresenter cp = null; if (navigator.Template != null) { cp = (ContentPresenter)navigator.Template.FindName(contentPresenterName, navigator); } // If null, eitheris not defined in the current template or the template // has not been applied yet. if (cp == null || cp.InternalVisualChildrenCount == 0/*Layout not done yet*/) return null; Visual v = cp.InternalGetVisualChild(0); return v; } }; } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Windows; using System.Windows.Navigation; using System.Windows.Controls; using System.Windows.Automation; using System.Windows.Media; using System.Globalization; using System.Diagnostics; using MS.Internal; namespace MS.Internal.AppModel { internal static class NavigationHelper { /// /// See INavigatorImpl.FindRootViewer(). /// internal static Visual FindRootViewer(ContentControl navigator, string contentPresenterName) { object content = navigator.Content; if (content == null || content is Visual) return content as Visual; ContentPresenter cp = null; if (navigator.Template != null) { cp = (ContentPresenter)navigator.Template.FindName(contentPresenterName, navigator); } // If null, eitheris not defined in the current template or the template // has not been applied yet. if (cp == null || cp.InternalVisualChildrenCount == 0/*Layout not done yet*/) return null; Visual v = cp.InternalGetVisualChild(0); return v; } }; } // 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
- RetrieveVirtualItemEventArgs.cs
- FatalException.cs
- sortedlist.cs
- WindowsAltTab.cs
- DelegateSerializationHolder.cs
- TypeReference.cs
- DragDropHelper.cs
- ToolboxComponentsCreatingEventArgs.cs
- BatchWriter.cs
- LinqDataSourceHelper.cs
- __ComObject.cs
- ResourceDictionary.cs
- DataGridTableCollection.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ExpressionPrefixAttribute.cs
- WindowsFormsDesignerOptionService.cs
- UITypeEditor.cs
- TypeDelegator.cs
- XslNumber.cs
- XmlDataSource.cs
- RequestCachingSection.cs
- ValidationErrorCollection.cs
- TrackingLocation.cs
- ToolBar.cs
- BindingWorker.cs
- ErrorHandlerModule.cs
- DataGridViewCellStyleConverter.cs
- SecurityUtils.cs
- BitmapDownload.cs
- CollectionViewProxy.cs
- PingOptions.cs
- SoapCodeExporter.cs
- SeparatorAutomationPeer.cs
- UnsafeNativeMethods.cs
- SerialPort.cs
- SectionRecord.cs
- XmlSchemaAny.cs
- LocalizationCodeDomSerializer.cs
- Trigger.cs
- ValidationEventArgs.cs
- DesignOnlyAttribute.cs
- ExitEventArgs.cs
- HttpException.cs
- X509CertificateClaimSet.cs
- XsdBuildProvider.cs
- GeneralTransformCollection.cs
- AdapterUtil.cs
- BufferedReceiveElement.cs
- Annotation.cs
- ProcessModelSection.cs
- ListViewAutomationPeer.cs
- BrushMappingModeValidation.cs
- RIPEMD160.cs
- URL.cs
- SchemaRegistration.cs
- ValueProviderWrapper.cs
- ConfigsHelper.cs
- NavigationPropertySingletonExpression.cs
- LinqDataSourceDeleteEventArgs.cs
- StringUtil.cs
- AuthenticodeSignatureInformation.cs
- GridViewHeaderRowPresenter.cs
- SqlClientMetaDataCollectionNames.cs
- Menu.cs
- PointCollection.cs
- DbParameterCollectionHelper.cs
- GenericWebPart.cs
- XmlWriterSettings.cs
- PropertyCollection.cs
- SatelliteContractVersionAttribute.cs
- StyleConverter.cs
- ListViewAutomationPeer.cs
- ModifierKeysValueSerializer.cs
- ApplicationDirectory.cs
- WindowInteractionStateTracker.cs
- BufferedGraphicsContext.cs
- DataControlFieldTypeEditor.cs
- SecondaryViewProvider.cs
- InteropBitmapSource.cs
- XmlSchemaSimpleTypeRestriction.cs
- PositiveTimeSpanValidatorAttribute.cs
- InstancePersistenceCommand.cs
- DNS.cs
- SimplePropertyEntry.cs
- CheckBoxRenderer.cs
- UpdatableGenericsFeature.cs
- CopyAttributesAction.cs
- RectangleGeometry.cs
- ReferenceEqualityComparer.cs
- WebControl.cs
- AccessibleObject.cs
- SecurityState.cs
- RoleService.cs
- ObjectViewEntityCollectionData.cs
- QilList.cs
- DataServiceQuery.cs
- SqlDataSourceQueryConverter.cs
- BitmapEffectCollection.cs
- ForceCopyBuildProvider.cs
- TraceHandler.cs