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
- FlowchartSizeFeature.cs
- UriTemplateTrieNode.cs
- QilLoop.cs
- DataGridBoolColumn.cs
- FunctionImportElement.cs
- RoutedEventConverter.cs
- XPathCompileException.cs
- ConnectionManagementSection.cs
- RtType.cs
- XmlReflectionMember.cs
- TagElement.cs
- SinglePhaseEnlistment.cs
- RemotingAttributes.cs
- FixedTextSelectionProcessor.cs
- XPathNodeInfoAtom.cs
- WebServiceParameterData.cs
- XPathItem.cs
- Image.cs
- WindowsListViewItemCheckBox.cs
- Executor.cs
- CapiSymmetricAlgorithm.cs
- XmlSerializationGeneratedCode.cs
- OptimalTextSource.cs
- BinaryMethodMessage.cs
- XamlRtfConverter.cs
- FaultContext.cs
- DirectoryInfo.cs
- httpstaticobjectscollection.cs
- WindowsListViewSubItem.cs
- Column.cs
- XPathAncestorIterator.cs
- KnownTypeAttribute.cs
- DragDeltaEventArgs.cs
- ComboBox.cs
- ParseChildrenAsPropertiesAttribute.cs
- MultiSelector.cs
- ExpressionBinding.cs
- AssemblyInfo.cs
- SimplePropertyEntry.cs
- ProcessModule.cs
- ELinqQueryState.cs
- ColumnClickEvent.cs
- EdmValidator.cs
- AssociationTypeEmitter.cs
- WriterOutput.cs
- handlecollector.cs
- InputLangChangeRequestEvent.cs
- AmbientLight.cs
- PathParser.cs
- GridViewCommandEventArgs.cs
- LinkedList.cs
- _UriSyntax.cs
- ObjectConverter.cs
- XmlWriterDelegator.cs
- WindowsTokenRoleProvider.cs
- CopyNamespacesAction.cs
- DesignTimeParseData.cs
- InfoCardTrace.cs
- ListBoxItemAutomationPeer.cs
- CancellationTokenRegistration.cs
- XmlWriter.cs
- IDispatchConstantAttribute.cs
- TraceUtility.cs
- Crypto.cs
- WindowsScroll.cs
- IncrementalHitTester.cs
- PersonalizableAttribute.cs
- COSERVERINFO.cs
- Scanner.cs
- XmlAttributes.cs
- LinqDataSourceInsertEventArgs.cs
- FixUpCollection.cs
- ErrorCodes.cs
- MetadataPropertyAttribute.cs
- String.cs
- _WebProxyDataBuilder.cs
- WebPartsPersonalizationAuthorization.cs
- CloudCollection.cs
- Interlocked.cs
- Message.cs
- ManifestSignatureInformation.cs
- CompositeKey.cs
- DrawingDrawingContext.cs
- CryptoConfig.cs
- NetCodeGroup.cs
- CollaborationHelperFunctions.cs
- TargetControlTypeCache.cs
- Transform3DCollection.cs
- XPathExpr.cs
- CodeGenerator.cs
- JsonDeserializer.cs
- OdbcConnection.cs
- FlowDocumentReaderAutomationPeer.cs
- CompilerResults.cs
- ClientRuntimeConfig.cs
- DbProviderFactory.cs
- ItemList.cs
- HotSpot.cs
- PriorityQueue.cs
- TrackingStringDictionary.cs