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
- CodeSubDirectoriesCollection.cs
- XPathNodeHelper.cs
- ClientTargetCollection.cs
- RefreshPropertiesAttribute.cs
- WindowsListViewGroupHelper.cs
- ListItemCollection.cs
- tooltip.cs
- StoragePropertyMapping.cs
- StrongNamePublicKeyBlob.cs
- ListBindingHelper.cs
- DataGridViewHitTestInfo.cs
- ExceptQueryOperator.cs
- SSmlParser.cs
- TextRunCacheImp.cs
- Peer.cs
- InheritanceRules.cs
- _ConnectStream.cs
- VectorKeyFrameCollection.cs
- RootBrowserWindowProxy.cs
- SafeArchiveContext.cs
- WebEventTraceProvider.cs
- ValidatorCompatibilityHelper.cs
- MappingException.cs
- KeyInfo.cs
- recordstatescratchpad.cs
- ViewStateException.cs
- CompatibleComparer.cs
- LayoutTable.cs
- Permission.cs
- ELinqQueryState.cs
- ComponentEditorForm.cs
- LinkTarget.cs
- ContainerParaClient.cs
- updatecommandorderer.cs
- PageParser.cs
- Utility.cs
- TargetException.cs
- EtwTrackingBehavior.cs
- DebugHandleTracker.cs
- SqlProviderManifest.cs
- SmiSettersStream.cs
- XmlQueryContext.cs
- ColorPalette.cs
- FontEmbeddingManager.cs
- ColorAnimationUsingKeyFrames.cs
- ECDiffieHellmanCngPublicKey.cs
- DiagnosticsConfiguration.cs
- TraceHandler.cs
- SelectionProcessor.cs
- Light.cs
- HelpInfo.cs
- ISessionStateStore.cs
- HttpProfileGroupBase.cs
- ExpressionStringBuilder.cs
- BufferModeSettings.cs
- UIInitializationException.cs
- ToolStripContentPanelRenderEventArgs.cs
- SafeNativeMemoryHandle.cs
- XmlCharacterData.cs
- DictionaryGlobals.cs
- Region.cs
- WpfGeneratedKnownTypes.cs
- MaterialCollection.cs
- IdentitySection.cs
- CompositionCommandSet.cs
- ActivityDesignerResources.cs
- DataGridViewMethods.cs
- MeshGeometry3D.cs
- IntSumAggregationOperator.cs
- ConfigurationSectionGroupCollection.cs
- CardSpaceSelector.cs
- DbProviderFactoriesConfigurationHandler.cs
- XPathScanner.cs
- DefaultPropertyAttribute.cs
- SQLByte.cs
- CompiledELinqQueryState.cs
- MemberMaps.cs
- StatusBarDrawItemEvent.cs
- ElementsClipboardData.cs
- AssemblyBuilder.cs
- ErrorStyle.cs
- LinkConverter.cs
- CngProvider.cs
- GridEntry.cs
- LongAverageAggregationOperator.cs
- DrawingContext.cs
- ValidatingCollection.cs
- SurrogateDataContract.cs
- CodeEntryPointMethod.cs
- SystemWebCachingSectionGroup.cs
- ConnectionManagementElementCollection.cs
- SystemIcmpV6Statistics.cs
- DigitShape.cs
- TypedElement.cs
- DataSourceSelectArguments.cs
- ProvidePropertyAttribute.cs
- LinearKeyFrames.cs
- XmlWhitespace.cs
- CriticalHandle.cs
- XmlAttributeOverrides.cs