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
- DataFieldCollectionEditor.cs
- RouteParameter.cs
- BaseDataBoundControl.cs
- ButtonBase.cs
- TimeZoneNotFoundException.cs
- Application.cs
- ALinqExpressionVisitor.cs
- RawStylusInputCustomDataList.cs
- AdapterDictionary.cs
- QuaternionIndependentAnimationStorage.cs
- WebPartDisplayModeCancelEventArgs.cs
- ChangePassword.cs
- MessageQueueKey.cs
- Normalization.cs
- CodeSubDirectoriesCollection.cs
- WebBrowser.cs
- EditorZoneBase.cs
- ProfilePropertySettings.cs
- MenuCommands.cs
- TdsParserStaticMethods.cs
- GeometryModel3D.cs
- Axis.cs
- AutomationPeer.cs
- ItemAutomationPeer.cs
- DuplicateDetector.cs
- LiteralLink.cs
- Double.cs
- WebServiceHostFactory.cs
- SecurityPolicySection.cs
- AspNetSynchronizationContext.cs
- ReflectionServiceProvider.cs
- UnsafeNativeMethods.cs
- CheckBoxAutomationPeer.cs
- ScrollableControl.cs
- DelegatingTypeDescriptionProvider.cs
- HandlerBase.cs
- MeasureData.cs
- KeyFrames.cs
- QuadraticBezierSegment.cs
- EntityParameterCollection.cs
- ReadOnlyNameValueCollection.cs
- SafeRightsManagementSessionHandle.cs
- WebPartsPersonalization.cs
- CollectionViewGroupInternal.cs
- Evidence.cs
- ImageMetadata.cs
- UnicodeEncoding.cs
- HtmlShim.cs
- ContainsRowNumberChecker.cs
- IdentityReference.cs
- CodeGotoStatement.cs
- __TransparentProxy.cs
- Window.cs
- GridPatternIdentifiers.cs
- BaseParser.cs
- ControllableStoryboardAction.cs
- recordstate.cs
- ImageListStreamer.cs
- ReadOnlyDataSourceView.cs
- DataView.cs
- ExeContext.cs
- EntityContainerEmitter.cs
- PrintPreviewControl.cs
- HandledEventArgs.cs
- DetailsViewDeletedEventArgs.cs
- FileUpload.cs
- Crypto.cs
- DataControlHelper.cs
- NetCodeGroup.cs
- IriParsingElement.cs
- IssuedTokenClientBehaviorsElementCollection.cs
- DbSourceCommand.cs
- XmlTextReaderImpl.cs
- EtwTrace.cs
- ThicknessKeyFrameCollection.cs
- PermissionAttributes.cs
- DBPropSet.cs
- StylusDevice.cs
- HttpListener.cs
- DataSourceControlBuilder.cs
- DiagnosticTraceSource.cs
- SafeNativeMethods.cs
- PriorityRange.cs
- RulePatternOps.cs
- FileLogRecordEnumerator.cs
- LogLogRecordEnumerator.cs
- HttpListenerRequestUriBuilder.cs
- ThemeInfoAttribute.cs
- ActionFrame.cs
- UnaryNode.cs
- PeerNameRegistration.cs
- LogWriteRestartAreaState.cs
- SafeNativeMethodsMilCoreApi.cs
- CodeDelegateInvokeExpression.cs
- ComplexTypeEmitter.cs
- XmlnsCache.cs
- FeatureManager.cs
- ProfileSection.cs
- FileSystemInfo.cs
- HexParser.cs