ZoomController Class |
Namespace: Ab2d.Controls
public class ZoomController : Control
The ZoomController type exposes the following members.
Name | Description | |
---|---|---|
![]() | ZoomController |
Constructor
|
Name | Description | |
---|---|---|
![]() | IsAutoZoomPanelFindingEnabled |
Gets or sets a Boolean which specifies that if TargetZoomPanel or TargetZoomPanelName properties are not manually set the first ZoomPanel is automatically found from the current UserControl, Page or Window. Default value is true.
|
![]() | IsResetToLimits |
If true the Reset button on ZoomController will call ResetToLimits method instead of Reset.
|
![]() | TargetZoomPanel |
ZoomPanel control that is controlled by this ZoomController.
|
![]() | TargetZoomPanelName |
Gets or sets the name of the ZoomPanel that is controls with this ZoomController.
|
Name | Description | |
---|---|---|
![]() | OnApplyTemplate |
OnApplyTemplate
(Overrides FrameworkElementOnApplyTemplate.) |
Name | Description | |
---|---|---|
![]() ![]() | IsAutoZoomPanelFindingEnabledProperty |
IsAutoZoomPanelFindingEnabledProperty
|
![]() ![]() | IsResetToLimitsProperty |
IsResetToLimitsProperty
|
![]() ![]() | TargetZoomPanelNameProperty |
TargetZoomPanelNameProperty
|
![]() ![]() | TargetZoomPanelProperty |
TargetZoomPanelProperty
|
The ZoomController contains the following buttons: Move, Rectangle, ZoomIn, ZoomOut and Reset.
The first four buttons control the current zoom mode. If none is selected, than the current zoom mode is None - no mouse event is handled by the ZoomPanel.
The action of the reset button depends on the IsResetToLimits property. If it is false (by default) the buttons resets the ZoomPanel to show all the content - sets the Viewbox to "0 0 1 1". If its value is true, than the buttons calls ResetToLimits method that shows the whole content as it is defined by the ViewboxLimits property.
ZoomController can automatically discover the ZoomPanel in the current Window or Page. But if there are more ZoomPanels defined or you would like to explicitly set the ZoomPanel, TargetZoomPanelName or TargetZoomPanel can be used to connect ZoomController with the specific ZoomPanel. To disable the automatic discovery of ZoomPanel the IsAutoZoomPanelFindingEnabled property can be set to false.
<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> <ab2d:ZoomPanel Name="myZoomPanel"> <TextBlock>12345</TextBlock> </ab2d:ZoomPanel> <ab2d:ZoomController VerticalAlignment="Top" HorizontalAlignment="Right"/> </Grid> </Window>
<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> <ab2d:ZoomPanel Name="myZoomPanel"> <TextBlock>12345</TextBlock> </ab2d:ZoomPanel> <ab2d:ZoomController TargetZoomPanelName="myZoomPanel" VerticalAlignment="Top" HorizontalAlignment="Right"/> </Grid> </Window>
<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> <ab2d:ZoomPanel Name="myZoomPanel"> <TextBlock>12345</TextBlock> </ab2d:ZoomPanel> <ab2d:ZoomController TargetZoomPanel="{Binding ElementName=myZoomPanel}" VerticalAlignment="Top" HorizontalAlignment="Right"/> </Grid> </Window>