Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- BuildProviderAppliesToAttribute.cs
- PanelStyle.cs
- BinaryWriter.cs
- SettingsBase.cs
- _FtpControlStream.cs
- MatchAttribute.cs
- MediaSystem.cs
- FrameworkElementFactory.cs
- WorkflowInstanceExtensionProvider.cs
- ScriptBehaviorDescriptor.cs
- HttpCookiesSection.cs
- ToolboxItem.cs
- EventLog.cs
- AuthorizationRuleCollection.cs
- BuilderPropertyEntry.cs
- BufferedWebEventProvider.cs
- AsymmetricSignatureDeformatter.cs
- Token.cs
- PropertyCondition.cs
- XsltQilFactory.cs
- ObjectViewListener.cs
- EntityClientCacheKey.cs
- QilSortKey.cs
- SqlStream.cs
- SiteOfOriginPart.cs
- SoapException.cs
- ObjectToIdCache.cs
- AlternateViewCollection.cs
- RenderData.cs
- TypeUsageBuilder.cs
- CodeAttributeDeclaration.cs
- HwndKeyboardInputProvider.cs
- PerfService.cs
- UInt32.cs
- Rule.cs
- XmlTextReader.cs
- ComponentRenameEvent.cs
- ColumnResizeAdorner.cs
- SqlNotificationRequest.cs
- CaseInsensitiveHashCodeProvider.cs
- VideoDrawing.cs
- PropertyInfoSet.cs
- wpf-etw.cs
- PlainXmlDeserializer.cs
- ErrorRuntimeConfig.cs
- InternalBase.cs
- WebCategoryAttribute.cs
- MaterialCollection.cs
- DbParameterCollection.cs
- OdbcConnectionStringbuilder.cs
- AutomationPropertyInfo.cs
- LogSwitch.cs
- IncrementalCompileAnalyzer.cs
- WebBrowser.cs
- ImageBrush.cs
- WebPartActionVerb.cs
- FontCollection.cs
- XmlSchemaInclude.cs
- FileDocument.cs
- NamedElement.cs
- List.cs
- CodeBlockBuilder.cs
- LongValidator.cs
- DesignerVerbCollection.cs
- Clause.cs
- VisualStyleRenderer.cs
- RawMouseInputReport.cs
- ControlTemplate.cs
- AncillaryOps.cs
- UnsafeNativeMethods.cs
- BlobPersonalizationState.cs
- EndpointBehaviorElementCollection.cs
- ScriptReferenceBase.cs
- GridViewPageEventArgs.cs
- SqlUtil.cs
- MenuItemStyle.cs
- HistoryEventArgs.cs
- HatchBrush.cs
- InputReferenceExpression.cs
- OracleTimeSpan.cs
- SoapRpcServiceAttribute.cs
- Animatable.cs
- ReadOnlyHierarchicalDataSourceView.cs
- __Filters.cs
- TimeSpanConverter.cs
- StringPropertyBuilder.cs
- Part.cs
- EventListener.cs
- OracleLob.cs
- GeometryGroup.cs
- ListViewAutomationPeer.cs
- SQLResource.cs
- KeySpline.cs
- LoadedEvent.cs
- ObjectSet.cs
- DesignTimeTemplateParser.cs
- StateRuntime.cs
- VisualStyleTypesAndProperties.cs
- OleDbReferenceCollection.cs
- TransformationRules.cs