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, eitheris 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, eitheris 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
- DataTableNewRowEvent.cs
- BlurEffect.cs
- StateBag.cs
- BooleanConverter.cs
- XamlClipboardData.cs
- PagesSection.cs
- XsltFunctions.cs
- GlyphInfoList.cs
- RegexRunner.cs
- CollectionBuilder.cs
- WebPartUserCapability.cs
- CapabilitiesPattern.cs
- KeyboardEventArgs.cs
- SamlAdvice.cs
- SimpleType.cs
- DotNetATv1WindowsLogEntrySerializer.cs
- WebHttpDispatchOperationSelector.cs
- FactoryGenerator.cs
- SegmentInfo.cs
- XmlHierarchicalDataSourceView.cs
- CriticalFinalizerObject.cs
- MinMaxParagraphWidth.cs
- Control.cs
- Viewport3DVisual.cs
- ConditionCollection.cs
- TextBox.cs
- FormsAuthentication.cs
- OdbcConnectionHandle.cs
- BufferBuilder.cs
- ProxyAttribute.cs
- ToolboxItemCollection.cs
- CellTreeSimplifier.cs
- PropertyRef.cs
- BuildResult.cs
- JsonServiceDocumentSerializer.cs
- FixedPage.cs
- Page.cs
- PropertyTabChangedEvent.cs
- AtomServiceDocumentSerializer.cs
- MaterialGroup.cs
- WebEventCodes.cs
- PropertyGridEditorPart.cs
- PanelStyle.cs
- ConsoleKeyInfo.cs
- OpenFileDialog.cs
- TypeEnumerableViewSchema.cs
- PropertyChangedEventManager.cs
- ActivityExecutor.cs
- HandlerBase.cs
- DesigntimeLicenseContextSerializer.cs
- AxisAngleRotation3D.cs
- HtmlWindow.cs
- SiteOfOriginPart.cs
- EditorZone.cs
- SpellerStatusTable.cs
- DataGridViewMethods.cs
- BStrWrapper.cs
- HandleCollector.cs
- PathGradientBrush.cs
- OdbcPermission.cs
- Line.cs
- ClickablePoint.cs
- TextRange.cs
- ServiceDescriptionImporter.cs
- RuntimeEnvironment.cs
- BitmapEffectInputData.cs
- CodeAccessSecurityEngine.cs
- OleDbWrapper.cs
- BindingExpressionBase.cs
- XPathNodeIterator.cs
- ObjectListFieldsPage.cs
- ObjectSet.cs
- DataGridViewSelectedColumnCollection.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- DeviceContexts.cs
- RijndaelManagedTransform.cs
- webbrowsersite.cs
- EditorPart.cs
- XmlSchemaInfo.cs
- assertwrapper.cs
- ClientConfigurationHost.cs
- PasswordDeriveBytes.cs
- AsynchronousChannel.cs
- FileSystemEventArgs.cs
- FigureParagraph.cs
- AutoGeneratedFieldProperties.cs
- StyleModeStack.cs
- FormatSettings.cs
- ColorTranslator.cs
- GridViewItemAutomationPeer.cs
- InheritanceAttribute.cs
- ApplicationServiceManager.cs
- GeneralTransform3D.cs
- DynamicQueryableWrapper.cs
- WebPageTraceListener.cs
- XmlElementCollection.cs
- TreeNodeBindingCollection.cs
- NegatedCellConstant.cs
- VirtualizedCellInfoCollection.cs
- Size.cs