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
- RankException.cs
- GetPageNumberCompletedEventArgs.cs
- FixedLineResult.cs
- SqlInternalConnection.cs
- ExecutorLocksHeldException.cs
- SqlErrorCollection.cs
- XmlSchemaDocumentation.cs
- DataSourceProvider.cs
- TextContainerChangedEventArgs.cs
- UriSectionData.cs
- AllMembershipCondition.cs
- WindowVisualStateTracker.cs
- ErrorTableItemStyle.cs
- ProfessionalColorTable.cs
- NotFiniteNumberException.cs
- Rotation3DKeyFrameCollection.cs
- TagPrefixInfo.cs
- EditorPart.cs
- Nullable.cs
- InputProcessorProfilesLoader.cs
- SyntaxCheck.cs
- DeadCharTextComposition.cs
- DispatcherExceptionEventArgs.cs
- TraceContext.cs
- UITypeEditor.cs
- SemanticTag.cs
- CatalogPartChrome.cs
- MatrixIndependentAnimationStorage.cs
- JsonReaderWriterFactory.cs
- ErrorWrapper.cs
- FactoryMaker.cs
- X509SubjectKeyIdentifierClause.cs
- ColumnWidthChangedEvent.cs
- BStrWrapper.cs
- XmlConvert.cs
- DeferredTextReference.cs
- ResetableIterator.cs
- RightsManagementEncryptedStream.cs
- OleDbEnumerator.cs
- MimeObjectFactory.cs
- ConfigurationValidatorAttribute.cs
- DependencyPropertyHelper.cs
- NGCPageContentSerializerAsync.cs
- Journaling.cs
- CompModSwitches.cs
- Camera.cs
- CalendarKeyboardHelper.cs
- SqlFunctionAttribute.cs
- HitTestFilterBehavior.cs
- SoapInteropTypes.cs
- ExpandedWrapper.cs
- DataGridViewSortCompareEventArgs.cs
- XMLSchema.cs
- DataControlFieldHeaderCell.cs
- ControlValuePropertyAttribute.cs
- TextEditorSpelling.cs
- SecurityTokenValidationException.cs
- NativeMethods.cs
- BuilderPropertyEntry.cs
- EmptyQuery.cs
- CqlParser.cs
- BmpBitmapEncoder.cs
- Assembly.cs
- SignatureResourceHelper.cs
- NullReferenceException.cs
- CompilerGlobalScopeAttribute.cs
- DependencyStoreSurrogate.cs
- CompilationSection.cs
- WebControlAdapter.cs
- ExecutionEngineException.cs
- TextRangeBase.cs
- ReferentialConstraint.cs
- ReadOnlyObservableCollection.cs
- CollectionViewGroupInternal.cs
- Matrix.cs
- PowerModeChangedEventArgs.cs
- ToggleButtonAutomationPeer.cs
- KeyMatchBuilder.cs
- ComplexPropertyEntry.cs
- OdbcParameter.cs
- XmlSchemaInclude.cs
- PopupRootAutomationPeer.cs
- SecurityDescriptor.cs
- DispatcherHooks.cs
- HttpListenerPrefixCollection.cs
- ObjectAssociationEndMapping.cs
- QilFunction.cs
- basemetadatamappingvisitor.cs
- CodeRegionDirective.cs
- ColumnWidthChangedEvent.cs
- DrawingAttributesDefaultValueFactory.cs
- HashCodeCombiner.cs
- RealProxy.cs
- Vector3DCollection.cs
- ResourcesBuildProvider.cs
- ManipulationDelta.cs
- ToolTip.cs
- FormViewDeleteEventArgs.cs
- xsdvalidator.cs
- EventHandlersStore.cs