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
- ProcessHost.cs
- UInt64Storage.cs
- ConfigurationProperty.cs
- DecimalSumAggregationOperator.cs
- XmlElementAttribute.cs
- Stack.cs
- HttpCookieCollection.cs
- ZoneMembershipCondition.cs
- WebConfigurationManager.cs
- OrderedHashRepartitionStream.cs
- ReadOnlyCollectionBuilder.cs
- DBAsyncResult.cs
- WriterOutput.cs
- SqlDataSourceCache.cs
- CacheSection.cs
- IssuedTokenParametersElement.cs
- DataSourceHelper.cs
- IChannel.cs
- HotCommands.cs
- RegionIterator.cs
- BindingValueChangedEventArgs.cs
- TimeoutStream.cs
- oledbconnectionstring.cs
- SQLByteStorage.cs
- AttachInfo.cs
- TextBox.cs
- _LocalDataStore.cs
- FolderNameEditor.cs
- Scene3D.cs
- GenericEnumConverter.cs
- ParenExpr.cs
- MultiPartWriter.cs
- ValidationEventArgs.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- EntityModelBuildProvider.cs
- FileFormatException.cs
- DescendantBaseQuery.cs
- XmlLoader.cs
- EtwTrace.cs
- Sentence.cs
- XPathPatternBuilder.cs
- SoapRpcMethodAttribute.cs
- SerialPort.cs
- XmlSchemaAttributeGroup.cs
- Transaction.cs
- DataSourceSelectArguments.cs
- ContextInformation.cs
- EventRouteFactory.cs
- RectangleHotSpot.cs
- CompositeDesignerAccessibleObject.cs
- EventProxy.cs
- AssertUtility.cs
- XmlImplementation.cs
- SafeLibraryHandle.cs
- ParameterCollection.cs
- GcSettings.cs
- WebPartDescriptionCollection.cs
- PersonalizationEntry.cs
- HostingEnvironmentSection.cs
- OneToOneMappingSerializer.cs
- MonthChangedEventArgs.cs
- ClientData.cs
- ProviderException.cs
- ErrorReporting.cs
- ClonableStack.cs
- NoneExcludedImageIndexConverter.cs
- DefaultTraceListener.cs
- GenerateTemporaryTargetAssembly.cs
- ScriptBehaviorDescriptor.cs
- ParserOptions.cs
- ComponentRenameEvent.cs
- SyndicationDeserializer.cs
- URL.cs
- PropertyPushdownHelper.cs
- EntityDataSourceContainerNameConverter.cs
- FileChangesMonitor.cs
- DisableDpiAwarenessAttribute.cs
- ListComponentEditor.cs
- PartialCachingAttribute.cs
- InvalidDataContractException.cs
- PolicyLevel.cs
- AsyncPostBackTrigger.cs
- Help.cs
- Binding.cs
- ComponentEditorPage.cs
- ArgumentsParser.cs
- DbProviderManifest.cs
- activationcontext.cs
- Italic.cs
- MatrixCamera.cs
- TypeTypeConverter.cs
- RuntimeHandles.cs
- NotImplementedException.cs
- SerializationFieldInfo.cs
- SrgsElementFactoryCompiler.cs
- WmlLabelAdapter.cs
- Inflater.cs
- DataColumnPropertyDescriptor.cs
- MouseGestureValueSerializer.cs
- PreloadHost.cs