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
- TraceUtils.cs
- PackageFilter.cs
- DataRowCollection.cs
- BinaryMethodMessage.cs
- TimeSpanStorage.cs
- LoginDesigner.cs
- EncodingDataItem.cs
- FacetValueContainer.cs
- ComUdtElement.cs
- MdiWindowListItemConverter.cs
- BamlTreeMap.cs
- InputGestureCollection.cs
- Event.cs
- ChannelSinkStacks.cs
- DocumentViewer.cs
- WebFormsRootDesigner.cs
- KnownTypeDataContractResolver.cs
- OlePropertyStructs.cs
- WebServiceAttribute.cs
- DataKeyCollection.cs
- ContextMarshalException.cs
- SystemColorTracker.cs
- DynamicMetaObject.cs
- XmlSchemaValidationException.cs
- ResizingMessageFilter.cs
- X509CertificateClaimSet.cs
- DetailsViewPageEventArgs.cs
- WorkerRequest.cs
- CacheMode.cs
- MaterialCollection.cs
- XPathSelfQuery.cs
- WindowHelperService.cs
- HatchBrush.cs
- TCPClient.cs
- TextRangeAdaptor.cs
- NetStream.cs
- MenuCommand.cs
- FileStream.cs
- lengthconverter.cs
- HashSetDebugView.cs
- Matrix.cs
- PageVisual.cs
- DataGridViewCellMouseEventArgs.cs
- WebPartMovingEventArgs.cs
- TextPointer.cs
- BindingObserver.cs
- CollectionContainer.cs
- XmlWriterTraceListener.cs
- BitmapEffect.cs
- EntityStoreSchemaGenerator.cs
- sitestring.cs
- UserInitiatedRoutedEventPermission.cs
- TripleDESCryptoServiceProvider.cs
- FontStretch.cs
- BaseParser.cs
- WhiteSpaceTrimStringConverter.cs
- RepeaterItemEventArgs.cs
- RawStylusInput.cs
- DataGridViewAccessibleObject.cs
- TypeListConverter.cs
- LocalFileSettingsProvider.cs
- ProcessHostServerConfig.cs
- NamespaceEmitter.cs
- SingleKeyFrameCollection.cs
- HtmlEmptyTagControlBuilder.cs
- SqlConnectionHelper.cs
- ManagementException.cs
- DropShadowBitmapEffect.cs
- ManualResetEvent.cs
- DataGridViewCellStateChangedEventArgs.cs
- ReplyChannelAcceptor.cs
- ProcessHostServerConfig.cs
- TransformerInfo.cs
- KerberosSecurityTokenAuthenticator.cs
- DrawToolTipEventArgs.cs
- XamlToRtfParser.cs
- Bits.cs
- GridViewSelectEventArgs.cs
- BitConverter.cs
- InstallerTypeAttribute.cs
- ProcessModelSection.cs
- CompositeCollectionView.cs
- LocationChangedEventArgs.cs
- DependentList.cs
- ContextMenuStripGroup.cs
- AssemblyBuilderData.cs
- MarkupObject.cs
- TypeProvider.cs
- RijndaelCryptoServiceProvider.cs
- NativeMethods.cs
- DbCommandTree.cs
- TypeSystemHelpers.cs
- XmlSchemaRedefine.cs
- WebProxyScriptElement.cs
- HttpContextServiceHost.cs
- DataListCommandEventArgs.cs
- DbProviderSpecificTypePropertyAttribute.cs
- TextAutomationPeer.cs
- TransformProviderWrapper.cs
- EnumConverter.cs