Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / ScrollChangedEventArgs.cs / 1305600 / ScrollChangedEventArgs.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System;
using System.Windows;
namespace System.Windows.Controls
{
///
/// This delegate is used by handlers of the ScrollChangedEvent event.
///
/// The current element along the event's route.
/// The event arguments containing additional information about the event.
/// Nothing.
public delegate void ScrollChangedEventHandler(object sender, ScrollChangedEventArgs e);
///
/// The ScrollChangedEventsArgs describe a change in scrolling state.
///
public class ScrollChangedEventArgs: RoutedEventArgs
{
//-------------------------------------------------------------------
//
// Constructors
//
//-------------------------------------------------------------------
#region Constructors
///
/// Constructor
///
internal ScrollChangedEventArgs(Vector offset, Vector offsetChange, Size extent, Vector extentChange, Size viewport, Vector viewportChange)
{
_offset = offset;
_offsetChange = offsetChange;
_extent = extent;
_extentChange = extentChange;
_viewport = viewport;
_viewportChange = viewportChange;
}
#endregion Constructors
//--------------------------------------------------------------------
//
// Public Properties (CLR + Avalon)
//
//-------------------------------------------------------------------
#region Public Properties
///
/// Updated HorizontalPosition of the scrolled content
///
///
public double HorizontalOffset
{
get { return _offset.X; }
}
///
/// Updated VerticalPosition of the scrolled content
///
///
public double VerticalOffset
{
get { return _offset.Y; }
}
///
/// Change in horizontal offset of the scrolled content
///
///
public double HorizontalChange
{
get { return _offsetChange.X; }
}
///
/// Change in vertical offset of the scrolled content
///
///
public double VerticalChange
{
get { return _offsetChange.Y; }
}
///
/// Updated horizontal size of the viewing window of the ScrollViewer
///
///
public double ViewportWidth
{
get { return _viewport.Width; }
}
///
/// Updated vertical size of the viewing window of the ScrollViewer.
///
///
public double ViewportHeight
{
get { return _viewport.Height; }
}
///
/// Change in the horizontal size of the viewing window of the ScrollViewer
///
///
public double ViewportWidthChange
{
get { return _viewportChange.X; }
}
///
/// Change in the vertical size of the viewing window of the ScrollViewer.
///
///
public double ViewportHeightChange
{
get { return _viewportChange.Y; }
}
///
/// Updated horizontal size of the scrollable content.
///
///
public double ExtentWidth
{
get { return _extent.Width; }
}
///
/// Updated vertical size of the scrollable content.
///
///
public double ExtentHeight
{
get { return _extent.Height; }
}
///
/// Change in the horizontal size of the scrollable content.
///
///
public double ExtentWidthChange
{
get { return _extentChange.X; }
}
///
/// Change in the vertical size of the scrollable content.
///
///
public double ExtentHeightChange
{
get { return _extentChange.Y; }
}
#endregion
//--------------------------------------------------------------------
//
// Protected Methods
//
//--------------------------------------------------------------------
#region Protected Methods
///
/// This method is used to perform the proper type casting in order to
/// call the type-safe ScrollChangedEventHandler delegate for the ScrollChangedEvent event.
///
/// The handler to invoke.
/// The current object along the event's route.
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
{
ScrollChangedEventHandler handler = (ScrollChangedEventHandler)genericHandler;
handler(genericTarget, this);
}
#endregion
//-------------------------------------------------------------------
//
// Private Fields
//
//--------------------------------------------------------------------
#region Private Fields
// Current scroll data
private Vector _offset;
private Vector _offsetChange;
private Size _extent;
private Vector _extentChange;
private Size _viewport;
private Vector _viewportChange;
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System;
using System.Windows;
namespace System.Windows.Controls
{
///
/// This delegate is used by handlers of the ScrollChangedEvent event.
///
/// The current element along the event's route.
/// The event arguments containing additional information about the event.
/// Nothing.
public delegate void ScrollChangedEventHandler(object sender, ScrollChangedEventArgs e);
///
/// The ScrollChangedEventsArgs describe a change in scrolling state.
///
public class ScrollChangedEventArgs: RoutedEventArgs
{
//-------------------------------------------------------------------
//
// Constructors
//
//-------------------------------------------------------------------
#region Constructors
///
/// Constructor
///
internal ScrollChangedEventArgs(Vector offset, Vector offsetChange, Size extent, Vector extentChange, Size viewport, Vector viewportChange)
{
_offset = offset;
_offsetChange = offsetChange;
_extent = extent;
_extentChange = extentChange;
_viewport = viewport;
_viewportChange = viewportChange;
}
#endregion Constructors
//--------------------------------------------------------------------
//
// Public Properties (CLR + Avalon)
//
//-------------------------------------------------------------------
#region Public Properties
///
/// Updated HorizontalPosition of the scrolled content
///
///
public double HorizontalOffset
{
get { return _offset.X; }
}
///
/// Updated VerticalPosition of the scrolled content
///
///
public double VerticalOffset
{
get { return _offset.Y; }
}
///
/// Change in horizontal offset of the scrolled content
///
///
public double HorizontalChange
{
get { return _offsetChange.X; }
}
///
/// Change in vertical offset of the scrolled content
///
///
public double VerticalChange
{
get { return _offsetChange.Y; }
}
///
/// Updated horizontal size of the viewing window of the ScrollViewer
///
///
public double ViewportWidth
{
get { return _viewport.Width; }
}
///
/// Updated vertical size of the viewing window of the ScrollViewer.
///
///
public double ViewportHeight
{
get { return _viewport.Height; }
}
///
/// Change in the horizontal size of the viewing window of the ScrollViewer
///
///
public double ViewportWidthChange
{
get { return _viewportChange.X; }
}
///
/// Change in the vertical size of the viewing window of the ScrollViewer.
///
///
public double ViewportHeightChange
{
get { return _viewportChange.Y; }
}
///
/// Updated horizontal size of the scrollable content.
///
///
public double ExtentWidth
{
get { return _extent.Width; }
}
///
/// Updated vertical size of the scrollable content.
///
///
public double ExtentHeight
{
get { return _extent.Height; }
}
///
/// Change in the horizontal size of the scrollable content.
///
///
public double ExtentWidthChange
{
get { return _extentChange.X; }
}
///
/// Change in the vertical size of the scrollable content.
///
///
public double ExtentHeightChange
{
get { return _extentChange.Y; }
}
#endregion
//--------------------------------------------------------------------
//
// Protected Methods
//
//--------------------------------------------------------------------
#region Protected Methods
///
/// This method is used to perform the proper type casting in order to
/// call the type-safe ScrollChangedEventHandler delegate for the ScrollChangedEvent event.
///
/// The handler to invoke.
/// The current object along the event's route.
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
{
ScrollChangedEventHandler handler = (ScrollChangedEventHandler)genericHandler;
handler(genericTarget, this);
}
#endregion
//-------------------------------------------------------------------
//
// Private Fields
//
//--------------------------------------------------------------------
#region Private Fields
// Current scroll data
private Vector _offset;
private Vector _offsetChange;
private Size _extent;
private Vector _extentChange;
private Size _viewport;
private Vector _viewportChange;
#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
- x509store.cs
- OracleTimeSpan.cs
- SqlExpander.cs
- ColorContextHelper.cs
- XmlBaseReader.cs
- XmlIlVisitor.cs
- MULTI_QI.cs
- OracleLob.cs
- EllipticalNodeOperations.cs
- VisualTreeUtils.cs
- MdImport.cs
- ContextMenu.cs
- EntityDataSourceConfigureObjectContext.cs
- SmiRecordBuffer.cs
- SafePointer.cs
- ClrPerspective.cs
- ToolStripGripRenderEventArgs.cs
- StreamingContext.cs
- HScrollProperties.cs
- DrawingImage.cs
- ReplyAdapterChannelListener.cs
- CodeSnippetStatement.cs
- Helper.cs
- PointF.cs
- CommunicationException.cs
- XmlSchemaAttribute.cs
- Adorner.cs
- CacheOutputQuery.cs
- Process.cs
- LateBoundBitmapDecoder.cs
- ClientSettingsProvider.cs
- WebPartUtil.cs
- ConfigXmlWhitespace.cs
- DetailsViewModeEventArgs.cs
- PingReply.cs
- BrushMappingModeValidation.cs
- ButtonStandardAdapter.cs
- XslNumber.cs
- WorkflowTimerService.cs
- WindowsProgressbar.cs
- HtmlWindowCollection.cs
- AppDomainUnloadedException.cs
- NullReferenceException.cs
- NotificationContext.cs
- BCLDebug.cs
- StatementContext.cs
- RandomDelaySendsAsyncResult.cs
- SelectionPatternIdentifiers.cs
- TTSEvent.cs
- Memoizer.cs
- SafeSystemMetrics.cs
- EntityDataSourceChangedEventArgs.cs
- ExpressionConverter.cs
- XPathEmptyIterator.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ValidatorCompatibilityHelper.cs
- ControlPropertyNameConverter.cs
- PriorityBinding.cs
- InputGestureCollection.cs
- adornercollection.cs
- IChannel.cs
- ContextMenuStrip.cs
- CommandEventArgs.cs
- ChoiceConverter.cs
- OracleFactory.cs
- MDIClient.cs
- ContractBase.cs
- ComponentConverter.cs
- HitTestParameters3D.cs
- XmlBaseReader.cs
- UrlPropertyAttribute.cs
- ModifierKeysValueSerializer.cs
- SafeBitVector32.cs
- TargetException.cs
- TextMarkerSource.cs
- FilePrompt.cs
- PersistenceParticipant.cs
- Inline.cs
- FontCacheLogic.cs
- XmlSerializableWriter.cs
- SettingsPropertyValue.cs
- IsolatedStorageFileStream.cs
- WindowsFont.cs
- RoutingExtension.cs
- AstTree.cs
- XmlSchema.cs
- LZCodec.cs
- SystemUnicastIPAddressInformation.cs
- SizeChangedEventArgs.cs
- StylusPointDescription.cs
- DataGridViewIntLinkedList.cs
- StreamingContext.cs
- COM2PropertyBuilderUITypeEditor.cs
- EventlogProvider.cs
- CodeAssignStatement.cs
- XmlLanguageConverter.cs
- TargetControlTypeAttribute.cs
- EditorPart.cs
- HtmlTableCellCollection.cs
- SAPICategories.cs