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
- JsonSerializer.cs
- ExclusiveTcpListener.cs
- SqlMetaData.cs
- SafeArrayRankMismatchException.cs
- TypefaceMap.cs
- XmlDocument.cs
- QilScopedVisitor.cs
- ReadOnlyPropertyMetadata.cs
- GlobalizationSection.cs
- XmlSerializationWriter.cs
- LayoutDump.cs
- InputScopeNameConverter.cs
- updatecommandorderer.cs
- StateItem.cs
- MimeMultiPart.cs
- ReadOnlyPropertyMetadata.cs
- invalidudtexception.cs
- ValidationSettings.cs
- AsymmetricSignatureDeformatter.cs
- PkcsMisc.cs
- DataGridViewCellStyleConverter.cs
- Clause.cs
- Win32.cs
- UInt32Storage.cs
- ItemsPresenter.cs
- SerTrace.cs
- SupportsEventValidationAttribute.cs
- PageCatalogPartDesigner.cs
- _FixedSizeReader.cs
- BindingsCollection.cs
- RepeatButton.cs
- AuthorizationRule.cs
- StringUtil.cs
- Wildcard.cs
- IsolatedStorage.cs
- CodeNamespaceImport.cs
- ActiveDocumentEvent.cs
- TextSelectionHelper.cs
- GenericWebPart.cs
- ModuleElement.cs
- IntSecurity.cs
- TheQuery.cs
- UInt32Converter.cs
- RadioButtonBaseAdapter.cs
- DirectoryInfo.cs
- ColumnReorderedEventArgs.cs
- Int16AnimationUsingKeyFrames.cs
- WrappedKeySecurityTokenParameters.cs
- coordinator.cs
- WorkflowClientDeliverMessageWrapper.cs
- SQLByte.cs
- WindowShowOrOpenTracker.cs
- XmlSchemaSimpleTypeList.cs
- LookupNode.cs
- DecimalAnimationBase.cs
- SafeIUnknown.cs
- PrtCap_Base.cs
- OutOfMemoryException.cs
- ArithmeticException.cs
- TemplateInstanceAttribute.cs
- Point3DAnimation.cs
- Vector3DKeyFrameCollection.cs
- AbstractSvcMapFileLoader.cs
- BookmarkOptionsHelper.cs
- AccessViolationException.cs
- DecimalConverter.cs
- Part.cs
- IMembershipProvider.cs
- StreamReader.cs
- MutexSecurity.cs
- DependencyPropertyValueSerializer.cs
- TemplateEditingVerb.cs
- Repeater.cs
- XmlElementAttribute.cs
- ServicesUtilities.cs
- NetworkAddressChange.cs
- ListViewGroupConverter.cs
- TextBoxRenderer.cs
- PersonalizationDictionary.cs
- SpellerHighlightLayer.cs
- TextParentUndoUnit.cs
- DataGridViewRowCollection.cs
- WebUtil.cs
- NativeCppClassAttribute.cs
- EncoderReplacementFallback.cs
- SiteMap.cs
- HttpServerVarsCollection.cs
- CornerRadius.cs
- ResourceDictionaryCollection.cs
- PieceNameHelper.cs
- CallSiteBinder.cs
- TraceContextRecord.cs
- WebBrowserNavigatingEventHandler.cs
- AsyncCompletedEventArgs.cs
- DataTemplate.cs
- SiteMapNodeCollection.cs
- CellTreeNode.cs
- DetailsViewPageEventArgs.cs
- mediaeventargs.cs
- IncrementalCompileAnalyzer.cs