Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / ContentOperations.cs / 1305600 / 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
- PrimitiveCodeDomSerializer.cs
- TextEndOfParagraph.cs
- TCPListener.cs
- Math.cs
- DoubleAnimationUsingKeyFrames.cs
- CodeChecksumPragma.cs
- CodeDirectiveCollection.cs
- ApplicationHost.cs
- SimpleLine.cs
- LZCodec.cs
- TailPinnedEventArgs.cs
- DefaultBindingPropertyAttribute.cs
- StorageScalarPropertyMapping.cs
- DataServiceContext.cs
- ExtendedPropertyCollection.cs
- TrackingConditionCollection.cs
- RadialGradientBrush.cs
- AddToCollection.cs
- OuterGlowBitmapEffect.cs
- RolePrincipal.cs
- DetailsViewActionList.cs
- TableLayoutSettings.cs
- ExtenderProvidedPropertyAttribute.cs
- SHA1CryptoServiceProvider.cs
- CompensationToken.cs
- CounterSet.cs
- EncoderReplacementFallback.cs
- NamedPermissionSet.cs
- ScriptControlManager.cs
- ProxyAttribute.cs
- WindowsScrollBarBits.cs
- ContentPlaceHolder.cs
- SmiRecordBuffer.cs
- EditorPartChrome.cs
- SoapProtocolReflector.cs
- XamlFigureLengthSerializer.cs
- SymmetricAlgorithm.cs
- IDQuery.cs
- XmlMemberMapping.cs
- DataGrid.cs
- MimeObjectFactory.cs
- PeerContact.cs
- CodePageUtils.cs
- ResourcePool.cs
- CodeDirectionExpression.cs
- XmlSchemaInferenceException.cs
- EDesignUtil.cs
- RenderDataDrawingContext.cs
- Group.cs
- WinFormsComponentEditor.cs
- SmtpFailedRecipientsException.cs
- ToolStripRenderer.cs
- WebMessageEncoderFactory.cs
- RequestValidator.cs
- MaskedTextBoxDesigner.cs
- XmlValidatingReader.cs
- UrlPath.cs
- PropertyCondition.cs
- PathNode.cs
- Point3DValueSerializer.cs
- ViewBase.cs
- WebPartConnectionCollection.cs
- AnnotationResourceChangedEventArgs.cs
- RawStylusInputCustomData.cs
- MethodSignatureGenerator.cs
- ProvidePropertyAttribute.cs
- TextEditorTyping.cs
- LookupBindingPropertiesAttribute.cs
- PersonalizationProvider.cs
- ListenerConfig.cs
- HwndMouseInputProvider.cs
- StyleModeStack.cs
- BitmapMetadataBlob.cs
- PartialCachingAttribute.cs
- WindowsMenu.cs
- ContentElement.cs
- GroupDescription.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- GridViewHeaderRowPresenter.cs
- TranslateTransform.cs
- Transactions.cs
- SpellerHighlightLayer.cs
- DeviceSpecificChoiceCollection.cs
- InvalidOperationException.cs
- XmlElementList.cs
- TableColumn.cs
- HtmlInputControl.cs
- TableLayoutPanelDesigner.cs
- DBCommandBuilder.cs
- ScriptModule.cs
- DataMemberFieldConverter.cs
- DriveNotFoundException.cs
- TextEditorContextMenu.cs
- LayoutTableCell.cs
- ObjectQuery.cs
- TimeSpanStorage.cs
- ImmutableObjectAttribute.cs
- AnonymousIdentificationModule.cs
- BCLDebug.cs
- StylusTouchDevice.cs