Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / BlockUIContainer.cs / 1305600 / BlockUIContainer.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: BlockUIContainer - a wrapper for embedded UIElements in text // flow content block collections // //--------------------------------------------------------------------------- using System.ComponentModel; // DesignerSerializationVisibility using System.Windows.Markup; // ContentProperty namespace System.Windows.Documents { ////// BlockUIContainer - a wrapper for embedded UIElements in text /// flow content block collections /// [ContentProperty("Child")] public class BlockUIContainer : Block { //------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors ////// Initializes a new instance of BlockUIContainer element. /// ////// The purpose of this element is to be a wrapper for UIElements /// when they are embedded into text flow - as items of /// BlockCollections. /// public BlockUIContainer() : base() { } ////// Initializes an BlockUIContainer specifying its child UIElement /// /// /// UIElement set as a child of this block item /// public BlockUIContainer(UIElement uiElement) : base() { if (uiElement == null) { throw new ArgumentNullException("uiElement"); } this.Child = uiElement; } #endregion Constructors //-------------------------------------------------------------------- // // Public Properties // //------------------------------------------------------------------- #region Properties ////// The content spanned by this TextElement. /// public UIElement Child { get { return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement; } set { TextContainer textContainer = this.TextContainer; textContainer.BeginChange(); try { TextPointer contentStart = this.ContentStart; UIElement child = Child; if (child != null) { textContainer.DeleteContentInternal(contentStart, this.ContentEnd); ContainerTextElementField.ClearValue(child); } if (value != null) { ContainerTextElementField.SetValue(value, this); contentStart.InsertUIElement(value); } } finally { textContainer.EndChange(); } } } #endregion } } // 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
- StylusPoint.cs
- MergeExecutor.cs
- RectangleGeometry.cs
- RayHitTestParameters.cs
- ContextQuery.cs
- TraceContextEventArgs.cs
- StringComparer.cs
- TextDecoration.cs
- UriSectionData.cs
- ScriptModule.cs
- Thread.cs
- ReferencedType.cs
- StaticFileHandler.cs
- FontSource.cs
- ResourceManagerWrapper.cs
- WindowsListViewGroupHelper.cs
- CustomAttributeBuilder.cs
- OneWayElement.cs
- CryptoApi.cs
- BezierSegment.cs
- Configuration.cs
- Query.cs
- EventsTab.cs
- TextRangeEditTables.cs
- DataControlFieldHeaderCell.cs
- WebPartTransformerAttribute.cs
- ImplicitInputBrush.cs
- XmlImplementation.cs
- WebServiceEnumData.cs
- EncoderFallback.cs
- BaseCAMarshaler.cs
- PageAdapter.cs
- SqlDesignerDataSourceView.cs
- FontFamilyValueSerializer.cs
- TraceHwndHost.cs
- Serializer.cs
- WindowProviderWrapper.cs
- HashMembershipCondition.cs
- XmlSerializationGeneratedCode.cs
- Font.cs
- mda.cs
- UpdatableGenericsFeature.cs
- XmlBinaryReader.cs
- SqlCacheDependency.cs
- AttachmentService.cs
- CngAlgorithm.cs
- BitmapMetadata.cs
- QueueProcessor.cs
- PackageRelationshipCollection.cs
- FilterEventArgs.cs
- ServiceOperationParameter.cs
- TemplatedMailWebEventProvider.cs
- _CommandStream.cs
- __ConsoleStream.cs
- XNodeSchemaApplier.cs
- BindingExpressionBase.cs
- GenericUriParser.cs
- TimeStampChecker.cs
- DataMisalignedException.cs
- HiddenField.cs
- SerialStream.cs
- _NTAuthentication.cs
- PersonalizationState.cs
- StaticSiteMapProvider.cs
- MtomMessageEncodingElement.cs
- Mutex.cs
- ApplyHostConfigurationBehavior.cs
- FormViewDeleteEventArgs.cs
- XPathEmptyIterator.cs
- Mapping.cs
- XPathArrayIterator.cs
- DataBindingCollection.cs
- StandardOleMarshalObject.cs
- SqlBooleanMismatchVisitor.cs
- DesignerGenericWebPart.cs
- IndexingContentUnit.cs
- EnumValAlphaComparer.cs
- MouseGesture.cs
- BaseAutoFormat.cs
- BrushConverter.cs
- dataobject.cs
- XPathDocumentNavigator.cs
- Event.cs
- XmlComment.cs
- Axis.cs
- InputLangChangeEvent.cs
- Int64Animation.cs
- DeploymentExceptionMapper.cs
- PersonalizationDictionary.cs
- PlaceHolder.cs
- NameObjectCollectionBase.cs
- Model3D.cs
- SafeNativeMethodsOther.cs
- EntitySetDataBindingList.cs
- ObjectQueryExecutionPlan.cs
- CodeTypeParameterCollection.cs
- FragmentQuery.cs
- XsdBuildProvider.cs
- SmtpCommands.cs
- DependencyPropertyDescriptor.cs