Click or drag to resize

ZoomPanelMiniMap Class

ZoomPanelMiniMap can show mini map from the ZoomPanel control.
Inheritance Hierarchy

Namespace:  Ab2d.Controls
Assembly:  Ab2d.Controls.ZoomPanel (in Ab2d.Controls.ZoomPanel.dll) Version: 5.2.6631.1040
Syntax
C#
public class ZoomPanelMiniMap : BaseMiniMap

The ZoomPanelMiniMap type exposes the following members.

Constructors
  NameDescription
Public methodZoomPanelMiniMap
Constructor
Top
Properties
  NameDescription
Public propertyIsAutoZoomPanelFindingEnabled
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.
Public propertyIsMouseWheelZoomEnabled
Gets or sets if zooming with mouse wheel is same as on ZoomPanel (null), enabled (true) or disabled (false). Default value is null - same as on ZoomPanel.
Public propertyTargetZoomPanel
Gets or sets a ZoomPanel control that is used to get the content of ZoomPanelMiniMap and position its rectangle.
Public propertyTargetZoomPanelName
Gets or sets the name of the ZoomPanel that is shown with this ZoomPanelMiniMap.
Top
Fields
  NameDescription
Public fieldStatic memberIsAutoZoomPanelFindingEnabledProperty
IsAutoZoomPanelFindingEnabledProperty
Public fieldStatic memberIsMouseWheelZoomEnabledProperty
IsMouseWheelZoomEnabledProperty
Public fieldStatic memberTargetZoomPanelNameProperty
TargetZoomPanelNameProperty
Public fieldStatic memberTargetZoomPanelProperty
ViewboxExProperty
Top
Remarks

ZoomPanelMiniMap can show mini map from the ZoomPanel control.

The control shows the whole content of the ZoomPanel in a smaller area. The rectangles on the MiniMap show the area that is currently shown by the ZoomPanel.

ZoomPanelMiniMap uses TargetZoomPanel property that tells which ZoomPanel is shown and controller by this ZoomPanelMiniMap. The TargetZoomPanel property can be manually set from code or XAML (using TargetZoomPanel="{Binding ElementName=ZoomPanel1}"). It can be also set with using TargetZoomPanelName property and specifying the name of the ZoomPanel control. When TargetZoomPanel and TargetZoomPanelName are not set, the control can set the TargetZoomPanel automatically with searching the visual tree and finding the first ZoomPanel. The automatic discovery is turned on by default. It can be turned off with IsAutoZoomPanelFindingEnabled property. Note that specifying TargetZoomPanel is the most performance effective way.

Default size of ZoomPanelMiniMap is 200 x 200. The size can be changed to any other size by specifying Width and Height properties.

The ZoomPanelMiniMap shows the content of the target ZoomPanel and a rectangle that shows the currently visible area. The appearance of the rectangle and the masked area are controlled by the properties defined in the BaseMiniMap control which the ZoomPanelMiniMap is derived from.

The RectangleStroke sets the Stroke of the Rectangle (default value is Blue). The RectangleStrokeThickness sets the StrokeThickness of the Rectangle (default value is 1). The MaskBrush sets the Brush that is used to mask the area that is not visible (default value is #46AAAAFF - semi transparent blue).

The ZoomPanelMiniMap can not only be used to show the content of the ZoomPanel but also to change the area that is shown by the ZoomPanel. It is possible to move the rectangle shown in the ZoomPanelMiniMap around with the mouse. This behavior can be enabled (default) or disabled with IsMovingViewboxEnabled property. It is also possible to zoom in and out with mouse wheel while mouse is over the ZoomPanelMiniMap. This behavior can be enabled (default) or disabled with IsMouseWheelZoomEnabled property.

Examples

The following sample shows how to define ZoomPanel and a MiniMap:

<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>
      <ScrollViewer CanContentScroll="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
          <ab2d:ZoomPanel Name="myZoomPanel" Viewbox="0.2 0.2 0.6 0.6" IsAnimated="True" AnimationDuration="0:0:0.5"
                          ViewboxLimits="-0.1 -0.1 1.2 1.2" ViewboxMinSize="0.1 0.1" IsViewboxLimited="True">
              <TextBlock>12345</TextBlock>
          </ab2d:ZoomPanel>
      </ScrollViewer>  
      <ab2d:ZoomController VerticalAlignment="Top" 
                           HorizontalAlignment="Right"/>

      <Border Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Right" Background="White" 
                              BorderBrush="Gray" BorderThickness="2">
          <StackPanel Orientation="Vertical" Margin="5">
              <TextBlock FontWeight="Bold" Margin="0 0 0 2">ZoomPanelMiniMap:</TextBlock>
              <ab2d:ZoomPanelMiniMap IsMovingViewboxEnabled="True" IsMouseWheelZoomEnabled="True"
                                     HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
          </StackPanel>
      </Border>     
    </Grid>
</Window>
See Also