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
- TypeDependencyAttribute.cs
- Decorator.cs
- ObjectItemNoOpAssemblyLoader.cs
- ImageField.cs
- ElementHost.cs
- RemotingAttributes.cs
- UMPAttributes.cs
- WebPartEditVerb.cs
- TemplateBindingExpression.cs
- PathSegmentCollection.cs
- SoapElementAttribute.cs
- TreeNode.cs
- EntityDataSourceContextCreatingEventArgs.cs
- BindingContext.cs
- DEREncoding.cs
- AssemblyResolver.cs
- RegexStringValidator.cs
- MetabaseReader.cs
- PointLight.cs
- HttpCookiesSection.cs
- XmlEncodedRawTextWriter.cs
- ReflectionTypeLoadException.cs
- ClientFormsAuthenticationCredentials.cs
- StyleConverter.cs
- VisualStateGroup.cs
- SecurityAlgorithmSuite.cs
- ByeOperation11AsyncResult.cs
- AnonymousIdentificationSection.cs
- InfoCardTrace.cs
- TableProviderWrapper.cs
- ConfigViewGenerator.cs
- ObjectListField.cs
- ResourceReader.cs
- GetPageCompletedEventArgs.cs
- MdImport.cs
- Win32PrintDialog.cs
- HttpRuntime.cs
- CodeSubDirectoriesCollection.cs
- ListItemsPage.cs
- DataTrigger.cs
- FileUtil.cs
- TypeReference.cs
- AnimationStorage.cs
- UiaCoreApi.cs
- UnsettableComboBox.cs
- PenLineJoinValidation.cs
- PaginationProgressEventArgs.cs
- BlockingCollection.cs
- Region.cs
- NavigatingCancelEventArgs.cs
- DesignerActionService.cs
- TableLayoutPanelCellPosition.cs
- XmlSchemaValidationException.cs
- RemotingServices.cs
- FixedSOMContainer.cs
- CheckedListBox.cs
- ErrorRuntimeConfig.cs
- DefaultHttpHandler.cs
- OleDbTransaction.cs
- TimeIntervalCollection.cs
- CultureSpecificCharacterBufferRange.cs
- TreeViewHitTestInfo.cs
- CollectionsUtil.cs
- TemplatedMailWebEventProvider.cs
- IssuedSecurityTokenParameters.cs
- XPathNavigatorException.cs
- SmtpCommands.cs
- TypeElement.cs
- PersonalizationStateQuery.cs
- XmlSchemaParticle.cs
- VirtualDirectoryMappingCollection.cs
- AppDomainFactory.cs
- DoubleAnimationUsingPath.cs
- HttpProfileGroupBase.cs
- ObjectDataSourceDesigner.cs
- EncryptedType.cs
- DataRelation.cs
- CodeDOMProvider.cs
- NumericPagerField.cs
- BaseUriHelper.cs
- RtfToXamlLexer.cs
- ActiveXContainer.cs
- ComponentEvent.cs
- X500Name.cs
- SemanticResultKey.cs
- CodeRegionDirective.cs
- InternalBufferOverflowException.cs
- DynamicPropertyReader.cs
- TextTreeText.cs
- EntityTypeEmitter.cs
- Window.cs
- PreservationFileWriter.cs
- autovalidator.cs
- PartialCachingControl.cs
- RemoveStoryboard.cs
- EntityDataSourceChangingEventArgs.cs
- MetadataException.cs
- DataGridHeaderBorder.cs
- InputProcessorProfilesLoader.cs
- ParameterToken.cs