C# 클래스 ZoomAndPan.ZoomAndPanControl

A class that wraps up zooming and panning of it's content.
파일 보기 프로젝트 열기: Zoomicon/ZUI 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
AnimationDurationProperty DependencyProperty
ContentOffsetXProperty DependencyProperty
ContentOffsetYProperty DependencyProperty
ContentScalableProperty DependencyProperty
ContentScaleProperty DependencyProperty
ContentViewportHeightProperty DependencyProperty
ContentViewportWidthProperty DependencyProperty
ContentZoomFocusXProperty DependencyProperty
ContentZoomFocusYProperty DependencyProperty
IsMouseWheelScrollingEnabledProperty DependencyProperty
MaxContentScaleProperty DependencyProperty
MinContentScaleProperty DependencyProperty
ViewportZoomFocusXProperty DependencyProperty
ViewportZoomFocusYProperty DependencyProperty

공개 메소드들

메소드 설명
AnimatedScaleToFit ( ) : void

Do animation that scales the content so that it fits completely in the control.

AnimatedSnapTo ( Point contentPoint ) : void

Use animation to center the view on the specified point (in content coordinates).

AnimatedZoomAboutPoint ( double newContentScale, Point contentZoomFocus ) : void

Zoom in/out centered on the specified point (in content coordinates). The focus point is kept locked to it's on screen position (ala google maps).

AnimatedZoomTo ( Rect contentRect ) : void

Do an animated zoom to the specified rectangle (in content coordinates).

AnimatedZoomTo ( double contentScale ) : void

Zoom in/out centered on the viewport center.

AnimatedZoomTo ( double newScale, Rect contentRect ) : void

Do an animated zoom to view a specific scale and rectangle (in content coordinates).

AnimatedZoomToFit ( ) : void

Do animation that scales the content so that it fits completely in the control.

ElementToLogicalPoint ( Point elementPoint ) : Point
LineDown ( ) : void

Shift the content offset one line down.

LineLeft ( ) : void

Shift the content offset one line left.

LineRight ( ) : void

Shift the content offset one line right.

LineUp ( ) : void

Shift the content offset one line up.

LogicalToElementPoint ( Point logicalPoint ) : Point
MakeVisible ( UIElement visual, Rect rectangle ) : Rect

Bring the specified rectangle to view.

MakeVisible ( Visual visual, Rect rectangle ) : Rect

Bring the specified rectangle to view.

MouseWheelDown ( ) : void

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.

MouseWheelLeft ( ) : void

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.

MouseWheelRight ( ) : void

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.

MouseWheelUp ( ) : void

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.

OnApplyTemplate ( ) : void

Called when a template has been applied to the control.

PageDown ( ) : void

Shift the content offset one page down.

PageLeft ( ) : void

Shift the content offset one page left.

PageRight ( ) : void

Shift the content offset one page right.

PageUp ( ) : void

Shift the content offset one page up.

ScaleToFit ( ) : void

Instantly scale the content so that it fits completely in the control.

ScrollToCenter ( Rect contentRect ) : void
SetHorizontalOffset ( double offset ) : void

Called when the offset of the horizontal scrollbar has been set.

SetVerticalOffset ( double offset ) : void

Called when the offset of the vertical scrollbar has been set.

SnapContentOffsetTo ( Point contentOffset ) : void

Instantly center the view on the specified point (in content coordinates).

SnapTo ( Point contentPoint ) : void

Instantly center the view on the specified point (in content coordinates).

UpdateScrollOffsets ( ) : void
ZoomAboutPoint ( double newContentScale, Point contentZoomFocus ) : void

Zoom in/out centered on the specified point (in content coordinates). The focus point is kept locked to it's on screen position (ala google maps).

ZoomAndPanControl ( ) : System

/*Static*/ constructor to define metadata for the control (and link it to the style in Generic.xaml).

ZoomIn ( Point contentZoomCenter, double ZoomFactorStep = 0.2 ) : void

Zoom in at logical point

ZoomIn ( double ZoomFactorStep = 0.2 ) : void

Zoom in at view center

ZoomOut ( Point contentZoomCenter, double ZoomFactorStep = 0.2 ) : void

Zoom out at logical point

ZoomOut ( double ZoomFactorStep = 0.2 ) : void

Zoom out at view center

ZoomTo ( Rect contentRect ) : void

Instantly zoom to the specified rectangle (in content coordinates).

ZoomTo ( double contentScale ) : void

Zoom in/out centered on the viewport center.

ZoomToFit ( ) : void

Instantly scale the content so that it fits completely in the control.

보호된 메소드들

