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
- PackagePart.cs
- NavigationHelper.cs
- DataMember.cs
- NumericExpr.cs
- FormsAuthenticationEventArgs.cs
- Oid.cs
- PipelineModuleStepContainer.cs
- Ticks.cs
- NetDataContractSerializer.cs
- IDQuery.cs
- FrameworkElementFactory.cs
- ToolStripItemTextRenderEventArgs.cs
- TemplatePropertyEntry.cs
- TemplatePropertyEntry.cs
- SchemaImporterExtensionsSection.cs
- EntityStoreSchemaFilterEntry.cs
- InputManager.cs
- VisualTreeUtils.cs
- BitmapEditor.cs
- securitymgrsite.cs
- NonClientArea.cs
- GroupItemAutomationPeer.cs
- ConfigurationCollectionAttribute.cs
- ListViewDataItem.cs
- CodeDOMUtility.cs
- XmlAttributes.cs
- TextBoxRenderer.cs
- HTMLTagNameToTypeMapper.cs
- ScopelessEnumAttribute.cs
- DesignerAdapterAttribute.cs
- LookupBindingPropertiesAttribute.cs
- ParentQuery.cs
- BatchParser.cs
- ToolStripItemCollection.cs
- XhtmlBasicLinkAdapter.cs
- SQLSingleStorage.cs
- SmiGettersStream.cs
- WindowsBrush.cs
- WebPartChrome.cs
- DefaultClaimSet.cs
- ToolBarTray.cs
- ViewStateChangedEventArgs.cs
- ConsoleCancelEventArgs.cs
- DynamicValidator.cs
- EdmValidator.cs
- CultureMapper.cs
- GridViewUpdateEventArgs.cs
- DataRowCollection.cs
- _OverlappedAsyncResult.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- CustomError.cs
- Screen.cs
- BuilderInfo.cs
- AvTrace.cs
- DeadCharTextComposition.cs
- HtmlEncodedRawTextWriter.cs
- XmlSignificantWhitespace.cs
- UnSafeCharBuffer.cs
- WebPartTransformer.cs
- RelatedCurrencyManager.cs
- DataServiceHostFactory.cs
- TdsParserHelperClasses.cs
- documentsequencetextview.cs
- KeyGestureValueSerializer.cs
- GlyphRun.cs
- HitTestWithPointDrawingContextWalker.cs
- EmbeddedMailObjectCollectionEditor.cs
- InheritanceContextHelper.cs
- MultipartContentParser.cs
- OdbcException.cs
- NullableBoolConverter.cs
- HiddenField.cs
- ScopedMessagePartSpecification.cs
- SafeFileHandle.cs
- MemoryMappedViewAccessor.cs
- OracleDateTime.cs
- AsyncSerializedWorker.cs
- SectionInput.cs
- SecurityManager.cs
- EmptyControlCollection.cs
- SqlCacheDependency.cs
- PathFigureCollectionConverter.cs
- UrlUtility.cs
- HtmlHistory.cs
- ControlBindingsCollection.cs
- TrustSection.cs
- ResourceManagerWrapper.cs
- CacheModeConverter.cs
- InvalidCommandTreeException.cs
- XPathNodeHelper.cs
- XmlLanguageConverter.cs
- LayoutExceptionEventArgs.cs
- filewebrequest.cs
- FaultException.cs
- ScopelessEnumAttribute.cs
- Switch.cs
- MulticastDelegate.cs
- Int32Collection.cs
- DbSourceCommand.cs
- DependsOnAttribute.cs