Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- GlobalizationSection.cs
- AnnotationComponentManager.cs
- BinaryWriter.cs
- MouseBinding.cs
- SkewTransform.cs
- RetrieveVirtualItemEventArgs.cs
- WebControlsSection.cs
- RSAOAEPKeyExchangeDeformatter.cs
- RuntimeResourceSet.cs
- WorkflowOperationContext.cs
- CombinedGeometry.cs
- SmtpSection.cs
- SelectionItemPattern.cs
- HtmlInputText.cs
- DictionaryTraceRecord.cs
- AssemblyAttributes.cs
- DataTableMappingCollection.cs
- AccessControlEntry.cs
- TreeSet.cs
- AdjustableArrowCap.cs
- SByteConverter.cs
- EventLogPermission.cs
- SafePEFileHandle.cs
- XDeferredAxisSource.cs
- DetailsViewUpdateEventArgs.cs
- HighlightComponent.cs
- XPathException.cs
- SqlCommandSet.cs
- SerializationInfo.cs
- PeerObject.cs
- StoryFragments.cs
- SmiConnection.cs
- autovalidator.cs
- WindowsStatusBar.cs
- MediaContextNotificationWindow.cs
- Image.cs
- DecoratedNameAttribute.cs
- NavigationProperty.cs
- XmlSchemaImporter.cs
- SyndicationSerializer.cs
- DeviceSpecificChoiceCollection.cs
- EntitySetDataBindingList.cs
- DataSourceUtil.cs
- Image.cs
- SinglePageViewer.cs
- PersonalizationStateInfoCollection.cs
- ComboBoxAutomationPeer.cs
- Brush.cs
- xmlformatgeneratorstatics.cs
- SecurityRuntime.cs
- FunctionDescription.cs
- DataTableCollection.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- CodePageEncoding.cs
- loginstatus.cs
- CustomAttributeBuilder.cs
- CommandEventArgs.cs
- TransformedBitmap.cs
- BinaryParser.cs
- BitmapEffectInput.cs
- PropertyEntry.cs
- TraceListener.cs
- DesigntimeLicenseContextSerializer.cs
- SqlDataSourceFilteringEventArgs.cs
- WindowsServiceElement.cs
- Application.cs
- SimpleHandlerBuildProvider.cs
- DataGridViewUtilities.cs
- ReverseComparer.cs
- GenericParameterDataContract.cs
- PerformanceCounter.cs
- Property.cs
- XPathAxisIterator.cs
- BuiltInPermissionSets.cs
- StringKeyFrameCollection.cs
- Drawing.cs
- XmlText.cs
- ConfigurationStrings.cs
- FontUnit.cs
- ConnectionOrientedTransportChannelListener.cs
- MasterPage.cs
- TextEndOfLine.cs
- FigureHelper.cs
- wgx_render.cs
- XmlArrayAttribute.cs
- RegexTypeEditor.cs
- SelectionChangedEventArgs.cs
- CallTemplateAction.cs
- IImplicitResourceProvider.cs
- EntityCodeGenerator.cs
- Permission.cs
- DataRowView.cs
- GenericIdentity.cs
- OracleConnectionString.cs
- VersionPair.cs
- Switch.cs
- AddingNewEventArgs.cs
- HtmlEmptyTagControlBuilder.cs
- NumberSubstitution.cs
- ThemeDirectoryCompiler.cs