Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Documents / BlockUIContainer.cs / 1 / 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
- KeySpline.cs
- ThicknessKeyFrameCollection.cs
- BoundConstants.cs
- NameValueFileSectionHandler.cs
- Dictionary.cs
- ObjectDataSourceDisposingEventArgs.cs
- HierarchicalDataBoundControlAdapter.cs
- DbProviderSpecificTypePropertyAttribute.cs
- WmlLiteralTextAdapter.cs
- VerbConverter.cs
- TransformCryptoHandle.cs
- TraceAsyncResult.cs
- SimpleHandlerFactory.cs
- ListBindableAttribute.cs
- XmlIlTypeHelper.cs
- SchemaDeclBase.cs
- odbcmetadatafactory.cs
- HMAC.cs
- DependentList.cs
- IfElseDesigner.xaml.cs
- WebHeaderCollection.cs
- Vertex.cs
- DataServices.cs
- TextSimpleMarkerProperties.cs
- Vector3D.cs
- SqlUDTStorage.cs
- mansign.cs
- IconConverter.cs
- BaseInfoTable.cs
- EntityClientCacheEntry.cs
- LoginName.cs
- CheckedListBox.cs
- PreviewPrintController.cs
- AttributeParameterInfo.cs
- XmlNodeChangedEventArgs.cs
- ClientTarget.cs
- XmlAnyAttributeAttribute.cs
- bindurihelper.cs
- UnaryNode.cs
- ControlLocalizer.cs
- TextRangeSerialization.cs
- ComplexPropertyEntry.cs
- HMACMD5.cs
- ExtensibleClassFactory.cs
- SizeAnimationBase.cs
- WindowsTooltip.cs
- RecordManager.cs
- COM2IProvidePropertyBuilderHandler.cs
- GuidTagList.cs
- EntityClientCacheEntry.cs
- Duration.cs
- SeverityFilter.cs
- RecognizedWordUnit.cs
- AmbientLight.cs
- DataGridColumnReorderingEventArgs.cs
- OpCellTreeNode.cs
- basenumberconverter.cs
- InkCanvasFeedbackAdorner.cs
- FrugalMap.cs
- ViewDesigner.cs
- MSG.cs
- Metadata.cs
- InvalidOperationException.cs
- CompositionTarget.cs
- RetrieveVirtualItemEventArgs.cs
- HealthMonitoringSection.cs
- WriteFileContext.cs
- Cursor.cs
- X509ChainPolicy.cs
- MouseDevice.cs
- VideoDrawing.cs
- CodeMethodReturnStatement.cs
- ExpressionBuilderContext.cs
- XmlDataSourceView.cs
- MatrixTransform3D.cs
- TimeSpanValidatorAttribute.cs
- ExpressionVisitorHelpers.cs
- GroupDescription.cs
- ImportStoreException.cs
- SvcFileManager.cs
- Track.cs
- CollectionViewSource.cs
- SerialPinChanges.cs
- ToolZone.cs
- IxmlLineInfo.cs
- ResourcesChangeInfo.cs
- TreeChangeInfo.cs
- TdsParameterSetter.cs
- Attributes.cs
- XmlEventCache.cs
- DuplicateWaitObjectException.cs
- TextMarkerSource.cs
- SymbolEqualComparer.cs
- ColumnHeader.cs
- StringFormat.cs
- ChooseAction.cs
- AsyncOperation.cs
- SqlNodeTypeOperators.cs
- DropSourceBehavior.cs
- GridSplitter.cs