You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
6.9 KiB
99 lines
6.9 KiB
<!--*********************************************************************
|
|
|
|
Extended WPF Toolkit
|
|
|
|
Copyright (C) 2010-2012 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the Microsoft Public
|
|
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
|
|
|
|
This program can be provided to you by Xceed Software Inc. under a
|
|
proprietary commercial license agreement for use in non-Open Source
|
|
projects. The commercial version of Extended WPF Toolkit also includes
|
|
priority technical support, commercial updates, and many additional
|
|
useful WPF controls if you license Xceed Business Suite for WPF.
|
|
|
|
Visit http://xceed.com and follow @datagrid on Twitter.
|
|
|
|
********************************************************************-->
|
|
|
|
<sample:DemoView x:Class="Samples.Modules.Magnifier.Views.HomeView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sample="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:conv="clr-namespace:Samples.Modules.Magnifier.Converters"
|
|
Title="Magnifier"
|
|
Description="The Magnifier control allows the user to magnify parts of an application.">
|
|
<sample:DemoView.Resources>
|
|
<conv:ColorConverter x:Key="colorConverter" />
|
|
<conv:VisibilityConverter x:Key="visibilityConverter" />
|
|
<xctk:RtfFormatter x:Key="rtfFormatter" />
|
|
|
|
<ObjectDataProvider x:Key="enumData" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="xctk:FrameType"/>
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
</sample:DemoView.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<GroupBox Header="Features" Grid.Row="0" Margin="5">
|
|
<Grid Margin="5" HorizontalAlignment="Left">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="Zoom Factor:" VerticalAlignment="Center" Margin="5" />
|
|
<xctk:DoubleUpDown x:Name="_zoomFactor" Grid.Column="1" Value="0.4" Minimum="0" Increment="0.1" Width="150" Margin="5" />
|
|
<TextBlock Text="Border Thickness:" Grid.Row="1" VerticalAlignment="Center" Margin="5" />
|
|
<xctk:IntegerUpDown x:Name="_borderThickness" Grid.Row="1" Grid.Column="1" Value="2" Minimum="0" Maximum="20" Width="150" Margin="5" />
|
|
<TextBlock Text="Border Brush:" Grid.Row="2" VerticalAlignment="Center" Margin="5"/>
|
|
<xctk:ColorPicker x:Name="_colorPicker" Grid.Row="2" Grid.Column="1" Width="150" Margin="5" SelectedColor="Green"/>
|
|
<TextBlock Grid.Column="2" Text="Frame Type:" VerticalAlignment="Center" />
|
|
<ComboBox x:Name="_frameType" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumData}}" Grid.Column="3" Width="150" Margin="5" />
|
|
<TextBlock Text="Radius:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" VerticalAlignment="Center" />
|
|
<xctk:DoubleUpDown x:Name="_radius" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=0}" Grid.Row="1" Grid.Column="3" Value="80" Minimum="0" Maximum="150" Width="150" Margin="5" />
|
|
<TextBlock Text="RectangleWidth:" Grid.Row="1" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" />
|
|
<xctk:DoubleUpDown x:Name="_width" Grid.Row="1" Grid.Column="3" Value="160" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Width="150" Margin="5" />
|
|
<TextBlock Text="RectangleHeight:" Grid.Row="2" Grid.Column="2" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" VerticalAlignment="Center" />
|
|
<xctk:DoubleUpDown x:Name="_height" Grid.Row="2" Grid.Column="3" Value="160" Minimum="0" Maximum="300" Visibility="{Binding ElementName=_frameType, Path=SelectedItem, Converter={StaticResource visibilityConverter}, ConverterParameter=1}" Width="150" Margin="5" />
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<StackPanel Grid.Row="1" Margin="10" HorizontalAlignment="Left" >
|
|
<TextBlock Text="Usage:" Style="{StaticResource Header}"/>
|
|
<Grid>
|
|
<xctk:RichTextBox x:Name="_txtContent"
|
|
IsReadOnly="True"
|
|
TextFormatter="{StaticResource rtfFormatter}"
|
|
FontSize="10" >
|
|
<xctk:MagnifierManager.Magnifier>
|
|
<xctk:Magnifier x:Name="_magnifier"
|
|
Background="White"
|
|
Radius="{Binding Source={x:Reference _radius}, Path=Value}"
|
|
ZoomFactor="{Binding Source={x:Reference _zoomFactor}, Path=Value}"
|
|
FrameType="{Binding Source={x:Reference _frameType}, Path=SelectedItem}"
|
|
BorderBrush="{Binding Source={x:Reference _colorPicker}, Path=SelectedColor, Converter={StaticResource colorConverter}}"
|
|
BorderThickness="{Binding Source={x:Reference _borderThickness}, Path=Value}"
|
|
Width="{Binding Source={x:Reference _width}, Path=Value, Mode=TwoWay}"
|
|
Height="{Binding Source={x:Reference _height}, Path=Value, Mode=TwoWay}" />
|
|
</xctk:MagnifierManager.Magnifier>
|
|
</xctk:RichTextBox>
|
|
</Grid>
|
|
</StackPanel>
|
|
</Grid>
|
|
</sample:DemoView>
|
|
|