메소드 설명
ArrangeOverride ( Size arrangeBounds ) : Size

Arrange the control and it's children.

MeasureOverride ( Size constraint ) : Size

Measure the control and it's children.

OnMouseDoubleClick ( MouseButtonEventArgs e ) : void
OnMouseDown ( MouseButtonEventArgs e, MouseButton changedButton ) : void
OnMouseLeftButtonDown ( MouseButtonEventArgs e ) : void
OnMouseLeftButtonUp ( MouseButtonEventArgs e ) : void
OnMouseMove ( MouseEventArgs e ) : void
OnMouseRightButtonDown ( MouseButtonEventArgs e ) : void
OnMouseRightButtonUp ( MouseButtonEventArgs e ) : void
OnMouseUp ( MouseButtonEventArgs e, MouseButton changedButton ) : void
OnMouseWheel ( MouseWheelEventArgs e ) : void

비공개 메소드들

메소드 설명
AnimatedZoomPointToViewportCenter ( double newContentScale, Point contentZoomFocus, EventHandler callback ) : void

Zoom to the specified scale and move the specified focus point to the center of the viewport.

ApplyDragZoomRect ( ) : void

When the user has finished dragging out the rectangle the zoom operation is applied.

ClearPrevZoomRect ( ) : void

Clear the memory of the previous zoom level.

ContentOffsetX_Coerce ( DependencyObject d, object baseValue ) : object

Method called to clamp the 'ContentOffsetX' value to its valid range.

ContentOffsetX_PropertyChanged ( DependencyObject o, DependencyPropertyChangedEventArgs e ) : void

Event raised when the 'ContentOffsetX' property has changed value.

ContentOffsetY_Coerce ( DependencyObject d, object baseValue ) : object

Method called to clamp the 'ContentOffsetY' value to its valid range.

ContentOffsetY_PropertyChanged ( DependencyObject o, DependencyPropertyChangedEventArgs e ) : void

Event raised when the 'ContentOffsetY' property has changed value.

ContentScale_Coerce ( DependencyObject d, object baseValue ) : object

Method called to clamp the 'ContentScale' value to its valid range.

ContentScale_PropertyChanged ( DependencyObject o, DependencyPropertyChangedEventArgs e ) : void

Event raised when the 'ContentScale' property has changed value.

FadeOutDragZoomRect ( ) : void
InitDragZoomRect ( Point pt1, Point pt2 ) : void

Initialise the rectangle that the use is dragging out.

MinOrMaxContentScale_PropertyChanged ( DependencyObject o, DependencyPropertyChangedEventArgs e ) : void

Event raised 'MinContentScale' or 'MaxContentScale' has changed.

ResetViewportZoomFocus ( ) : void

Reset the viewport zoom focus to the center of the viewport.

SavePrevZoomRect ( ) : void
SetDragZoomRect ( Point pt1, Point pt2 ) : void

Update the position and size of the rectangle that user is dragging out.

UpdateContentViewportSize ( ) : void

Update the size of the viewport in content coordinates after the viewport size or 'ContentScale' has changed.

UpdateContentZoomFocusX ( ) : void

Update the X coordinate of the zoom focus point in content coordinates.

UpdateContentZoomFocusY ( ) : void

Update the Y coordinate of the zoom focus point in content coordinates.

UpdateTranslationX ( ) : void

Update the X coordinate of the translation transformation.

UpdateTranslationY ( ) : void

Update the Y coordinate of the translation transformation.

UpdateViewportSize ( Size newSize ) : void

Update the viewport size from the specified size.

ZoomPointToViewportCenter ( double newContentScale, Point contentZoomFocus ) : void

Zoom to the specified scale and move the specified focus point to the center of the viewport.

메소드 상세

AnimatedScaleToFit() 공개 메소드

Do animation that scales the content so that it fits completely in the control.
public AnimatedScaleToFit ( ) : void
리턴 void

AnimatedSnapTo() 공개 메소드

Use animation to center the view on the specified point (in content coordinates).
public AnimatedSnapTo ( Point contentPoint ) : void
contentPoint Point
리턴 void

AnimatedZoomAboutPoint() 공개 메소드

Zoom in/out centered on the specified point (in content coordinates). The focus point is kept locked to it's on screen position (ala google maps).
public AnimatedZoomAboutPoint ( double newContentScale, Point contentZoomFocus ) : void
newContentScale double
contentZoomFocus Point
리턴 void

AnimatedZoomTo() 공개 메소드

Do an animated zoom to the specified rectangle (in content coordinates).
public AnimatedZoomTo ( Rect contentRect ) : void
contentRect System.Windows.Rect
리턴 void

