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, 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
- StrongNameUtility.cs
- WebBrowserContainer.cs
- EllipseGeometry.cs
- Int64Converter.cs
- StyleSelector.cs
- ObjectIDGenerator.cs
- XmlSchemaSimpleTypeRestriction.cs
- Facet.cs
- SchemaSetCompiler.cs
- WindowsSecurityToken.cs
- SQLDecimal.cs
- CurrentChangingEventManager.cs
- AuthorizationRule.cs
- XmlWriter.cs
- SqlResolver.cs
- MemberCollection.cs
- GridViewUpdatedEventArgs.cs
- DesignerLinkAdapter.cs
- ObjectViewFactory.cs
- BitmapScalingModeValidation.cs
- ControlCommandSet.cs
- AssertUtility.cs
- __Error.cs
- PropertyIDSet.cs
- SelectionRange.cs
- DocumentsTrace.cs
- ToolStripComboBox.cs
- SqlDataRecord.cs
- SqlConnectionPoolProviderInfo.cs
- BrowserCapabilitiesCodeGenerator.cs
- PasswordRecovery.cs
- MsmqMessageSerializationFormat.cs
- PropertyGrid.cs
- MiniConstructorInfo.cs
- PhonemeEventArgs.cs
- CompilerErrorCollection.cs
- DataMisalignedException.cs
- ExtensionElement.cs
- SerializationException.cs
- UnsafeNativeMethodsPenimc.cs
- Assembly.cs
- ValidationEventArgs.cs
- ThreadPool.cs
- ProcessThreadCollection.cs
- SqlDataSourceView.cs
- CompiledQuery.cs
- CodeArrayCreateExpression.cs
- DataGridHyperlinkColumn.cs
- CodeAttachEventStatement.cs
- AppSettingsReader.cs
- ISAPIApplicationHost.cs
- SecureStringHasher.cs
- CatalogZoneBase.cs
- XsltFunctions.cs
- SingleStorage.cs
- SqlDataSourceCommandParser.cs
- ComponentChangedEvent.cs
- SystemPens.cs
- Dynamic.cs
- MetadataCollection.cs
- IPGlobalProperties.cs
- DocobjHost.cs
- SpecialNameAttribute.cs
- DocumentXPathNavigator.cs
- TableLayoutSettings.cs
- Decimal.cs
- SqlUdtInfo.cs
- TemplateLookupAction.cs
- ALinqExpressionVisitor.cs
- DataBoundControlHelper.cs
- SqlTypeSystemProvider.cs
- XmlQueryTypeFactory.cs
- ThousandthOfEmRealDoubles.cs
- ZipIOBlockManager.cs
- SoapReflectionImporter.cs
- CacheOutputQuery.cs
- AttributeEmitter.cs
- shaperfactoryquerycachekey.cs
- Pkcs7Recipient.cs
- ToggleButton.cs
- RadioButtonFlatAdapter.cs
- MultipartContentParser.cs
- RelationshipManager.cs
- FlowLayout.cs
- MSG.cs
- AttachInfo.cs
- Button.cs
- RectangleConverter.cs
- CollectionViewGroupInternal.cs
- DataGridViewCellCancelEventArgs.cs
- Pkcs7Signer.cs
- ApplicationInfo.cs
- util.cs
- LinqTreeNodeEvaluator.cs
- ProvidePropertyAttribute.cs
- QueryActivatableWorkflowsCommand.cs
- QueryGeneratorBase.cs
- KeyMatchBuilder.cs
- MbpInfo.cs
- HtmlImage.cs