Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / AppModel / NavigationHelper.cs / 1305600 / 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
- ComponentEditorForm.cs
- ToolBar.cs
- FaultCallbackWrapper.cs
- ScriptingWebServicesSectionGroup.cs
- Control.cs
- CodeObjectCreateExpression.cs
- SplitterPanel.cs
- Double.cs
- BufferModeSettings.cs
- TableProviderWrapper.cs
- HtmlInputText.cs
- InvokePattern.cs
- XmlNamespaceDeclarationsAttribute.cs
- WebPartUserCapability.cs
- MetadataArtifactLoaderComposite.cs
- ColorTransform.cs
- SchemaNames.cs
- Bold.cs
- MessageAction.cs
- ConnectionPointCookie.cs
- ProxyBuilder.cs
- FreezableDefaultValueFactory.cs
- ErrorWebPart.cs
- OleDbMetaDataFactory.cs
- GifBitmapDecoder.cs
- Annotation.cs
- SchemaNamespaceManager.cs
- Point3DCollection.cs
- FilterQuery.cs
- Popup.cs
- SkipQueryOptionExpression.cs
- _ConnectStream.cs
- WindowsRebar.cs
- NotFiniteNumberException.cs
- ElementHostPropertyMap.cs
- CellConstantDomain.cs
- ImageBrush.cs
- MouseActionConverter.cs
- DropSource.cs
- FeatureSupport.cs
- MessageSecurityVersion.cs
- QuaternionValueSerializer.cs
- PropertyTabChangedEvent.cs
- DllNotFoundException.cs
- UnsignedPublishLicense.cs
- BaseTemplateParser.cs
- IssuedTokenClientElement.cs
- OneOfTypeConst.cs
- CodeSpit.cs
- Encoding.cs
- SingleObjectCollection.cs
- PrimitiveXmlSerializers.cs
- IERequestCache.cs
- SafeHandles.cs
- TemplateInstanceAttribute.cs
- EditorAttribute.cs
- RNGCryptoServiceProvider.cs
- ToolStripDesignerAvailabilityAttribute.cs
- WebPartZone.cs
- AxisAngleRotation3D.cs
- IntranetCredentialPolicy.cs
- xmlglyphRunInfo.cs
- HttpConfigurationContext.cs
- Container.cs
- ContentElement.cs
- TemplateInstanceAttribute.cs
- HtmlInputImage.cs
- TextBox.cs
- MemberDescriptor.cs
- HttpListenerPrefixCollection.cs
- WindowsIdentity.cs
- CacheAxisQuery.cs
- HttpCachePolicyWrapper.cs
- ListViewItem.cs
- SqlUnionizer.cs
- MultiPartWriter.cs
- SessionState.cs
- ThrowHelper.cs
- IndentedTextWriter.cs
- IncrementalReadDecoders.cs
- DataFormat.cs
- UrlParameterWriter.cs
- ConfigErrorGlyph.cs
- XmlnsPrefixAttribute.cs
- ProgressBar.cs
- DropShadowEffect.cs
- InputLanguageSource.cs
- codemethodreferenceexpression.cs
- ManualResetEvent.cs
- IdentityHolder.cs
- HtmlControl.cs
- CacheSection.cs
- ToolStripDropDownClosedEventArgs.cs
- Exception.cs
- ReadOnlyDataSourceView.cs
- DoubleCollectionConverter.cs
- DoubleKeyFrameCollection.cs
- QuaternionAnimation.cs
- HttpCookiesSection.cs
- DataGrid.cs