ViewboxEx Class |
Namespace: Ab2d.Controls
public class ViewboxEx : Decorator, IScrollInfo
The ViewboxEx type exposes the following members.
Name | Description | |
---|---|---|
![]() | ActualContentBounds |
Gets the Bounds of the contents of a ViewboxEx after the transformation were applied to it.
Note that the value is changed after the ViewboxEx is rendered and not immediately after the properties change.
|
![]() | ActualContentSize |
Gets the Size of the contents of a ViewboxEx after the transformation were applied to it.
|
![]() | ActualViewbox |
Gets the Rect that describes the area of the content that is actally visible on the screen.
|
![]() | CanHorizontallyScroll |
CanHorizontallyScroll
|
![]() | CanVerticallyScroll |
CanVerticallyScroll
|
![]() | Child |
Gets or sets the single child of a ViewboxEx element.
(Overrides DecoratorChild.) |
![]() | ContentSize |
Gets the Size of the contents of a ViewboxEx before the transformation are applied to it.
|
![]() | ExtentHeight |
ExtentHeight
|
![]() | ExtentWidth |
ExtentWidth
|
![]() | HorizontalOffset |
HorizontalOffset
|
![]() | RotationAngle |
Gets or sets the rotation angle in degress, that determines the angle with witch the content of the ZoomPanel is rotated around the center of the ZoomPanel.
|
![]() | ScrollOwner |
ScrollOwner
|
![]() | Stretch |
Gets or sets the ViewboxEx System.Windows.Media.Stretch
mode, which determines how content fits into the available space.
|
![]() | StretchDirection |
Gets or sets the System.Windows.Controls.StretchDirection, which determines
how scaling is applied to the contents of a ViewboxEx.
|
![]() | VerticalOffset |
VerticalOffset
|
![]() | Viewbox |
Gets or sets the box as Rect that determines which part of the the contents of a ViewboxEx is shown.
Default value is "0 0 1 1" that shows the whole content.
|
![]() | ViewboxUnits |
Specifies the coordinate system used by Viewbox property Default value is BrushMappingMode.RelativeToBoundingBox.
|
![]() | ViewportHeight |
ViewportHeight
|
![]() | ViewportWidth |
ViewportWidth
|
Name | Description | |
---|---|---|
![]() | GetRelativeViewbox |
Gets the Viewbox as Rect in relative units.
|
![]() | LineDown |
LineDown
|
![]() | LineLeft |
LineLeft
|
![]() | LineRight |
LineRight
|
![]() | LineUp |
LineUp
|
![]() | MakeVisible |
MakeVisible
|
![]() | MouseWheelDown |
MouseWheelDown
|
![]() | MouseWheelLeft |
MouseWheelLeft
|
![]() | MouseWheelRight |
MouseWheelRight
|
![]() | MouseWheelUp |
MouseWheelUp
|
![]() | PageDown |
PageDown
|
![]() | PageLeft |
PageLeft
|
![]() | PageRight |
PageRight
|
![]() | PageUp |
PageUp
|
![]() | SetHorizontalOffset |
SetHorizontalOffset
|
![]() | SetVerticalOffset |
SetVerticalOffset
|
Name | Description | |
---|---|---|
![]() | ActualViewboxChanged |
ActualViewboxChanged occurs after the ActualViewbox value is changed.
|
Name | Description | |
---|---|---|
![]() ![]() | DefaultViewbox |
Default Viewbox value
|
![]() ![]() | RotationAngleProperty |
RotationAngleProperty
|
![]() ![]() | StretchDirectionProperty |
StretchDirectionProperty
|
![]() ![]() | StretchProperty |
StretchProperty
|
![]() ![]() | ViewboxProperty |
ViewboxProperty
|
![]() ![]() | ViewboxUnitsProperty |
ViewboxUnitsProperty
|
ViewboxEx is an upgrade to the WPF's Viewbox control.
In addition to set the Stretch property of the Viewbox the ViewboxEx provide additional Viewbox property. It is a System.Windows.Rect type that specifies which part of the ViewboxEx content is shown.
For example the Viewbox value "0 0 1 1" means that the whole content of the ViewboxEx will be shown - same as WPF's Viewbox.
The value "0.5 0 0.5 1" means that only the right half of the content will be shown - x starting at 50%, y starting at 0%, width 50% and height 100%.
The value "0.5 0.5 0.5 0.5" means that only the lower right quarter of the content will be shown.
The value "-1 0 3 1" means that the ViewboxEx will show the area that is 3 times wider than its content - so the content will be shown in the middle of the ViewboxEx and there will be an empty area to the left and right of the content.
<Window x:Class="Ab2d.ZoomControlSample.ZoomPanelSample" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ab2d="clr-namespace:Ab2d.Controls;assembly=Ab2d.Controls.ZoomPanel"> <Grid> <Button Name="StartStoryboardButton" VerticalAlignment="Top" HorizontalAlignment="Left">Start Animation <Button.Triggers> <EventTrigger RoutedEvent="Button.Click"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard Name="XamlRectStoryboard"> <ab2d:RectAnimation From="0 0 1 1" To="0.2 0.2 0.6 0.6" Duration="0:0:4" Storyboard.TargetName="Viewbox1" Storyboard.TargetProperty="Viewbox"/> <ab2d:RectAnimation To="0.5 0.4 0.2 0.2" BeginTime="0:0:4" Duration="0:0:4" Storyboard.TargetName="Viewbox1" Storyboard.TargetProperty="Viewbox"/> <ab2d:RectAnimation To="0 0 1 1" BeginTime="0:0:8" Duration="0:0:2" Storyboard.TargetName="Viewbox1" Storyboard.TargetProperty="Viewbox"/> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> </Button.Triggers> </Button> <ab2d:ViewboxEx Name="Viewbox1"> <TextBlock>12345</TextBlock> </ab2d:ViewboxEx> </Grid> </Window>