Xceed Toolkit Plus for WPF v4.6 Documentation
Magnifier Class
Members  Example 


Xceed.Wpf.Toolkit Assembly > Xceed.Wpf.Toolkit Namespace : Magnifier Class
Represents a control that allows a user to magnify parts of an application.
Syntax
'Declaration
 
<TemplatePartAttribute(Name="PART_VisualBrush", Type=System.Windows.Media.VisualBrush)>
<StyleTypedPropertyAttribute(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)>
<XmlLangPropertyAttribute("Language")>
<UsableDuringInitializationAttribute(True)>
<RuntimeNamePropertyAttribute("Name")>
<UidPropertyAttribute("Uid")>
<TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>
<NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>
Public Class Magnifier 
   Inherits System.Windows.Controls.Control
'Usage
 
Dim instance As Magnifier
[TemplatePart(Name="PART_VisualBrush", Type=System.Windows.Media.VisualBrush)]
[StyleTypedProperty(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)]
[XmlLangProperty("Language")]
[UsableDuringInitialization(true)]
[RuntimeNameProperty("Name")]
[UidProperty("Uid")]
[TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)]
[NameScopeProperty("NameScope", System.Windows.NameScope)]
public class Magnifier : System.Windows.Controls.Control 
Remarks

The Magnifier can be added to any element that is of type UIElement. This is done by using the MagnifierManager. Simply set the MagnifierManager.Magnifier property to the toolkit's Magnifier instance.

Example
The following example adds a Magnifier to the parent grid of a Window. Everything contained in Grid can be magnified.
<Window x:Class="WPFToolkit.Extended.Samples.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
        Title="MainWindow" Height="350" Width="525" >
    <Grid>
        <xctk:MagnifierManager.Magnifier>
            <xctk:Magnifier Radius="100" ZoomFactor=".4" />
        </xctk:MagnifierManager.Magnifier>
        <RichTextBox />
    </Grid>
</Window>
The following attaches a Magnifier to a Grid using a Radius of 75, a red boder that is 1 pixel thick, and a ZoomFactor of 0.3526.
<Window x:Class="WPFToolkit.Extended.Samples.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
        Title="MainWindow" Height="350" Width="525" >
    <Grid>
        <xctk:MagnifierManager.Magnifier>
            <xctk:Magnifier BorderBrush="Red"
                                  BorderThickness="1"
                                  Radius="75" 
                                  ZoomFactor=".3526" />
        </xctk:MagnifierManager.Magnifier>
        <RichTextBox />
    </Grid>
</Window>
Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Media.Visual
            System.Windows.UIElement
               System.Windows.FrameworkElement
                  System.Windows.Controls.Control
                     Xceed.Wpf.Toolkit.Magnifier

Requirements

Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Magnifier Members
Xceed.Wpf.Toolkit Namespace