Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / SizeChangedInfo.cs / 1305600 / SizeChangedInfo.cs
using System;
namespace System.Windows
{
///
/// The SizeChangedinfo class is used as a parameter to OnSizeRenderChanged.
///
public class SizeChangedInfo
{
///
/// Initializes a new instance of the SizeChangedinfo class.
///
///
/// The element which size is changing.
///
///
/// The size of the object before update. New size is element.RenderSize
///
///
/// The flag indicating that width component of the size changed. Note that due to double math
/// effects, the it may be (previousSize.Width != newSize.Width) and widthChanged = true.
/// This may happen in layout when sizes of objects are fluctuating because of a precision "jitter" of
/// the input parameters, but the overall scene is considered to be "the same" so no visible changes
/// will be detected. Typically, the handler of SizeChangedEvent should check this bit to avoid
/// invalidation of layout if the dimension didn't change.
///
///
/// The flag indicating that height component of the size changed. Note that due to double math
/// effects, the it may be (previousSize.Height != newSize.Height) and heightChanged = true.
/// This may happen in layout when sizes of objects are fluctuating because of a precision "jitter" of
/// the input parameters, but the overall scene is considered to be "the same" so no visible changes
/// will be detected. Typically, the handler of SizeChangedEvent should check this bit to avoid
/// invalidation of layout if the dimension didn't change.
///
public SizeChangedInfo(UIElement element, Size previousSize, bool widthChanged, bool heightChanged)
{
_element = element;
_previousSize = previousSize;
_widthChanged = widthChanged;
_heightChanged = heightChanged;
}
///
/// Read-only access to the previous Size
///
public Size PreviousSize
{
get { return _previousSize; }
}
///
/// Read-only access to the new Size
///
public Size NewSize
{
get { return _element.RenderSize; }
}
///
/// Read-only access to the flag indicating that Width component of the size changed.
/// Note that due to double math
/// effects, the it may be (previousSize.Width != newSize.Width) and widthChanged = true.
/// This may happen in layout when sizes of objects are fluctuating because of a precision "jitter" of
/// the input parameters, but the overall scene is considered to be "the same" so no visible changes
/// will be detected. Typically, the handler of SizeChangedEvent should check this bit to avoid
/// invalidation of layout if the dimension didn't change.
///
public bool WidthChanged
{
get { return _widthChanged; }
}
///
/// Read-only access to the flag indicating that Height component of the size changed.
/// Note that due to double math
/// effects, the it may be (previousSize.Height != newSize.Height) and heightChanged = true.
/// This may happen in layout when sizes of objects are fluctuating because of a precision "jitter" of
/// the input parameters, but the overall scene is considered to be "the same" so no visible changes
/// will be detected. Typically, the handler of SizeChangedEvent should check this bit to avoid
/// invalidation of layout if the dimension didn't change.
///
public bool HeightChanged
{
get { return _heightChanged; }
}
//this method is used by UIElement to "accumulate" several cosequitive layout updates
//into the single args object cahced on UIElement. Since the SizeChanged is deferred event,
//there could be several size changes before it will actually fire.
internal void Update(bool widthChanged, bool heightChanged)
{
_widthChanged = _widthChanged | widthChanged;
_heightChanged = _heightChanged | heightChanged;
}
internal UIElement Element
{
get { return _element; }
}
private UIElement _element;
private Size _previousSize;
private bool _widthChanged;
private bool _heightChanged;
internal SizeChangedInfo Next;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
namespace System.Windows
{
///
/// The SizeChangedinfo class is used as a parameter to OnSizeRenderChanged.
///
public class SizeChangedInfo
{
///
/// Initializes a new instance of the SizeChangedinfo class.
///
///
/// The element which size is changing.
///
///
/// The size of the object before update. New size is element.RenderSize
///
///
/// The flag indicating that width component of the size changed. Note that due to double math
/// effects, the it may be (previousSize.Width != newSize.Width) and widthChanged = true.
/// This may happen in layout when sizes of objects are fluctuating because of a precision "jitter" of
/// the input parameters, but the overall scene is considered to be "the same" so no visible changes
/// will be detected. Typically, the handler of SizeChangedEvent should check this bit to avoid
/// invalidation of layout if the dimension didn't change.
///
///
/// The flag indicating that height component of the size changed. Note that due to double math
/// effects, the it may be (previousSize.Height != newSize.Height) and heightChanged = true.
/// This may happen in layout when sizes of objects are fluctuating because of a precision "jitter" of
/// the input parameters, but the overall scene is considered to be "the same" so no visible changes
/// will be detected. Typically, the handler of SizeChangedEvent should check this bit to avoid
/// invalidation of layout if the dimension didn't change.
///
public SizeChangedInfo(UIElement element, Size previousSize, bool widthChanged, bool heightChanged)
{
_element = element;
_previousSize = previousSize;
_widthChanged = widthChanged;
_heightChanged = heightChanged;
}
///
/// Read-only access to the previous Size
///
public Size PreviousSize
{
get { return _previousSize; }
}
///
/// Read-only access to the new Size
///
public Size NewSize
{
get { return _element.RenderSize; }
}
///
/// Read-only access to the flag indicating that Width component of the size changed.
/// Note that due to double math
/// effects, the it may be (previousSize.Width != newSize.Width) and widthChanged = true.
/// This may happen in layout when sizes of objects are fluctuating because of a precision "jitter" of
/// the input parameters, but the overall scene is considered to be "the same" so no visible changes
/// will be detected. Typically, the handler of SizeChangedEvent should check this bit to avoid
/// invalidation of layout if the dimension didn't change.
///
public bool WidthChanged
{
get { return _widthChanged; }
}
///
/// Read-only access to the flag indicating that Height component of the size changed.
/// Note that due to double math
/// effects, the it may be (previousSize.Height != newSize.Height) and heightChanged = true.
/// This may happen in layout when sizes of objects are fluctuating because of a precision "jitter" of
/// the input parameters, but the overall scene is considered to be "the same" so no visible changes
/// will be detected. Typically, the handler of SizeChangedEvent should check this bit to avoid
/// invalidation of layout if the dimension didn't change.
///
public bool HeightChanged
{
get { return _heightChanged; }
}
//this method is used by UIElement to "accumulate" several cosequitive layout updates
//into the single args object cahced on UIElement. Since the SizeChanged is deferred event,
//there could be several size changes before it will actually fire.
internal void Update(bool widthChanged, bool heightChanged)
{
_widthChanged = _widthChanged | widthChanged;
_heightChanged = _heightChanged | heightChanged;
}
internal UIElement Element
{
get { return _element; }
}
private UIElement _element;
private Size _previousSize;
private bool _widthChanged;
private bool _heightChanged;
internal SizeChangedInfo Next;
}
}
// 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
- ReferencedCollectionType.cs
- PreApplicationStartMethodAttribute.cs
- Table.cs
- Itemizer.cs
- HitTestWithGeometryDrawingContextWalker.cs
- NamedPipeConnectionPool.cs
- DelayedRegex.cs
- WCFModelStrings.Designer.cs
- StateManagedCollection.cs
- CmsInterop.cs
- ProfileSection.cs
- WebPartVerb.cs
- ImpersonationContext.cs
- DynamicDataExtensions.cs
- CompositeDataBoundControl.cs
- DesignTimeParseData.cs
- _RequestCacheProtocol.cs
- XPathDocumentBuilder.cs
- ComAdminWrapper.cs
- Trigger.cs
- EntitySqlQueryCacheEntry.cs
- DocumentOutline.cs
- SqlWorkflowInstanceStore.cs
- BitHelper.cs
- Accessors.cs
- WebOperationContext.cs
- ModuleElement.cs
- DbConnectionPoolGroupProviderInfo.cs
- IdentifierService.cs
- TextEffect.cs
- XmlNodeReader.cs
- LoadGrammarCompletedEventArgs.cs
- SmiRecordBuffer.cs
- UpdateCompiler.cs
- PropertyItem.cs
- XmlAttributeProperties.cs
- KeysConverter.cs
- CipherData.cs
- ResourcePart.cs
- COAUTHIDENTITY.cs
- UnicodeEncoding.cs
- Camera.cs
- DesignerCategoryAttribute.cs
- FormDesigner.cs
- OleDbStruct.cs
- CannotUnloadAppDomainException.cs
- MemberListBinding.cs
- AttachedPropertyDescriptor.cs
- Vector3DAnimationUsingKeyFrames.cs
- BindingContext.cs
- DBNull.cs
- TextServicesHost.cs
- WebPartTracker.cs
- StorageRoot.cs
- KeyedHashAlgorithm.cs
- DrawingGroupDrawingContext.cs
- remotingproxy.cs
- MergeFailedEvent.cs
- InternalConfigHost.cs
- PixelShader.cs
- RequestResponse.cs
- ErrorHandler.cs
- HtmlTitle.cs
- PersistenceException.cs
- ProgressBar.cs
- CodeMemberProperty.cs
- TableRowCollection.cs
- KeyValuePairs.cs
- ApplicationServiceHelper.cs
- FixedSchema.cs
- CounterCreationDataCollection.cs
- OverflowException.cs
- Rfc2898DeriveBytes.cs
- GcHandle.cs
- TogglePattern.cs
- Process.cs
- BaseAsyncResult.cs
- JsonReader.cs
- UserControlBuildProvider.cs
- LineServicesRun.cs
- MembershipUser.cs
- NGCSerializer.cs
- PathHelper.cs
- WindowsEditBoxRange.cs
- Column.cs
- TableRow.cs
- Psha1DerivedKeyGenerator.cs
- HtmlElement.cs
- EnterpriseServicesHelper.cs
- _Semaphore.cs
- ConfigurationManagerInternal.cs
- Lasso.cs
- HtmlInputButton.cs
- WebBrowserContainer.cs
- Hashtable.cs
- SemaphoreSecurity.cs
- SettingsPropertyValueCollection.cs
- BaseDataList.cs
- DataGridViewUtilities.cs
- LinqDataView.cs