Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- HashAlgorithm.cs
- BridgeDataRecord.cs
- RecognitionResult.cs
- ModelVisual3D.cs
- MethodBody.cs
- AutoFocusStyle.xaml.cs
- UnsafeNativeMethods.cs
- XmlHierarchicalEnumerable.cs
- UserNameServiceElement.cs
- UInt16Converter.cs
- ImmutableObjectAttribute.cs
- ConfigXmlElement.cs
- RectValueSerializer.cs
- TabPage.cs
- ResXFileRef.cs
- VisualStyleTypesAndProperties.cs
- SerializationInfoEnumerator.cs
- CmsUtils.cs
- Match.cs
- Graph.cs
- GridViewCellAutomationPeer.cs
- sitestring.cs
- SystemUdpStatistics.cs
- CopyAttributesAction.cs
- TrackingRecord.cs
- HealthMonitoringSectionHelper.cs
- DependencyPropertyDescriptor.cs
- WebPartExportVerb.cs
- InvalidCastException.cs
- XmlSchemaSimpleContentRestriction.cs
- TraceEventCache.cs
- PropertyMapper.cs
- WebPartCatalogCloseVerb.cs
- GrammarBuilderBase.cs
- WebPartHelpVerb.cs
- EndOfStreamException.cs
- ComponentEditorForm.cs
- GridViewRowPresenter.cs
- CollectionViewProxy.cs
- WebFaultException.cs
- SymmetricAlgorithm.cs
- InstanceNotReadyException.cs
- LicenseContext.cs
- UserControl.cs
- InProcStateClientManager.cs
- TextProperties.cs
- Int32AnimationUsingKeyFrames.cs
- InspectionWorker.cs
- RoutedUICommand.cs
- XmlNodeList.cs
- ClientData.cs
- WeakReadOnlyCollection.cs
- Geometry3D.cs
- AsymmetricSecurityProtocolFactory.cs
- SQLDecimal.cs
- EntityCommand.cs
- XmlStreamedByteStreamReader.cs
- RelatedCurrencyManager.cs
- VirtualPathProvider.cs
- XmlSchemaException.cs
- SHA512Managed.cs
- IPGlobalProperties.cs
- StructuralType.cs
- FormDesigner.cs
- ReadWriteObjectLock.cs
- ArcSegment.cs
- MappingMetadataHelper.cs
- CompilationUnit.cs
- UpDownEvent.cs
- OdbcConnectionHandle.cs
- ErrorWebPart.cs
- DataSpaceManager.cs
- PageFunction.cs
- RowVisual.cs
- Double.cs
- SettingsAttributeDictionary.cs
- _ListenerAsyncResult.cs
- TimerEventSubscription.cs
- TableRowCollection.cs
- ToolStripSplitButton.cs
- SystemIPInterfaceProperties.cs
- PrimitiveType.cs
- HelpEvent.cs
- AssociationType.cs
- SqlDelegatedTransaction.cs
- DynamicMethod.cs
- Decimal.cs
- InputLanguage.cs
- SignatureResourcePool.cs
- COM2PictureConverter.cs
- JpegBitmapDecoder.cs
- WizardStepBase.cs
- StorageBasedPackageProperties.cs
- DataGridPagerStyle.cs
- LinqMaximalSubtreeNominator.cs
- FileDialog_Vista_Interop.cs
- SqlEnums.cs
- BitmapCodecInfoInternal.cs
- DataChangedEventManager.cs
- FloaterBaseParaClient.cs