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
- AnchoredBlock.cs
- SqlDuplicator.cs
- RuntimeUtils.cs
- TrackBarDesigner.cs
- SchemaInfo.cs
- EmptyWithCancelationCheckWorkItem.cs
- DataGridViewRowPostPaintEventArgs.cs
- ExpressionWriter.cs
- Helper.cs
- PropertyChangedEventManager.cs
- MailWebEventProvider.cs
- BinaryNode.cs
- TdsParserHelperClasses.cs
- Atom10FeedFormatter.cs
- TextEffectCollection.cs
- XmlConverter.cs
- ControlAdapter.cs
- DictionaryContent.cs
- MasterPageBuildProvider.cs
- HttpModulesSection.cs
- ScriptControl.cs
- DataTableCollection.cs
- HashFinalRequest.cs
- AccessDataSourceView.cs
- FixedBufferAttribute.cs
- ZoneLinkButton.cs
- UnsafeNativeMethods.cs
- ResourceReferenceExpression.cs
- AppDomainFactory.cs
- mediaeventshelper.cs
- PrintPageEvent.cs
- TextElementCollection.cs
- SafeNativeMemoryHandle.cs
- ProjectionRewriter.cs
- EventlogProvider.cs
- ParsedAttributeCollection.cs
- FormattedText.cs
- CompiledXpathExpr.cs
- MetadataSource.cs
- BitmapDecoder.cs
- DropDownButton.cs
- SettingsPropertyNotFoundException.cs
- TerminatorSinks.cs
- RowType.cs
- VectorKeyFrameCollection.cs
- BindingExpressionBase.cs
- FixedPosition.cs
- EntityType.cs
- SqlLiftIndependentRowExpressions.cs
- TdsParameterSetter.cs
- ReceiveMessageContent.cs
- WmlListAdapter.cs
- IdentityModelStringsVersion1.cs
- ActivationArguments.cs
- SafeFileMapViewHandle.cs
- InternalMappingException.cs
- objectresult_tresulttype.cs
- HttpHandlersSection.cs
- FrameDimension.cs
- SoapSchemaMember.cs
- securitymgrsite.cs
- KeyGestureValueSerializer.cs
- LocatorGroup.cs
- UseLicense.cs
- AttributeProviderAttribute.cs
- Timer.cs
- NamespaceCollection.cs
- ContextBase.cs
- GroupItemAutomationPeer.cs
- PackageDigitalSignatureManager.cs
- BitmapSource.cs
- RadioButtonRenderer.cs
- StyleCollection.cs
- StrongNameUtility.cs
- TimelineClockCollection.cs
- WmiPutTraceRecord.cs
- DataSourceProvider.cs
- Stack.cs
- TreeWalkHelper.cs
- _NestedSingleAsyncResult.cs
- Window.cs
- AxImporter.cs
- AttachedAnnotation.cs
- WorkflowRequestContext.cs
- HttpContextWrapper.cs
- PartialArray.cs
- ClientConvert.cs
- XmlSignatureManifest.cs
- OpenTypeCommon.cs
- NotSupportedException.cs
- MobileListItem.cs
- Comparer.cs
- AdRotator.cs
- HtmlInputImage.cs
- EditCommandColumn.cs
- UICuesEvent.cs
- EventlogProvider.cs
- SystemIPInterfaceStatistics.cs
- Activator.cs
- RegexRunnerFactory.cs