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
- PageAsyncTaskManager.cs
- DataColumnMapping.cs
- BuildResult.cs
- DateRangeEvent.cs
- BmpBitmapEncoder.cs
- Run.cs
- SplitterPanel.cs
- QEncodedStream.cs
- LoginName.cs
- cache.cs
- FullTextLine.cs
- TabletDeviceInfo.cs
- ObjectNavigationPropertyMapping.cs
- SymmetricKeyWrap.cs
- MapPathBasedVirtualPathProvider.cs
- IPipelineRuntime.cs
- DisableDpiAwarenessAttribute.cs
- SqlErrorCollection.cs
- OracleConnection.cs
- FacetDescriptionElement.cs
- RootBrowserWindowAutomationPeer.cs
- QuaternionConverter.cs
- EditingMode.cs
- SqlInternalConnection.cs
- ReadOnlyHierarchicalDataSource.cs
- SqlTriggerContext.cs
- SafeArrayTypeMismatchException.cs
- ApplyTemplatesAction.cs
- QilList.cs
- EventRouteFactory.cs
- AssemblyBuilderData.cs
- TileBrush.cs
- ReliabilityContractAttribute.cs
- SystemIPInterfaceProperties.cs
- Preprocessor.cs
- odbcmetadatafactory.cs
- ProfilePropertyNameValidator.cs
- RuntimeHandles.cs
- RepeatButton.cs
- ProjectedSlot.cs
- TextViewBase.cs
- DataColumnMapping.cs
- IdnElement.cs
- NonParentingControl.cs
- SqlDataAdapter.cs
- MessageDesigner.cs
- IndexedString.cs
- MetadataArtifactLoader.cs
- DecimalKeyFrameCollection.cs
- RequestQueryProcessor.cs
- Knowncolors.cs
- DataRow.cs
- TraceContextEventArgs.cs
- TabletDevice.cs
- AssemblySettingAttributes.cs
- FileUtil.cs
- Int16KeyFrameCollection.cs
- XmlSchemaProviderAttribute.cs
- Debugger.cs
- MetabaseServerConfig.cs
- SourceFileBuildProvider.cs
- CompleteWizardStep.cs
- recordstatefactory.cs
- DatagridviewDisplayedBandsData.cs
- StaticExtensionConverter.cs
- OutOfMemoryException.cs
- CompilerScopeManager.cs
- UdpDiscoveryEndpointProvider.cs
- Root.cs
- FunctionQuery.cs
- DataGridViewCellParsingEventArgs.cs
- WindowProviderWrapper.cs
- OleServicesContext.cs
- PartialCachingControl.cs
- HyperLinkField.cs
- CommandSet.cs
- ThreadStaticAttribute.cs
- Polyline.cs
- XmlSchemaSimpleTypeRestriction.cs
- CqlLexerHelpers.cs
- WebPartRestoreVerb.cs
- WindowsListView.cs
- BrowserCapabilitiesFactory.cs
- FunctionImportMapping.cs
- DefaultAsyncDataDispatcher.cs
- GlyphRunDrawing.cs
- _AutoWebProxyScriptWrapper.cs
- UserNameSecurityToken.cs
- IisTraceListener.cs
- Stroke.cs
- ArrayTypeMismatchException.cs
- RuleProcessor.cs
- SetterBase.cs
- IntPtr.cs
- PriorityChain.cs
- CutCopyPasteHelper.cs
- TimeSpanValidatorAttribute.cs
- ErrorTableItemStyle.cs
- OutputCacheProfileCollection.cs
- RayMeshGeometry3DHitTestResult.cs