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
- ThicknessAnimation.cs
- UIElementPropertyUndoUnit.cs
- MaskDescriptor.cs
- LongValidatorAttribute.cs
- HttpDictionary.cs
- Emitter.cs
- MappingItemCollection.cs
- InstancePersistenceEvent.cs
- Material.cs
- XamlToRtfParser.cs
- FixedSOMTableCell.cs
- WebPartEditVerb.cs
- SettingsProviderCollection.cs
- SynchronousChannel.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- WindowsListViewSubItem.cs
- Route.cs
- ImageDrawing.cs
- SqlNamer.cs
- XsdDuration.cs
- RecognizedAudio.cs
- Constants.cs
- FileInfo.cs
- ToolStripItemEventArgs.cs
- StreamGeometryContext.cs
- IdentityHolder.cs
- Point4D.cs
- TypeDefinition.cs
- PbrsForward.cs
- TextSelectionHighlightLayer.cs
- HierarchicalDataTemplate.cs
- BaseTreeIterator.cs
- _AcceptOverlappedAsyncResult.cs
- XmlAnyAttributeAttribute.cs
- SchemaTableOptionalColumn.cs
- VirtualPathData.cs
- DataGridViewComponentPropertyGridSite.cs
- SmtpLoginAuthenticationModule.cs
- CodeTypeReferenceCollection.cs
- IsolatedStoragePermission.cs
- WebConfigurationHostFileChange.cs
- PageEventArgs.cs
- FixedSOMPage.cs
- FileChangeNotifier.cs
- EndpointInstanceProvider.cs
- Funcletizer.cs
- ReflectEventDescriptor.cs
- ThreadInterruptedException.cs
- LoginDesignerUtil.cs
- AttachedAnnotation.cs
- TextRangeBase.cs
- OneToOneMappingSerializer.cs
- CompModSwitches.cs
- DataGridViewCellStyle.cs
- UshortList2.cs
- CookieParameter.cs
- Grant.cs
- SqlCacheDependencySection.cs
- SettingsAttributes.cs
- TransformConverter.cs
- AutomationPattern.cs
- FrameworkEventSource.cs
- DataGridViewRowsAddedEventArgs.cs
- MatrixAnimationUsingKeyFrames.cs
- SingleObjectCollection.cs
- ActivityWithResultValueSerializer.cs
- ToolStripSplitButton.cs
- MutexSecurity.cs
- ThicknessAnimation.cs
- Viewport3DAutomationPeer.cs
- TCPListener.cs
- HttpProfileGroupBase.cs
- GreenMethods.cs
- Visual3DCollection.cs
- DetailsViewPagerRow.cs
- XslNumber.cs
- OperandQuery.cs
- ConfigurationValidatorAttribute.cs
- SocketPermission.cs
- HtmlTernaryTree.cs
- Rect3DValueSerializer.cs
- InkCollectionBehavior.cs
- TableCellAutomationPeer.cs
- ConversionContext.cs
- PermissionListSet.cs
- CompositeFontFamily.cs
- glyphs.cs
- HttpApplicationStateWrapper.cs
- IsolatedStorageException.cs
- Attributes.cs
- TextPattern.cs
- SendKeys.cs
- ItemCollection.cs
- _BufferOffsetSize.cs
- DecimalConstantAttribute.cs
- RuleElement.cs
- ResolveCriteriaApril2005.cs
- WindowsListViewGroup.cs
- ClientFormsAuthenticationCredentials.cs
- LayoutSettings.cs