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, 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.
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
- XmlSchemaSimpleTypeUnion.cs
- GridViewRowEventArgs.cs
- IWorkflowDebuggerService.cs
- EdmSchemaError.cs
- FileEnumerator.cs
- RNGCryptoServiceProvider.cs
- __Filters.cs
- SoapInteropTypes.cs
- SrgsDocument.cs
- XmlLanguageConverter.cs
- PassportAuthentication.cs
- WebDescriptionAttribute.cs
- LogSwitch.cs
- RequestResizeEvent.cs
- messageonlyhwndwrapper.cs
- Expr.cs
- ComplexBindingPropertiesAttribute.cs
- ItemsPanelTemplate.cs
- SqlDataSourceQueryEditor.cs
- PathSegment.cs
- Command.cs
- ObjectToModelValueConverter.cs
- XXXInfos.cs
- Imaging.cs
- SkewTransform.cs
- ProgressPage.cs
- __ConsoleStream.cs
- DigitShape.cs
- WebPartConnectionsEventArgs.cs
- DocumentAutomationPeer.cs
- StackBuilderSink.cs
- StoragePropertyMapping.cs
- _emptywebproxy.cs
- DBSqlParserColumn.cs
- ContentType.cs
- BindingsCollection.cs
- ExtensionsSection.cs
- _LocalDataStoreMgr.cs
- ToolTipAutomationPeer.cs
- MimeFormReflector.cs
- XmlEntityReference.cs
- TimerElapsedEvenArgs.cs
- XmlDesigner.cs
- HitTestWithGeometryDrawingContextWalker.cs
- GCHandleCookieTable.cs
- CertificateReferenceElement.cs
- Attributes.cs
- SymbolEqualComparer.cs
- TagNameToTypeMapper.cs
- DataViewSetting.cs
- HttpModuleAction.cs
- AllMembershipCondition.cs
- TimerEventSubscription.cs
- CodeAttributeDeclaration.cs
- PropertyPathConverter.cs
- TypeUtils.cs
- ElementNotAvailableException.cs
- EdmEntityTypeAttribute.cs
- Util.cs
- WebServiceEnumData.cs
- TextEditorMouse.cs
- DataGridTableCollection.cs
- TextBox.cs
- StreamUpgradeBindingElement.cs
- QuaternionAnimation.cs
- Control.cs
- ServiceHostFactory.cs
- SourceFileInfo.cs
- TextEndOfSegment.cs
- PathSegment.cs
- XmlSerializer.cs
- CloseCryptoHandleRequest.cs
- VoiceChangeEventArgs.cs
- SoapServerProtocol.cs
- AccessibleObject.cs
- RequiredFieldValidator.cs
- HtmlSelect.cs
- Identity.cs
- XmlSerializerVersionAttribute.cs
- ProxyWebPartConnectionCollection.cs
- FormDocumentDesigner.cs
- SymbolType.cs
- WebHostUnsafeNativeMethods.cs
- ToolBarOverflowPanel.cs
- ItemList.cs
- ZoneMembershipCondition.cs
- CompoundFileDeflateTransform.cs
- ConfigPathUtility.cs
- GeneralTransformGroup.cs
- ProgressBar.cs
- VirtualizedContainerService.cs
- XmlQueryStaticData.cs
- ConsoleCancelEventArgs.cs
- ExtentKey.cs
- BinaryParser.cs
- EntityDataSourceSelectingEventArgs.cs
- ScriptBehaviorDescriptor.cs
- ByteConverter.cs
- ScriptDescriptor.cs
- Process.cs