Code:
/ 4.0 / 4.0 / untmp / 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, either is 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
- InvokePatternIdentifiers.cs
- ClockController.cs
- ASCIIEncoding.cs
- Mutex.cs
- Image.cs
- CapabilitiesPattern.cs
- CustomExpression.cs
- XmlFormatReaderGenerator.cs
- ThicknessAnimation.cs
- PeerToPeerException.cs
- ApplicationFileCodeDomTreeGenerator.cs
- XamlFilter.cs
- DropTarget.cs
- ExceptionTranslationTable.cs
- Exception.cs
- RefExpr.cs
- _Events.cs
- ResourceDisplayNameAttribute.cs
- DataListItemEventArgs.cs
- DataSourceBooleanViewSchemaConverter.cs
- ConsumerConnectionPoint.cs
- SHA256.cs
- Task.cs
- WindowsSspiNegotiation.cs
- AsyncCallback.cs
- ServerIdentity.cs
- OuterGlowBitmapEffect.cs
- EventManager.cs
- ExecutedRoutedEventArgs.cs
- ApplicationId.cs
- DataGridDetailsPresenterAutomationPeer.cs
- ClassDataContract.cs
- SyndicationSerializer.cs
- DataIdProcessor.cs
- Logging.cs
- ISFTagAndGuidCache.cs
- AtomParser.cs
- MulticastNotSupportedException.cs
- ImageFormat.cs
- XMLSchema.cs
- OrderedDictionary.cs
- ScrollEventArgs.cs
- ParallelEnumerable.cs
- WindowsAltTab.cs
- WSHttpTransportSecurityElement.cs
- WindowsTooltip.cs
- ClipboardData.cs
- DocComment.cs
- TemplateField.cs
- XmlSchemaAny.cs
- DecimalAnimation.cs
- WorkflowServiceHostFactory.cs
- LayoutTable.cs
- Separator.cs
- LinkConverter.cs
- SynchronizationLockException.cs
- QilNode.cs
- DataGridDetailsPresenterAutomationPeer.cs
- TextSimpleMarkerProperties.cs
- TrackingProfileSerializer.cs
- DataTrigger.cs
- StrongNamePublicKeyBlob.cs
- GeneralTransformGroup.cs
- ObjectCloneHelper.cs
- FormatException.cs
- StructuredTypeEmitter.cs
- DecimalKeyFrameCollection.cs
- DataGridViewEditingControlShowingEventArgs.cs
- FilterElement.cs
- WCFBuildProvider.cs
- PenContext.cs
- SamlSubject.cs
- TextServicesDisplayAttribute.cs
- input.cs
- bindurihelper.cs
- DataControlCommands.cs
- DataGridViewBindingCompleteEventArgs.cs
- connectionpool.cs
- CodeGenerator.cs
- Point.cs
- CaseStatementProjectedSlot.cs
- QuaternionIndependentAnimationStorage.cs
- NavigatingCancelEventArgs.cs
- StrokeCollectionDefaultValueFactory.cs
- HtmlEmptyTagControlBuilder.cs
- TypeTypeConverter.cs
- XmlTextEncoder.cs
- processwaithandle.cs
- GACIdentityPermission.cs
- LateBoundBitmapDecoder.cs
- Accessible.cs
- AttributeQuery.cs
- Identity.cs
- CultureSpecificStringDictionary.cs
- XmlCharType.cs
- NativeMethods.cs
- HttpModulesSection.cs
- EncryptedType.cs
- MetricEntry.cs
- ViewGenerator.cs