Code:
/ 4.0 / 4.0 / 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.
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
- AppSettings.cs
- XmlIncludeAttribute.cs
- DesignerCommandAdapter.cs
- ManualWorkflowSchedulerService.cs
- ServicesExceptionNotHandledEventArgs.cs
- WebPartMenu.cs
- DbExpressionVisitor_TResultType.cs
- FixedSOMLineRanges.cs
- TemplateBindingExtension.cs
- SQLDecimalStorage.cs
- XmlAnyAttributeAttribute.cs
- TextServicesProperty.cs
- RegexGroupCollection.cs
- ErrorStyle.cs
- EmptyQuery.cs
- ReadOnlyTernaryTree.cs
- GPRECT.cs
- HttpListenerTimeoutManager.cs
- InternalSafeNativeMethods.cs
- Table.cs
- Helpers.cs
- WebSysDisplayNameAttribute.cs
- BaseParser.cs
- Panel.cs
- XPathNavigatorException.cs
- ObfuscationAttribute.cs
- DefaultValueTypeConverter.cs
- BindableTemplateBuilder.cs
- PersistChildrenAttribute.cs
- CrossSiteScriptingValidation.cs
- MemberCollection.cs
- LifetimeServices.cs
- FormatterConverter.cs
- SystemResources.cs
- TreeNodeCollectionEditor.cs
- ThreadPool.cs
- QilNode.cs
- CallbackValidatorAttribute.cs
- PerformanceCountersElement.cs
- GcSettings.cs
- WindowsFormsSectionHandler.cs
- FastEncoderWindow.cs
- SafeHandle.cs
- MemoryMappedViewAccessor.cs
- RemotingServices.cs
- ReadingWritingEntityEventArgs.cs
- ToolBarButton.cs
- SqlCaseSimplifier.cs
- XmlException.cs
- XmlSchemaComplexContent.cs
- MatrixKeyFrameCollection.cs
- XmlParserContext.cs
- CommandEventArgs.cs
- InfoCardTrace.cs
- ToolStripSystemRenderer.cs
- ArglessEventHandlerProxy.cs
- TemplateColumn.cs
- ConsoleTraceListener.cs
- TerminateWorkflow.cs
- DataListCommandEventArgs.cs
- AsymmetricAlgorithm.cs
- CookieHandler.cs
- ElementNotAvailableException.cs
- TextBoxAutomationPeer.cs
- PropertySet.cs
- NotificationContext.cs
- ColorConvertedBitmap.cs
- XamlNamespaceHelper.cs
- ReaderWriterLockWrapper.cs
- NonSerializedAttribute.cs
- WebControlParameterProxy.cs
- HttpApplicationFactory.cs
- InternalEnumValidator.cs
- CancelEventArgs.cs
- httpstaticobjectscollection.cs
- ToolStripGrip.cs
- DateTimeStorage.cs
- TextBoxAutomationPeer.cs
- AdditionalEntityFunctions.cs
- AssociationTypeEmitter.cs
- EntityDescriptor.cs
- CompilerScope.Storage.cs
- HostedNamedPipeTransportManager.cs
- ClientSettingsProvider.cs
- ApplicationDirectory.cs
- LinearQuaternionKeyFrame.cs
- HandlerBase.cs
- TableItemProviderWrapper.cs
- ToolZone.cs
- BypassElement.cs
- CreateRefExpr.cs
- UnmanagedHandle.cs
- SessionStateModule.cs
- EventLogPermissionEntryCollection.cs
- DirectionalLight.cs
- CollectionEditorDialog.cs
- Html32TextWriter.cs
- SizeConverter.cs
- CodeCastExpression.cs
- ProfilePropertyNameValidator.cs