|
@@ -3,7 +3,6 @@
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
- xmlns:local="clr-namespace:compdfkit_tools.PDFControlUI"
|
|
|
|
xmlns:cpdfcommon="clr-namespace:compdfkit_tools.Common"
|
|
xmlns:cpdfcommon="clr-namespace:compdfkit_tools.Common"
|
|
mc:Ignorable="d"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="30" d:DesignWidth="162">
|
|
d:DesignHeight="30" d:DesignWidth="162">
|
|
@@ -13,18 +12,135 @@
|
|
<ResourceDictionary Source="pack://application:,,,/compdfkit-assets;component/Styles/ToggleButtonStyle.xaml"></ResourceDictionary>
|
|
<ResourceDictionary Source="pack://application:,,,/compdfkit-assets;component/Styles/ToggleButtonStyle.xaml"></ResourceDictionary>
|
|
<ResourceDictionary Source="pack://application:,,,/compdfkit-assets;component/Styles/ButtonStyle.xaml"></ResourceDictionary>
|
|
<ResourceDictionary Source="pack://application:,,,/compdfkit-assets;component/Styles/ButtonStyle.xaml"></ResourceDictionary>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
+ <SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
|
|
|
|
+ <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
|
|
|
|
+ <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
|
|
|
|
+ <Style x:Key="LimitedNumberBoxWithUnit" TargetType="{x:Type TextBox}">
|
|
|
|
+ <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
|
|
|
|
+ <Setter Property="BorderBrush" Value="Transparent"/>
|
|
|
|
+ <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
|
|
|
+ <Setter Property="BorderThickness" Value="1"/>
|
|
|
|
+ <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
|
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Left"/>
|
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
|
+ <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
|
|
|
+ <Setter Property="AllowDrop" Value="true"/>
|
|
|
|
+ <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
|
|
|
+ <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
|
|
|
+ <Setter Property="Template">
|
|
|
|
+ <Setter.Value>
|
|
|
|
+ <ControlTemplate TargetType="{x:Type TextBox}">
|
|
|
|
+ <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
|
|
|
+ <Grid>
|
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
|
+ <ColumnDefinition Width="*"/>
|
|
|
|
+ <ColumnDefinition Width="11"/>
|
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
|
+ <ScrollViewer Grid.Column="0" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Margin="5,0,0,0"/>
|
|
|
|
+ <TextBlock Grid.Column="1" Text="%" HorizontalAlignment="Right" VerticalAlignment="Center"/>
|
|
|
|
+ </Grid>
|
|
|
|
+ </Border>
|
|
|
|
+ </ControlTemplate>
|
|
|
|
+ </Setter.Value>
|
|
|
|
+ </Setter>
|
|
|
|
+ </Style>
|
|
|
|
+ <Style x:Key="TransparentToggleButton" TargetType="{x:Type ToggleButton}">
|
|
|
|
+ <Setter Property="Background" Value="Transparent"/>
|
|
|
|
+ <Setter Property="BorderBrush" Value="Transparent"/>
|
|
|
|
+ <Setter Property="Template">
|
|
|
|
+ <Setter.Value>
|
|
|
|
+ <ControlTemplate TargetType="{x:Type ToggleButton}">
|
|
|
|
+ <Border x:Name="border"
|
|
|
|
+ Background="{TemplateBinding Background}"
|
|
|
|
+ BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
+ BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
+ Padding="{TemplateBinding Padding}">
|
|
|
|
+ <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
+ VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
+ RecognizesAccessKey="True"/>
|
|
|
|
+ </Border>
|
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
|
+ <Trigger Property="IsChecked" Value="True">
|
|
|
|
+ <Setter TargetName="border" Property="Opacity" Value="0"/>
|
|
|
|
+ </Trigger>
|
|
|
|
+ <Trigger Property="IsMouseOver" Value="True">
|
|
|
|
+ <Setter TargetName="border" Property="Opacity" Value="0"/>
|
|
|
|
+ </Trigger>
|
|
|
|
+ <Trigger Property="IsPressed" Value="True">
|
|
|
|
+ <Setter TargetName="border" Property="Opacity" Value="0"/>
|
|
|
|
+ </Trigger>
|
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
|
+ </ControlTemplate>
|
|
|
|
+ </Setter.Value>
|
|
|
|
+ </Setter>
|
|
|
|
+ </Style>
|
|
|
|
+
|
|
|
|
+ <Style x:Key="PresetComboBox" TargetType="{x:Type ComboBox}">
|
|
|
|
+ <Setter Property="Template">
|
|
|
|
+ <Setter.Value>
|
|
|
|
+ <ControlTemplate TargetType="{x:Type ComboBox}">
|
|
|
|
+ <Border x:Name="border" BorderBrush="{StaticResource TextBox.Static.Border}" BorderThickness="1" Background="#FFFFFF">
|
|
|
|
+ <Grid>
|
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
|
+ <ColumnDefinition></ColumnDefinition>
|
|
|
|
+ <ColumnDefinition Width="15"></ColumnDefinition>
|
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
|
+ <Grid Grid.Column="1">
|
|
|
|
+ <Path Fill="#CDCDCD" Stroke="#CDCDCD" Grid.Column="1" Height="4.8" Width="7.38" Stretch="Fill">
|
|
|
|
+ <Path.Data>
|
|
|
|
+ M0.5 0.510248L4.5041 5.5L8.5 0.5L0.5 0.510248Z
|
|
|
|
+ </Path.Data>
|
|
|
|
+ </Path>
|
|
|
|
+
|
|
|
|
+ </Grid>
|
|
|
|
+ <Grid Grid.Column="0" Grid.ColumnSpan="2">
|
|
|
|
+ <ToggleButton IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
|
|
|
+ ClickMode="Press" Style="{StaticResource TransparentToggleButton}"></ToggleButton>
|
|
|
|
+ <Popup Name="popup"
|
|
|
|
+ IsOpen="{TemplateBinding IsDropDownOpen}"
|
|
|
|
+ Placement="Bottom" AllowsTransparency="True" PopupAnimation="Fade" VerticalOffset="1">
|
|
|
|
+ <Border MinWidth="{TemplateBinding ActualWidth}"
|
|
|
|
+ MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
|
|
|
+ <ScrollViewer MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
|
|
|
+ HorizontalScrollBarVisibility="Auto"
|
|
|
|
+ VerticalScrollBarVisibility="Auto">
|
|
|
|
+ <Border BorderBrush ="LightGray" BorderThickness="1">
|
|
|
|
+ <StackPanel Background="#FFFFFF" MinHeight="20"
|
|
|
|
+ IsItemsHost="True"/>
|
|
|
|
+ </Border>
|
|
|
|
+ </ScrollViewer>
|
|
|
|
+ </Border>
|
|
|
|
+ </Popup>
|
|
|
|
+ </Grid>
|
|
|
|
+ </Grid>
|
|
|
|
+ </Border>
|
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
|
+ <Trigger Property="IsMouseOver" Value="true">
|
|
|
|
+ <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/>
|
|
|
|
+ </Trigger>
|
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
|
+ </ControlTemplate>
|
|
|
|
+ </Setter.Value>
|
|
|
|
+ </Setter>
|
|
|
|
+ </Style>
|
|
|
|
+
|
|
</ResourceDictionary>
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
</UserControl.Resources>
|
|
<Grid Height="30" Width="160" HorizontalAlignment="Left">
|
|
<Grid Height="30" Width="160" HorizontalAlignment="Left">
|
|
<Grid.ColumnDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="72"></ColumnDefinition>
|
|
<ColumnDefinition Width="72"></ColumnDefinition>
|
|
- <ColumnDefinition Width="73"></ColumnDefinition>
|
|
|
|
- <ColumnDefinition Width="17"/>
|
|
|
|
|
|
+ <ColumnDefinition Width="*"></ColumnDefinition>
|
|
</Grid.ColumnDefinitions>
|
|
</Grid.ColumnDefinitions>
|
|
- <StackPanel Orientation="Horizontal" Height="30">
|
|
|
|
- <cpdfcommon:DropDownNumberBoxControl x:Name="DropDownNumberBoxControl" Height="30" Width=" 72" Maxium="1600" Minimum="0" Text="{Binding Scale,Mode=TwoWay}"></cpdfcommon:DropDownNumberBoxControl>
|
|
|
|
- </StackPanel>
|
|
|
|
- <StackPanel Grid.Column="1" Orientation="Horizontal" Grid.ColumnSpan="2">
|
|
|
|
|
|
+ <Grid>
|
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
|
+ <ColumnDefinition Width="1*"></ColumnDefinition>
|
|
|
|
+ <ColumnDefinition Width="20"></ColumnDefinition>
|
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
|
+ <ComboBox Grid.ColumnSpan="2" x:Name="ZoomComboBox" Background="#FFFFFF" Style="{StaticResource PresetComboBox}" SelectionChanged="ZoomComboBox_SelectionChanged" ></ComboBox>
|
|
|
|
+ <TextBox x:Name="ZoomTextBox" Text="{Binding Text, RelativeSource={RelativeSource AncestorType=UserControl}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource LimitedNumberBoxWithUnit}" HorizontalContentAlignment="Center" InputMethod.IsInputMethodEnabled="False" PreviewTextInput="TextBox_PreviewTextInput" PreviewKeyDown="TextBox_PreviewKeyDown" TextChanged="TextBox_TextChanged" LostFocus="ZoomTextBox_LostFocus">
|
|
|
|
+ </TextBox>
|
|
|
|
+ </Grid>
|
|
|
|
+ <StackPanel Grid.Column="1" Orientation="Horizontal" >
|
|
<Button x:Name="ScaleDecreaseButton" Style="{StaticResource LightButtonStyle}" Height="30" Width="30" Margin="20,0,0,0" Background="Transparent" BorderThickness="0" Click="ScaleDecreaseButton_Click">
|
|
<Button x:Name="ScaleDecreaseButton" Style="{StaticResource LightButtonStyle}" Height="30" Width="30" Margin="20,0,0,0" Background="Transparent" BorderThickness="0" Click="ScaleDecreaseButton_Click">
|
|
<Button.Content>
|
|
<Button.Content>
|
|
<Rectangle Width="12" Height="2" Fill="#0E1114"></Rectangle>
|
|
<Rectangle Width="12" Height="2" Fill="#0E1114"></Rectangle>
|