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
- ObjectConverter.cs
- GetUserPreferenceRequest.cs
- DataSetMappper.cs
- SymDocumentType.cs
- XmlWrappingReader.cs
- DataError.cs
- WebPartConnectionsEventArgs.cs
- NativeMethodsCLR.cs
- _ProxyChain.cs
- StorageSetMapping.cs
- TableAdapterManagerGenerator.cs
- PackUriHelper.cs
- EmptyReadOnlyDictionaryInternal.cs
- NullableDecimalAverageAggregationOperator.cs
- __FastResourceComparer.cs
- WebBodyFormatMessageProperty.cs
- XmlObjectSerializerReadContextComplexJson.cs
- PreservationFileReader.cs
- FillBehavior.cs
- IndexOutOfRangeException.cs
- AspNetHostingPermission.cs
- ProviderMetadataCachedInformation.cs
- ZoomPercentageConverter.cs
- CompiledXpathExpr.cs
- isolationinterop.cs
- ScrollItemPattern.cs
- XmlSchemaValidator.cs
- WindowShowOrOpenTracker.cs
- FrameSecurityDescriptor.cs
- AnnotationAuthorChangedEventArgs.cs
- ValuePattern.cs
- ScriptServiceAttribute.cs
- XmlEventCache.cs
- CommonDialog.cs
- XPathChildIterator.cs
- EventKeyword.cs
- _UriSyntax.cs
- Timeline.cs
- SharedStatics.cs
- MD5.cs
- AssemblyHelper.cs
- TextParaLineResult.cs
- CommonObjectSecurity.cs
- OrthographicCamera.cs
- MouseEvent.cs
- XamlToRtfWriter.cs
- ToolBarPanel.cs
- SimpleBitVector32.cs
- SendActivityValidator.cs
- HMACSHA384.cs
- ImagingCache.cs
- MaxMessageSizeStream.cs
- ElementsClipboardData.cs
- PageFunction.cs
- SQLMoneyStorage.cs
- Vector3D.cs
- Repeater.cs
- DataGridViewCellConverter.cs
- FixedSOMImage.cs
- Activator.cs
- NavigationPropertySingletonExpression.cs
- RtfFormatStack.cs
- HtmlTableCellCollection.cs
- AssemblyAttributesGoHere.cs
- UInt16Converter.cs
- InternalTypeHelper.cs
- ComboBoxItem.cs
- BinaryFormatter.cs
- StylusPointCollection.cs
- HtmlEncodedRawTextWriter.cs
- OleDbFactory.cs
- EntityTemplateFactory.cs
- UIEndRequest.cs
- QilBinary.cs
- MarkupProperty.cs
- IHttpResponseInternal.cs
- Menu.cs
- RealizedColumnsBlock.cs
- XmlTextReaderImpl.cs
- Attributes.cs
- XmlBinaryWriterSession.cs
- HtmlWindow.cs
- BmpBitmapDecoder.cs
- TextBox.cs
- BrowserTree.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- ToolStripRenderEventArgs.cs
- GeneralTransform.cs
- PrivilegedConfigurationManager.cs
- Zone.cs
- XmlSchemaInferenceException.cs
- MenuItemStyleCollection.cs
- BitmapCache.cs
- PocoEntityKeyStrategy.cs
- _BufferOffsetSize.cs
- ListMarkerSourceInfo.cs
- Style.cs
- IdentityModelStringsVersion1.cs
- ChtmlImageAdapter.cs
- BaseProcessor.cs