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
- AttributeCollection.cs
- Object.cs
- Variable.cs
- ZoomPercentageConverter.cs
- TimeStampChecker.cs
- AnimationStorage.cs
- DeriveBytes.cs
- FieldAccessException.cs
- QueryStringParameter.cs
- OdbcConnection.cs
- XmlLinkedNode.cs
- HeaderCollection.cs
- XmlSchemaValidationException.cs
- GraphicsContext.cs
- Geometry.cs
- SortedSetDebugView.cs
- ServiceRouteHandler.cs
- AssociativeAggregationOperator.cs
- MarkupWriter.cs
- RecordsAffectedEventArgs.cs
- PropertyGridDesigner.cs
- ControlType.cs
- ToolboxService.cs
- HtmlForm.cs
- WsdlBuildProvider.cs
- Int16Converter.cs
- MILUtilities.cs
- CanonicalFormWriter.cs
- SelectedDatesCollection.cs
- EdmComplexPropertyAttribute.cs
- _HTTPDateParse.cs
- oledbmetadatacolumnnames.cs
- LocalFileSettingsProvider.cs
- AddInContractAttribute.cs
- DocumentNUp.cs
- ContextQuery.cs
- SemanticResolver.cs
- WebGetAttribute.cs
- PropertyTabChangedEvent.cs
- ProtocolElement.cs
- _ShellExpression.cs
- ControlParameter.cs
- UserControl.cs
- CommandHelper.cs
- TableCellCollection.cs
- GCHandleCookieTable.cs
- HttpWebResponse.cs
- DataContractAttribute.cs
- XmlILAnnotation.cs
- AutomationPatternInfo.cs
- ListViewUpdateEventArgs.cs
- precedingquery.cs
- ListViewEditEventArgs.cs
- FilterEventArgs.cs
- BitVector32.cs
- UpdateTracker.cs
- ListViewUpdatedEventArgs.cs
- InheritablePropertyChangeInfo.cs
- DataError.cs
- DrawingContextDrawingContextWalker.cs
- SubpageParaClient.cs
- HandleRef.cs
- nulltextcontainer.cs
- URLAttribute.cs
- WindowsTokenRoleProvider.cs
- ConsoleEntryPoint.cs
- MailMessageEventArgs.cs
- LinqDataView.cs
- DataSourceSelectArguments.cs
- Zone.cs
- XamlTypeMapperSchemaContext.cs
- WebSysDescriptionAttribute.cs
- RegexStringValidator.cs
- HashSet.cs
- TableColumn.cs
- CounterSample.cs
- SqlXmlStorage.cs
- AuthenticatingEventArgs.cs
- TemplateBindingExtension.cs
- UnaryExpressionHelper.cs
- TreeNodeSelectionProcessor.cs
- DescendantOverDescendantQuery.cs
- SHA512Managed.cs
- MatrixUtil.cs
- WriteFileContext.cs
- NamespaceQuery.cs
- MutexSecurity.cs
- CalendarData.cs
- RectangleHotSpot.cs
- WhitespaceRuleReader.cs
- RequestCacheManager.cs
- NativeMethodsOther.cs
- SerialStream.cs
- ConfigXmlText.cs
- SpeechRecognizer.cs
- Knowncolors.cs
- BrowserDefinitionCollection.cs
- EraserBehavior.cs
- PersonalizationEntry.cs
- SqlProcedureAttribute.cs