AnimatedZoomTo() 공개 메소드

Zoom in/out centered on the viewport center.
public AnimatedZoomTo ( double contentScale ) : void
contentScale double
리턴 void

AnimatedZoomTo() 공개 메소드

Do an animated zoom to view a specific scale and rectangle (in content coordinates).
public AnimatedZoomTo ( double newScale, Rect contentRect ) : void
newScale double
contentRect Rect
리턴 void

AnimatedZoomToFit() 공개 메소드

Do animation that scales the content so that it fits completely in the control.
public AnimatedZoomToFit ( ) : void
리턴 void

ArrangeOverride() 보호된 메소드

Arrange the control and it's children.
protected ArrangeOverride ( Size arrangeBounds ) : Size
arrangeBounds Size
리턴 Size

ElementToLogicalPoint() 공개 메소드

public ElementToLogicalPoint ( Point elementPoint ) : Point
elementPoint Point
리턴 Point

LineDown() 공개 메소드

Shift the content offset one line down.
public LineDown ( ) : void
리턴 void

LineLeft() 공개 메소드

Shift the content offset one line left.
public LineLeft ( ) : void
리턴 void

LineRight() 공개 메소드

Shift the content offset one line right.
public LineRight ( ) : void
리턴 void

LineUp() 공개 메소드

Shift the content offset one line up.
public LineUp ( ) : void
리턴 void

LogicalToElementPoint() 공개 메소드

public LogicalToElementPoint ( Point logicalPoint ) : Point
logicalPoint Point
리턴 Point

MakeVisible() 공개 메소드

Bring the specified rectangle to view.
public MakeVisible ( UIElement visual, Rect rectangle ) : Rect
visual UIElement
rectangle Rect
리턴 Rect

MakeVisible() 공개 메소드

Bring the specified rectangle to view.
public MakeVisible ( Visual visual, Rect rectangle ) : Rect
visual Visual
rectangle Rect
리턴 Rect

MeasureOverride() 보호된 메소드

Measure the control and it's children.
protected MeasureOverride ( Size constraint ) : Size
constraint Size
리턴 Size

MouseWheelDown() 공개 메소드

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.
public MouseWheelDown ( ) : void
리턴 void

MouseWheelLeft() 공개 메소드

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.
public MouseWheelLeft ( ) : void
리턴 void

MouseWheelRight() 공개 메소드

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.
public MouseWheelRight ( ) : void
리턴 void

MouseWheelUp() 공개 메소드

Don't handle mouse wheel input from the ScrollViewer, the mouse wheel is used for zooming in and out, not for manipulating the scrollbars.
public MouseWheelUp ( ) : void
리턴 void

OnApplyTemplate() 공개 메소드

Called when a template has been applied to the control.
public OnApplyTemplate ( ) : void
리턴 void

OnMouseDoubleClick() 보호된 메소드

protected OnMouseDoubleClick ( MouseButtonEventArgs e ) : void
e MouseButtonEventArgs
리턴 void

OnMouseDown() 보호된 메소드

protected OnMouseDown ( MouseButtonEventArgs e, MouseButton changedButton ) : void
e MouseButtonEventArgs
changedButton MouseButton
리턴 void

OnMouseLeftButtonDown() 보호된 메소드

protected OnMouseLeftButtonDown ( MouseButtonEventArgs e ) : void
e MouseButtonEventArgs
리턴 void

OnMouseLeftButtonUp() 보호된 메소드

protected OnMouseLeftButtonUp ( MouseButtonEventArgs e ) : void
e MouseButtonEventArgs
리턴 void

OnMouseMove() 보호된 메소드

protected OnMouseMove ( MouseEventArgs e ) : void
e MouseEventArgs
리턴 void

OnMouseRightButtonDown() 보호된 메소드

protected OnMouseRightButtonDown ( MouseButtonEventArgs e ) : void
e MouseButtonEventArgs
리턴 void

OnMouseRightButtonUp() 보호된 메소드

protected OnMouseRightButtonUp ( MouseButtonEventArgs e ) : void
e MouseButtonEventArgs
리턴 void

OnMouseUp() 보호된 메소드

protected OnMouseUp ( MouseButtonEventArgs e, MouseButton changedButton ) : void
e MouseButtonEventArgs
changedButton MouseButton
리턴 void

OnMouseWheel() 보호된 메소드

protected OnMouseWheel ( MouseWheelEventArgs e ) : void
e MouseWheelEventArgs
리턴 void

PageDown() 공개 메소드

Shift the content offset one page down.
public PageDown ( ) : void
리턴 void

PageLeft() 공개 메소드

