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
- UserMapPath.cs
- CroppedBitmap.cs
- SemanticResolver.cs
- EtwTrace.cs
- WsdlBuildProvider.cs
- TextPatternIdentifiers.cs
- UserControlDocumentDesigner.cs
- ECDsa.cs
- Light.cs
- BindToObject.cs
- RegisterInfo.cs
- BaseParagraph.cs
- ApplicationDirectory.cs
- WindowsStartMenu.cs
- StandardCommands.cs
- DataGridViewCellStyleBuilderDialog.cs
- XAMLParseException.cs
- OciLobLocator.cs
- RuntimeHandles.cs
- RewritingValidator.cs
- SlotInfo.cs
- BuildResult.cs
- KnownIds.cs
- CTreeGenerator.cs
- PointHitTestParameters.cs
- EntityDataSourceView.cs
- ListBoxItemAutomationPeer.cs
- EncoderFallback.cs
- NavigationPropertySingletonExpression.cs
- UriTemplateLiteralQueryValue.cs
- DesignerVerb.cs
- ReflectEventDescriptor.cs
- ObjectStateFormatter.cs
- DataRelation.cs
- RenderData.cs
- DataExpression.cs
- RichTextBoxConstants.cs
- MonthCalendar.cs
- KeyConverter.cs
- OleDbWrapper.cs
- DesignerHierarchicalDataSourceView.cs
- IncrementalCompileAnalyzer.cs
- ExecutionContext.cs
- OleCmdHelper.cs
- DefaultMemberAttribute.cs
- WmlValidationSummaryAdapter.cs
- ProfileGroupSettingsCollection.cs
- FieldInfo.cs
- AdRotator.cs
- ValidationResult.cs
- HelpKeywordAttribute.cs
- XmlILConstructAnalyzer.cs
- autovalidator.cs
- FormatterConverter.cs
- Variable.cs
- DoubleStorage.cs
- SoapCodeExporter.cs
- ValidatorCollection.cs
- FullTextLine.cs
- LocalizabilityAttribute.cs
- VariableAction.cs
- DoubleAnimationClockResource.cs
- XslException.cs
- MediaContextNotificationWindow.cs
- AcceleratedTokenProvider.cs
- ContainerFilterService.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- Select.cs
- ReaderContextStackData.cs
- TableAutomationPeer.cs
- BuildResult.cs
- WeakReadOnlyCollection.cs
- ActivationServices.cs
- WpfWebRequestHelper.cs
- FunctionUpdateCommand.cs
- EmbeddedMailObject.cs
- ProtocolProfile.cs
- BinaryCommonClasses.cs
- WebPartUtil.cs
- SystemWebExtensionsSectionGroup.cs
- FlowDocumentReaderAutomationPeer.cs
- SoapIgnoreAttribute.cs
- DataGridViewCellCollection.cs
- XPathEmptyIterator.cs
- GridToolTip.cs
- Expression.cs
- X509Certificate2Collection.cs
- DispatcherExceptionEventArgs.cs
- DynamicValidatorEventArgs.cs
- InvalidPropValue.cs
- autovalidator.cs
- OperandQuery.cs
- DynamicHyperLink.cs
- PathGeometry.cs
- SQLString.cs
- MemoryStream.cs
- ContentFilePart.cs
- Figure.cs
- LinkButton.cs
- ToolStripControlHost.cs