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
- SrgsRule.cs
- Gdiplus.cs
- SecurityTokenSerializer.cs
- EntitySet.cs
- ModuleBuilder.cs
- PagedDataSource.cs
- AnnotationHighlightLayer.cs
- DependencyObjectPropertyDescriptor.cs
- DynamicDiscoveryDocument.cs
- DesignerUtility.cs
- XmlAnyElementAttribute.cs
- TriggerActionCollection.cs
- WebPartsPersonalizationAuthorization.cs
- StorageEntityTypeMapping.cs
- IMembershipProvider.cs
- LoadGrammarCompletedEventArgs.cs
- ContentOperations.cs
- Splitter.cs
- WorkflowInstanceRecord.cs
- CodeIdentifiers.cs
- ReadOnlyCollectionBase.cs
- AsyncResult.cs
- MemberHolder.cs
- Zone.cs
- XsltContext.cs
- MessageBox.cs
- ReferentialConstraintRoleElement.cs
- HtmlTextBoxAdapter.cs
- XmlQueryCardinality.cs
- HashSet.cs
- _RequestCacheProtocol.cs
- ZipIOBlockManager.cs
- EntityDataSourceViewSchema.cs
- ReadingWritingEntityEventArgs.cs
- AutomationElement.cs
- Mappings.cs
- PrimitiveSchema.cs
- SchemaObjectWriter.cs
- FontCacheLogic.cs
- CompositionAdorner.cs
- AppearanceEditorPart.cs
- ToolStripItemTextRenderEventArgs.cs
- FileDialogCustomPlace.cs
- CurrentChangingEventManager.cs
- TracedNativeMethods.cs
- ZipIOExtraFieldPaddingElement.cs
- CloseCollectionAsyncResult.cs
- AsymmetricSignatureDeformatter.cs
- SqlFunctionAttribute.cs
- OutputScopeManager.cs
- EntityDataSourceChangingEventArgs.cs
- ComboBox.cs
- OdbcRowUpdatingEvent.cs
- ToolStripGrip.cs
- StreamWriter.cs
- TemplateParser.cs
- InteropAutomationProvider.cs
- PropertyPushdownHelper.cs
- DescendentsWalker.cs
- EventSetter.cs
- CreateUserWizard.cs
- SchemaInfo.cs
- UpdatePanel.cs
- XmlSerializerVersionAttribute.cs
- SessionPageStateSection.cs
- HtmlControl.cs
- CompiledRegexRunner.cs
- WindowHideOrCloseTracker.cs
- RunInstallerAttribute.cs
- SqlHelper.cs
- TableSectionStyle.cs
- TextSearch.cs
- BevelBitmapEffect.cs
- FontUnitConverter.cs
- TargetParameterCountException.cs
- OdbcErrorCollection.cs
- GenericEnumConverter.cs
- SynchronizedInputHelper.cs
- DirectoryGroupQuery.cs
- BlockUIContainer.cs
- OptimalBreakSession.cs
- ToolboxComponentsCreatedEventArgs.cs
- RadioButtonList.cs
- Transactions.cs
- FormViewDeleteEventArgs.cs
- MobileContainerDesigner.cs
- TypeToken.cs
- SqlComparer.cs
- ElementProxy.cs
- ApplicationDirectory.cs
- AuthenticationModuleElementCollection.cs
- StylusPoint.cs
- DesignBinding.cs
- ConnectionPoint.cs
- StreamMarshaler.cs
- EncoderNLS.cs
- ScrollPattern.cs
- LinqDataSourceInsertEventArgs.cs
- DetailsViewPageEventArgs.cs
- securitycriticaldata.cs