Shift the content offset one page left.
public PageLeft ( ) : void
리턴 void

PageRight() 공개 메소드

Shift the content offset one page right.
public PageRight ( ) : void
리턴 void

PageUp() 공개 메소드

Shift the content offset one page up.
public PageUp ( ) : void
리턴 void

ScaleToFit() 공개 메소드

Instantly scale the content so that it fits completely in the control.
public ScaleToFit ( ) : void
리턴 void

ScrollToCenter() 공개 메소드

public ScrollToCenter ( Rect contentRect ) : void
contentRect Rect
리턴 void

SetHorizontalOffset() 공개 메소드

Called when the offset of the horizontal scrollbar has been set.
public SetHorizontalOffset ( double offset ) : void
offset double
리턴 void

SetVerticalOffset() 공개 메소드

Called when the offset of the vertical scrollbar has been set.
public SetVerticalOffset ( double offset ) : void
offset double
리턴 void

SnapContentOffsetTo() 공개 메소드

Instantly center the view on the specified point (in content coordinates).
public SnapContentOffsetTo ( Point contentOffset ) : void
contentOffset Point
리턴 void

SnapTo() 공개 메소드

Instantly center the view on the specified point (in content coordinates).
public SnapTo ( Point contentPoint ) : void
contentPoint Point
리턴 void

UpdateScrollOffsets() 공개 메소드

public UpdateScrollOffsets ( ) : void
리턴 void

ZoomAboutPoint() 공개 메소드

Zoom in/out centered on the specified point (in content coordinates). The focus point is kept locked to it's on screen position (ala google maps).
public ZoomAboutPoint ( double newContentScale, Point contentZoomFocus ) : void
newContentScale double
contentZoomFocus Point
리턴 void

ZoomAndPanControl() 공개 메소드

/*Static*/ constructor to define metadata for the control (and link it to the style in Generic.xaml).
public ZoomAndPanControl ( ) : System
리턴 System

ZoomIn() 공개 메소드

Zoom in at logical point
public ZoomIn ( Point contentZoomCenter, double ZoomFactorStep = 0.2 ) : void
contentZoomCenter Point
ZoomFactorStep double
리턴 void

ZoomIn() 공개 메소드

Zoom in at view center
public ZoomIn ( double ZoomFactorStep = 0.2 ) : void
ZoomFactorStep double
리턴 void

ZoomOut() 공개 메소드

Zoom out at logical point
public ZoomOut ( Point contentZoomCenter, double ZoomFactorStep = 0.2 ) : void
contentZoomCenter Point
ZoomFactorStep double
리턴 void

ZoomOut() 공개 메소드

Zoom out at view center
public ZoomOut ( double ZoomFactorStep = 0.2 ) : void
ZoomFactorStep double
리턴 void

ZoomTo() 공개 메소드

Instantly zoom to the specified rectangle (in content coordinates).
public ZoomTo ( Rect contentRect ) : void
contentRect Rect
리턴 void

ZoomTo() 공개 메소드

Zoom in/out centered on the viewport center.
public ZoomTo ( double contentScale ) : void
contentScale double
리턴 void

ZoomToFit() 공개 메소드

Instantly scale the content so that it fits completely in the control.
public ZoomToFit ( ) : void
리턴 void

프로퍼티 상세

AnimationDurationProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty AnimationDurationProperty
리턴 DependencyProperty

ContentOffsetXProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ContentOffsetXProperty
리턴 DependencyProperty

ContentOffsetYProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ContentOffsetYProperty
리턴 DependencyProperty

ContentScalableProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ContentScalableProperty
리턴 DependencyProperty

ContentScaleProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ContentScaleProperty
리턴 DependencyProperty

ContentViewportHeightProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ContentViewportHeightProperty
리턴 DependencyProperty

ContentViewportWidthProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ContentViewportWidthProperty
리턴 DependencyProperty

ContentZoomFocusXProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ContentZoomFocusXProperty
리턴 DependencyProperty

ContentZoomFocusYProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ContentZoomFocusYProperty
리턴 DependencyProperty

IsMouseWheelScrollingEnabledProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty IsMouseWheelScrollingEnabledProperty
리턴 DependencyProperty

MaxContentScaleProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty MaxContentScaleProperty
리턴 DependencyProperty

MinContentScaleProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty MinContentScaleProperty
리턴 DependencyProperty

ViewportZoomFocusXProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ViewportZoomFocusXProperty
리턴 DependencyProperty

ViewportZoomFocusYProperty 공개적으로 정적으로 프로퍼티

public static DependencyProperty ViewportZoomFocusYProperty
리턴 DependencyProperty