Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / System / Windows / ContentOperations.cs / 1 / ContentOperations.cs
namespace System.Windows { ////// This interface defines the common methods and services available from a ContentElement. /// public static class ContentOperations { ////// Get the Visual parent of this ContentElement. /// public static DependencyObject GetParent(ContentElement reference) { if(reference == null) { throw new ArgumentNullException("reference"); } return reference._parent; } ////// Set the Visual parent of this ContentElement. /// ////// This is different than Visuals. For Visuals, you have to /// Add/Remove the visual from a children collection to change /// the parent. I think it is a better model, but I don't /// know if we want to expose a full children collection for /// content elements. /// public static void SetParent(ContentElement reference, DependencyObject parent) { if(reference == null) { throw new ArgumentNullException("reference"); } DependencyObject oldParent = reference._parent; reference._parent = parent; // Raise content parent changed notification reference.OnContentParentChanged(oldParent); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Windows { ////// This interface defines the common methods and services available from a ContentElement. /// public static class ContentOperations { ////// Get the Visual parent of this ContentElement. /// public static DependencyObject GetParent(ContentElement reference) { if(reference == null) { throw new ArgumentNullException("reference"); } return reference._parent; } ////// Set the Visual parent of this ContentElement. /// ////// This is different than Visuals. For Visuals, you have to /// Add/Remove the visual from a children collection to change /// the parent. I think it is a better model, but I don't /// know if we want to expose a full children collection for /// content elements. /// public static void SetParent(ContentElement reference, DependencyObject parent) { if(reference == null) { throw new ArgumentNullException("reference"); } DependencyObject oldParent = reference._parent; reference._parent = parent; // Raise content parent changed notification reference.OnContentParentChanged(oldParent); } } } // 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
- AppDomainFactory.cs
- ComponentResourceKey.cs
- SponsorHelper.cs
- IsolationInterop.cs
- SessionIDManager.cs
- WebControlAdapter.cs
- EntityViewGenerationConstants.cs
- NotFiniteNumberException.cs
- GradientStop.cs
- DateTimeConstantAttribute.cs
- ObjectTag.cs
- XPathSelfQuery.cs
- TcpClientCredentialType.cs
- XmlJsonReader.cs
- EFTableProvider.cs
- SamlAuthorizationDecisionStatement.cs
- ClassGenerator.cs
- DbConnectionPoolOptions.cs
- SessionStateUtil.cs
- ScriptManager.cs
- Random.cs
- Duration.cs
- LinkDesigner.cs
- WindowsTab.cs
- MapPathBasedVirtualPathProvider.cs
- XmlHierarchyData.cs
- DataQuery.cs
- ObjectViewFactory.cs
- DataRelationCollection.cs
- IgnoreSection.cs
- NativeMethods.cs
- Positioning.cs
- XmlValidatingReader.cs
- FixedSOMPage.cs
- XmlReader.cs
- COM2EnumConverter.cs
- FileLevelControlBuilderAttribute.cs
- XPathNavigatorKeyComparer.cs
- QilGenerator.cs
- TypeConstant.cs
- SrgsToken.cs
- SqlProcedureAttribute.cs
- WinEventQueueItem.cs
- SecurityIdentifierElementCollection.cs
- ReadOnlyDictionary.cs
- ProfileParameter.cs
- DataGridState.cs
- RowsCopiedEventArgs.cs
- ClickablePoint.cs
- BoundPropertyEntry.cs
- SoapHelper.cs
- ComboBoxDesigner.cs
- EditingCommands.cs
- StateChangeEvent.cs
- Thickness.cs
- SchemaSetCompiler.cs
- SymbolMethod.cs
- CfgSemanticTag.cs
- PanelStyle.cs
- TryCatch.cs
- CodeTypeDeclaration.cs
- ServiceDocument.cs
- ThousandthOfEmRealPoints.cs
- EdmSchemaError.cs
- RegexMatch.cs
- TextEditorLists.cs
- RawUIStateInputReport.cs
- ScaleTransform3D.cs
- CustomLineCap.cs
- OleDbParameterCollection.cs
- DbTransaction.cs
- Directory.cs
- _SSPIWrapper.cs
- RoleService.cs
- ObjectDataSource.cs
- SeparatorAutomationPeer.cs
- SqlDataSourceQueryEditor.cs
- Nodes.cs
- CompilationPass2TaskInternal.cs
- PseudoWebRequest.cs
- Mouse.cs
- GradientStop.cs
- GrammarBuilderRuleRef.cs
- X509Utils.cs
- ContextMarshalException.cs
- FormCollection.cs
- ValidationErrorInfo.cs
- GetPageCompletedEventArgs.cs
- NodeFunctions.cs
- WebPartExportVerb.cs
- FilterableAttribute.cs
- RSAProtectedConfigurationProvider.cs
- HttpPostedFileWrapper.cs
- dbenumerator.cs
- WindowsStatic.cs
- SapiRecoInterop.cs
- GlobalizationSection.cs
- SQLInt16Storage.cs
- TcpHostedTransportConfiguration.cs
- InputLanguageCollection.cs